Subversion Repositories spk

Rev

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

Rev 160 Rev 182
Line 215... Line 215...
215
				if ( cmd == "dir" )
215
				if ( cmd == "dir" )
216
				{
216
				{
217
					// first check its on the list
217
					// first check its on the list
218
					if ( !dirList.findString(rest) )
218
					if ( !dirList.findString(rest) )
219
					{
219
					{
220
						Utils::String gameName = packages.GetGameName(rest).ToString();
220
						Utils::String gameName = packages.getGameName(rest);
221
						if ( !gameName.empty() )
221
						if ( !gameName.empty() )
222
						{
222
						{
223
							int lang = packages.GetGameLanguage(rest);
223
							int lang = packages.getGameLanguage(rest);
224
							if ( lang )
224
							if ( lang )
225
								dirList.pushBack(rest, Utils::String::Number(lang) + "|" + gameName);
225
								dirList.pushBack(rest, Utils::String::Number(lang) + "|" + gameName);
226
							else
226
							else
227
								dirList.pushBack(rest, gameName);
227
								dirList.pushBack(rest, gameName);
228
							anyDirs = true;
228
							anyDirs = true;
Line 265... Line 265...
265
				else if ( cmd == "savegamemanager" )
265
				else if ( cmd == "savegamemanager" )
266
					gui->SetSaveGameManager(rest.toInt());
266
					gui->SetSaveGameManager(rest.toInt());
267
				else if ( cmd == "restoremodified" ) {
267
				else if ( cmd == "restoremodified" ) {
268
					CPackages p;
268
					CPackages p;
269
					p.startup(".", _S(tempDir), _S(mydoc), "");
269
					p.startup(".", _S(tempDir), _S(mydoc), "");
270
					if ( p.Read(rest) ) {
270
					if ( p.read(rest) ) {
271
						p.SetVanilla(false);
271
						p.SetVanilla(false);
272
						p.PrepareEnableFromVanilla();
272
						p.PrepareEnableFromVanilla();
273
						p.EnablePreparedPackages(0, 0, 0);
273
						p.EnablePreparedPackages(0, 0, 0);
274
						p.CloseDir();
274
						p.CloseDir();
275
					}
275
					}
Line 295... Line 295...
295
	// opening a package from command line
295
	// opening a package from command line
296
	if ( openPackage )
296
	if ( openPackage )
297
	{
297
	{
298
		if ( gui->InstallPackage(openPackage, true, false, false) )
298
		if ( gui->InstallPackage(openPackage, true, false, false) )
299
		{
299
		{
300
			if ( !packages.GetModKey().Empty() )
300
			if ( !packages.getModKey().empty() )
301
				PluginManager::WriteRegistryValue(packages.GetModKey(), packages.selectedModName());
301
				PluginManager::WriteRegistryValue(packages.getModKey(), packages.selectedModName());
302
			packages.CloseDir(0, 0, true);
302
			packages.CloseDir(0, 0, true);
303
			return 0;
303
			return 0;
304
		}
304
		}
305
		return 1;
305
		return 1;
306
	}
306
	}
Line 309... Line 309...
309
	gui->UpdateControls();
309
	gui->UpdateControls();
310
	gui->UpdatePackages();
310
	gui->UpdatePackages();
311
	gui->StartCheckTimer();
311
	gui->StartCheckTimer();
312
	gui->FindPackages();
312
	gui->FindPackages();
313
 
313
 
314
	System::String ^mod = PluginManager::ReadRegistryValue(packages.GetModKey());
314
	System::String ^mod = PluginManager::ReadRegistryValue(packages.getModKey());
315
	packages.setMod(_S(mod));
315
	packages.setMod(_S(mod));
316
 
316
 
317
	gui->CheckProtectedDir();
317
	gui->CheckProtectedDir();
318
	Application::Run(gui);
318
	Application::Run(gui);
319
 
319
 
320
	// close directory 
320
	// close directory 
321
	if ( packages.IsLoaded() )
321
	if ( packages.IsLoaded() )
322
	{
322
	{
323
		if ( !packages.GetModKey().Empty() )
323
		if ( !packages.getModKey().empty() )
324
			PluginManager::WriteRegistryValue(packages.GetModKey(), packages.selectedModName());
324
			PluginManager::WriteRegistryValue(packages.getModKey(), packages.selectedModName());
325
		if ( packages.AnyUnusedShared() )
325
		if ( packages.AnyUnusedShared() )
326
		{
326
		{
327
			if ( MessageBox::Show("You have some unused shared files, would you like to remove these?", "Remove Shared Files", MessageBoxButtons::YesNo, MessageBoxIcon::Question) == System::Windows::Forms::DialogResult::Yes)
327
			if ( MessageBox::Show("You have some unused shared files, would you like to remove these?", "Remove Shared Files", MessageBoxButtons::YesNo, MessageBoxIcon::Question) == System::Windows::Forms::DialogResult::Yes)
328
				packages.RemoveUnusedSharedFiles();
328
				packages.RemoveUnusedSharedFiles();
329
		}
329
		}
Line 395... Line 395...
395
				{
395
				{
396
					if ( packages.GetCurrentGameFlags() & EXEFLAG_ADDON ) {
396
					if ( packages.GetCurrentGameFlags() & EXEFLAG_ADDON ) {
397
						CPackages p;
397
						CPackages p;
398
						p.startup(".", _S(tempDir), _S(mydoc), "");
398
						p.startup(".", _S(tempDir), _S(mydoc), "");
399
						Utils::String baseDir = CFileIO(_S(gui->GetRunFile())).dir();
399
						Utils::String baseDir = CFileIO(_S(gui->GetRunFile())).dir();
400
						if ( p.Read(baseDir) ) {
400
						if ( p.read(baseDir) ) {
401
							if ( !p.IsVanilla() ) {
401
							if ( !p.IsVanilla() ) {
402
								p.SetVanilla(true);
402
								p.SetVanilla(true);
403
								p.PrepareDisableForVanilla();
403
								p.PrepareDisableForVanilla();
404
								p.EnablePreparedPackages(0, 0, 0);
404
								p.EnablePreparedPackages(0, 0, 0);
405
								restoreModified.pushBack(baseDir);
405
								restoreModified.pushBack(baseDir);