Subversion Repositories spk

Rev

Rev 102 | Rev 105 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 102 Rev 104
Line 12... Line 12...
12
#include <spk.h>
12
#include <spk.h>
13
#undef GetTempPath
13
#undef GetTempPath
14
#undef GetCurrentDirectory
14
#undef GetCurrentDirectory
15
 
15
 
16
CPackages	packages;
16
CPackages	packages;
17
CLanguages	Language;
-
 
18
 
-
 
19
 
-
 
20
 
17
 
21
[STAThreadAttribute]
18
[STAThreadAttribute]
22
int main(array<System::String ^> ^args)
19
int main(array<System::String ^> ^args)
23
{
20
{
24
	// Enabling Windows XP visual effects before any controls are created
21
	// Enabling Windows XP visual effects before any controls are created
Line 32... Line 29...
32
	CyStringList dirList;
29
	CyStringList dirList;
33
	CyStringList remDirList;
30
	CyStringList remDirList;
34
	System::String ^gameArgs;
31
	System::String ^gameArgs;
35
	System::String ^openPackage;
32
	System::String ^openPackage;
36
 
33
 
37
	Language.SetLanguage(44);
34
	CLanguages::Instance()->SetLanguage(44);
38
 
35
 
39
	bool Advanced = false, fromLauncher = false, silent = false, gamerun = false;
36
	bool Advanced = false, fromLauncher = false, silent = false, gamerun = false;
40
	for ( int i = 0; i < args->Length; i++ )
37
	for ( int i = 0; i < args->Length; i++ )
41
	{
38
	{
42
		CyString arg = CyStringFromSystemString(args[i]);
39
		CyString arg = CyStringFromSystemString(args[i]);
Line 135... Line 132...
135
	RegistryKey ^searchKeyLang = Registry::CurrentUser->OpenSubKey("Software\\Egosoft\\PluginManagerSettings");
132
	RegistryKey ^searchKeyLang = Registry::CurrentUser->OpenSubKey("Software\\Egosoft\\PluginManagerSettings");
136
	if ( searchKeyLang )
133
	if ( searchKeyLang )
137
	{
134
	{
138
		int lang = System::Convert::ToInt32(searchKeyLang->GetValue("Language"));
135
		int lang = System::Convert::ToInt32(searchKeyLang->GetValue("Language"));
139
		if ( lang )
136
		if ( lang )
140
			Language.SetLanguage(lang);
137
			CLanguages::Instance()->SetLanguage(lang);
141
	}
138
	}
142
 
139
 
143
 
140
 
144
	bool firstInstance = false;
141
	bool firstInstance = false;
145
	System::Threading::Mutex ^mut = gcnew System::Threading::Mutex(false, "Local\\XPluginManagerLite", firstInstance);
142
	System::Threading::Mutex ^mut = gcnew System::Threading::Mutex(false, "Local\\XPluginManagerLite", firstInstance);
Line 173... Line 170...
173
						delete (IDisposable ^)sw;
170
						delete (IDisposable ^)sw;
174
				}
171
				}
175
			}
172
			}
176
		}
173
		}
177
		else if ( !silent )
174
		else if ( !silent )
178
			MessageBox::Show(SystemStringFromCyString(Language.GetText_Startup(LANGSTARTUP_ANOTHERINSTANCE)), SystemStringFromCyString(Language.GetText_Startup(LANGSTARTUP_ANOTHERINSTANCE_TITLE)), MessageBoxButtons::OK, MessageBoxIcon::Stop);
175
			MessageBox::Show(_US(CLanguages::Instance()->findText(LS_STARTUP, LANGSTARTUP_ANOTHERINSTANCE)), _US(CLanguages::Instance()->findText(LS_STARTUP, LANGSTARTUP_ANOTHERINSTANCE_TITLE)), MessageBoxButtons::OK, MessageBoxIcon::Stop);
179
		return 0;
176
		return 0;
180
	}
177
	}
181
 
178
 
182
	RegistryKey ^searchKey = Registry::CurrentUser->CreateSubKey("Software\\Egosoft\\PluginManagerSettings");
179
	RegistryKey ^searchKey = Registry::CurrentUser->CreateSubKey("Software\\Egosoft\\PluginManagerSettings");
183
	if ( searchKey )
180
	if ( searchKey )