Subversion Repositories spk

Rev

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

Rev 95 Rev 101
Line 116... Line 116...
116
		CGameDirectories *gameDirectories()
116
		CGameDirectories *gameDirectories()
117
		{
117
		{
118
			return _pGameDir;
118
			return _pGameDir;
119
		}
119
		}
120
 
120
 
121
		void LoadText()
121
		void LoadText(CVirtualFileSystem *vfs)
122
		{
122
		{
123
			this->LoadText(false, false);
123
			this->LoadText(false, false, vfs);
124
		}
124
		}
125
 
125
 
126
		String ^FindText(int game, int page, int id)
126
		String ^FindText(int game, int page, int id)
127
		{
127
		{
128
			this->LoadText(false, false);
128
			this->LoadText(false, false, NULL);
129
 
129
 
130
			Utils::String text = _pGameDir->findText(game, 44, page, id);
130
			Utils::String text = _pGameDir->findText(game, 44, page, id);
131
			if ( !text.empty() ) {
131
			if ( !text.empty() ) {
132
				return ParseText(game, _US(text));
132
				return ParseText(game, _US(text));
133
			}
133
			}
Line 226... Line 226...
226
		CyStringList	*m_pLoadedList;
226
		CyStringList	*m_pLoadedList;
227
		CPackages *m_pPackages;
227
		CPackages *m_pPackages;
228
		SPK::CGameDirectories	*_pGameDir;
228
		SPK::CGameDirectories	*_pGameDir;
229
 
229
 
230
		SSettings		*m_settings;
230
		SSettings		*m_settings;
231
		bool			 m_bTextLoaded;
-
 
232
		String			^m_sConvertFile;
231
		String			^m_sConvertFile;
233
		Waiting			^m_pWait;
232
		Waiting			^m_pWait;
234
		CBaseFile		*m_pConverted;
233
		CBaseFile		*m_pConverted;
235
 
234
 
236
		//System::Collections::Hashtable ^textList;
235
		//System::Collections::Hashtable ^textList;
Line 367... Line 366...
367
			 {
366
			 {
368
				 m_settings->bGenerateUpdate = opt->GetGenerateUpdate();
367
				 m_settings->bGenerateUpdate = opt->GetGenerateUpdate();
369
			 }
368
			 }
370
 
369
 
371
			 if ( opt->LoadText() )
370
			 if ( opt->LoadText() )
372
				 this->LoadText(false, true);
371
				 this->LoadText(false, true, NULL);
373
		}
372
		}
374
 
373
 
375
		void OpenFiles(ArrayList ^list, bool checkExtension, bool display)
374
		void OpenFiles(ArrayList ^list, bool checkExtension, bool display)
376
		{
375
		{
377
			if ( !list )
376
			if ( !list )
Line 1193... Line 1192...
1193
 
1192
 
1194
					delete lines;
1193
					delete lines;
1195
				}
1194
				}
1196
			}
1195
			}
1197
		}
1196
		}
1198
 
-
 
1199
 
1197
		
1200
		void LoadText(bool center, bool reload)
1198
		void LoadText(bool center, bool reload, CVirtualFileSystem *vfs)
1201
		{
1199
		{
1202
			if ( m_bTextLoaded && !reload )
1200
			if ( !reload ) {
-
 
1201
				// check if the text has been updated
-
 
1202
				if ( vfs && vfs->isTextUpdated() ) return;
1203
				return;
1203
				
1204
			m_bTextLoaded = true;
1204
				// check if all text as been updated
-
 
1205
				if ( !vfs && _pGameDir->isAllTextLoaded() ) return;
-
 
1206
			}
1205
 
1207
 
1206
			if ( _pGameDir->isEmpty() ) return;
1208
			if ( _pGameDir->isEmpty() ) return;
1207
 
1209
 
-
 
1210
			Creator::LoadText ^load = nullptr;
-
 
1211
			if ( vfs ) 
-
 
1212
				load = gcnew Creator::LoadText(vfs);
-
 
1213
			else 
1208
			Creator::LoadText ^load = gcnew Creator::LoadText(_pGameDir, m_pPackages);
1214
				load = gcnew Creator::LoadText(_pGameDir, reload);
-
 
1215
 
1209
			if ( center )
1216
			if ( center )
1210
				load->StartPosition = Windows::Forms::FormStartPosition::CenterScreen;
1217
				load->StartPosition = Windows::Forms::FormStartPosition::CenterScreen;
1211
			
1218
			
1212
			load->ShowDialog(this);
1219
			load->ShowDialog(this);
1213
		}
1220
		}