Subversion Repositories spk

Rev

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

Rev 220 Rev 223
Line 203... Line 203...
203
	// load in the config file
203
	// load in the config file
204
	CFileIO configFile(_WS(mydoc) + L"/Egosoft/pluginmanager.dat");
204
	CFileIO configFile(_WS(mydoc) + L"/Egosoft/pluginmanager.dat");
205
	bool anyDirs = false;
205
	bool anyDirs = false;
206
	if ( configFile.exists() )
206
	if ( configFile.exists() )
207
	{
207
	{
208
		std::vector<Utils::String> *readFile = configFile.readLines();
208
		std::vector<Utils::WString> readFile;
209
		if ( readFile )
209
		if(configFile.readLines(readFile))
210
		{
210
		{
211
			for ( int i = 0; i < (int)readFile->size(); i++ )
211
			for (size_t i = 0; i < readFile.size(); i++ )
212
			{
212
			{
213
				Utils::String line(readFile->at(i));
213
				Utils::WString line(readFile.at(i));
214
				Utils::String cmd = line.token(":", 1).lower();
214
				Utils::WString cmd = line.token(L":", 1).lower();
215
				Utils::String rest = line.tokens(":", 2).removeFirstSpace();
215
				Utils::WString rest = line.tokens(L":", 2).removeFirstSpace();
216
 
216
 
217
				if ( cmd == "dir" )
217
				if ( cmd == L"dir" )
218
				{
218
				{
219
					// first check its on the list
219
					// first check its on the list
220
					if ( !dirList.findString(rest) )
220
					if ( !dirList.contains(rest) )
221
					{
221
					{
222
						Utils::WString gameName = packages.getGameName(rest);
222
						Utils::WString gameName = packages.getGameName(rest);
223
						if ( !gameName.empty() )
223
						if ( !gameName.empty() )
224
						{
224
						{
225
							int lang = packages.getGameLanguage(rest);
225
							int lang = packages.getGameLanguage(rest);
Line 229... Line 229...
229
								dirList.pushBack(rest, gameName);
229
								dirList.pushBack(rest, gameName);
230
							anyDirs = true;
230
							anyDirs = true;
231
						}
231
						}
232
					}
232
					}
233
				}
233
				}
234
				else if ( cmd == "remdir" )
234
				else if ( cmd == L"remdir" )
235
				{
235
				{
236
					// first check its on the list
236
					// first check its on the list
237
					if ( !remDirList.findString(rest) )
237
					if ( !remDirList.contains(rest) )
238
					{
238
					{
239
						remDirList.pushBack(rest);
239
						remDirList.pushBack(rest);
240
						anyDirs = true;
240
						anyDirs = true;
241
					}
241
					}
242
				}
242
				}
243
				else if ( cmd == "experimental" )
243
				else if ( cmd == L"experimental" )
244
					gui->SetExperimental(true);
244
					gui->SetExperimental(true);
245
				else if ( cmd == "filterships" )
245
				else if ( cmd == L"filterships" )
246
					gui->SetShips(true);
246
					gui->SetShips(true);
247
				else if ( cmd == "filtersigned" )
247
				else if ( cmd == L"filtersigned" )
248
					gui->SetOnlySigned(true);
248
					gui->SetOnlySigned(true);
249
				else if ( cmd == "modselectordetails" )
249
				else if ( cmd == L"modselectordetails" )
250
					gui->SetModSelectorDetails(true);
250
					gui->SetModSelectorDetails(true);
251
				else if ( cmd == "cheat" )
251
				else if ( cmd == L"cheat" )
252
					gui->SetCheat(true);
252
					gui->SetCheat(true);
253
				else if ( cmd == "downloadable" )
253
				else if ( cmd == L"downloadable" )
254
					gui->SetDownloadable(true);
254
					gui->SetDownloadable(true);
255
				else if ( cmd == "noautoupdate" )
255
				else if ( cmd == L"noautoupdate" )
256
					gui->SetAutoUpdate(false);
256
					gui->SetAutoUpdate(false);
257
				else if ( cmd == "managersize" )
257
				else if ( cmd == L"managersize" )
258
					gui->SetSize(rest.token(" ", 2).toLong(), rest.token(" ", 1).toLong());
258
					gui->SetSize(rest.token(L" ", 2).toLong(), rest.token(L" ", 1).toLong());
259
				else if ( cmd == "managerpos" )
259
				else if ( cmd == L"managerpos" )
260
					gui->Location = System::Drawing::Point(rest.token(" ", 1).toLong(), rest.token(" ", 2).toLong());
260
					gui->Location = System::Drawing::Point(rest.token(L" ", 1).toLong(), rest.token(L" ", 2).toLong());
261
				else if ( cmd == "managermax" )
261
				else if ( cmd == L"managermax" )
262
					gui->WindowState = FormWindowState::Maximized;
262
					gui->WindowState = FormWindowState::Maximized;
263
				else if ( cmd == "tips" )
263
				else if ( cmd == L"tips" )
264
					gui->SetTips(rest.token(" ", 1).toInt(), rest.token(" ", 2).toInt());
264
					gui->SetTips(rest.token(L" ", 1).toInt(), rest.token(L" ", 2).toInt());
265
				else if ( cmd == "ignorejoy" )
265
				else if ( cmd == L"ignorejoy" )
266
					gui->SetIgnoreJoy(rest.toInt());
266
					gui->SetIgnoreJoy(rest.toInt());
267
				else if ( cmd == "savegamemanager" )
267
				else if ( cmd == L"savegamemanager" )
268
					gui->SetSaveGameManager(rest.toInt());
268
					gui->SetSaveGameManager(rest.toInt());
269
				else if ( cmd == "restoremodified" ) {
269
				else if ( cmd == L"restoremodified" ) {
270
					CPackages p;
270
					CPackages p;
271
					p.startup(".", _S(tempDir), _S(mydoc), "");
271
					p.startup(L".", _WS(tempDir), _WS(mydoc), L"");
272
					if ( p.read(rest) ) {
272
					if ( p.read(rest) ) {
273
						p.SetVanilla(false);
273
						p.SetVanilla(false);
274
						p.PrepareEnableFromVanilla();
274
						p.PrepareEnableFromVanilla();
275
						p.enablePreparedPackages(0, 0, 0);
275
						p.enablePreparedPackages(0, 0, 0);
276
						p.closeDir();
276
						p.closeDir();
277
					}
277
					}
278
				}
278
				}
279
			}
279
			}
280
 
-
 
281
			delete readFile;
-
 
282
		}
280
		}
283
	}
281
	}
284
 
282
 
285
	// still no directories, quit
283
	// still no directories, quit
286
	if (dirList.empty() && openPackage)
284
	if (dirList.empty() && openPackage)