Subversion Repositories spk

Rev

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

Rev 197 Rev 223
Line 197... Line 197...
197
 
197
 
198
		void LoadData()
198
		void LoadData()
199
		{
199
		{
200
			System::String ^mydoc = Environment::GetFolderPath(Environment::SpecialFolder::Personal );
200
			System::String ^mydoc = Environment::GetFolderPath(Environment::SpecialFolder::Personal );
201
			CFileIO Config;
201
			CFileIO Config;
202
			if ( Config.open(_S(mydoc) + "/Egosoft/modmerge.dat") )
202
			if ( Config.open(_WS(mydoc) + L"/Egosoft/modmerge.dat") )
203
			{
203
			{
204
				std::vector<Utils::String> *lines = Config.readLines();
204
				std::vector<Utils::WString> lines;
205
				if ( lines )
205
				if(Config.readLines(lines))
206
				{
206
				{
207
					for ( int i = 0; i < (int)lines->size(); i++ )
207
					for (size_t i = 0; i < (int)lines.size(); i++ )
208
					{
208
					{
209
						Utils::String line(lines->at(i));
209
						Utils::WString line(lines.at(i));
210
						Utils::String start = line.token(":", 1).lower();
210
						Utils::WString start = line.token(L":", 1).lower();
211
						Utils::String rest = line.tokens(":", 2).removeFirstSpace();
211
						Utils::WString rest = line.tokens(L":", 2).removeFirstSpace();
212
						if ( start.Compare("ModMergeSize") )
212
						if ( start.Compare(L"ModMergeSize") )
213
							this->Size = System::Drawing::Size(rest.token(" ", 1).toInt(), rest.token(" ", 2).toInt());
213
							this->Size = System::Drawing::Size(rest.token(L" ", 1).toInt(), rest.token(L" ", 2).toInt());
214
						else if ( start.Compare("ModMergePos") )
214
						else if ( start.Compare(L"ModMergePos") )
215
						{
215
						{
216
							m_iLocX = rest.token(" ", 1).toInt();
216
							m_iLocX = rest.token(L" ", 1).toInt();
217
							m_iLocY = rest.token(" ", 2).toInt();
217
							m_iLocY = rest.token(L" ", 2).toInt();
218
							if ( !this->TopMost )
218
							if ( !this->TopMost )
219
								this->Location = System::Drawing::Point(m_iLocX, m_iLocY);
219
								this->Location = System::Drawing::Point(m_iLocX, m_iLocY);
220
						}
220
						}
221
						else if ( start.Compare("ModMergeMax") )
221
						else if ( start.Compare(L"ModMergeMax") )
222
						{
222
						{
223
							if ( !this->TopMost )
223
							if ( !this->TopMost )
224
								this->WindowState = FormWindowState::Maximized;
224
								this->WindowState = FormWindowState::Maximized;
225
						}
225
						}
226
						else if ( start.Compare("GameDir") )
226
						else if ( start.Compare(L"GameDir") )
227
							SetGameDir(rest.token(";", 1).toInt(), _US(rest.tokens(";", 2)));
227
							SetGameDir(rest.token(L";", 1).toInt(), _US(rest.tokens(L";", 2)));
228
					}
228
					}
229
 
-
 
230
					delete lines;
-
 
231
				}
229
				}
232
			}
230
			}
233
 
231
 
234
			if ( m_pPackages->getCurrentDirectory().empty() )
232
			if ( m_pPackages->getCurrentDirectory().empty() )
235
				DoGameDirectory();
233
				DoGameDirectory();