Subversion Repositories spk

Rev

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

Rev 95 Rev 101
Line 75... Line 75...
75
		}
75
		}
76
 
76
 
77
		return writeAny;
77
		return writeAny;
78
	}
78
	}
79
 
79
 
80
	void CGameDirectories::updateCurrentVFS()
80
	void CGameDirectories::updateCurrentVFS(bool bReload)
81
	{
81
	{
82
		if ( !_pCurrentItr ) return;
82
		if ( !_pCurrentItr ) return;
83
 
83
 
-
 
84
		// dont load text if its already been loaded, unless we need to reload them
-
 
85
		if ( !bReload && _pCurrentItr->pVfs->isTextUpdated() ) return;
-
 
86
 
-
 
87
		// update the texts for all pages
84
		_pCurrentItr->pVfs->updateTexts(0);
88
		_pCurrentItr->pVfs->updateTexts(0);
85
	}
89
	}
86
 
90
 
87
	void CGameDirectories::clear()
91
	void CGameDirectories::clear()
88
	{
92
	{
89
		for ( std::vector<SGameDir *>::iterator itr = _pDirs->begin(); itr != _pDirs->end(); itr++ ) {
93
		for ( std::vector<SGameDir *>::iterator itr = _pDirs->begin(); itr != _pDirs->end(); itr++ ) {
90
			delete *itr;
94
			delete *itr;
91
		}
95
		}
92
		_pDirs->clear();
96
		_pDirs->clear();
93
	}
97
	}
94
 
98
 
95
	bool CGameDirectories::setSelectedGameDirectory(int iGame, bool temp)
99
	bool CGameDirectories::setSelectedGameDirectory(int iGame, bool temp)
96
	{
100
	{
97
		_pTemporary = NULL;
101
		_pTemporary = NULL;
98
		if ( temp ) _pTemporary = _pSelected;
102
		if ( temp ) _pTemporary = _pSelected;
99
		_pSelected = _findGameDir(iGame);
103
		_pSelected = _findGameDir(iGame);
100
		return hasSelected();
104
		return hasSelected();
101
	}
105
	}
102
 
106
 
103
	bool CGameDirectories::setSelectedDirectory(const Utils::String &dir, bool temp)
107
	bool CGameDirectories::setSelectedDirectory(const Utils::String &dir, bool temp)
104
	{
108
	{
105
		_pTemporary = NULL;
109
		_pTemporary = NULL;
106
		if ( temp ) _pTemporary = _pSelected;
110
		if ( temp ) _pTemporary = _pSelected;
107
		_pSelected = _findGameDir(dir);
111
		_pSelected = _findGameDir(dir);
108
		return hasSelected();
112
		return hasSelected();
109
	}
113
	}
110
 
114
 
111
	void CGameDirectories::reselectTemporaryDirectory()
115
	void CGameDirectories::reselectTemporaryDirectory()
112
	{
116
	{
113
		if ( _pTemporary ) _pSelected = _pTemporary;
117
		if ( _pTemporary ) _pSelected = _pTemporary;
114
		_pTemporary = NULL;
118
		_pTemporary = NULL;
Line 120... Line 124...
120
	}
124
	}
121
 
125
 
122
	void CGameDirectories::setLoad(bool bLoad)
126
	void CGameDirectories::setLoad(bool bLoad)
123
	{
127
	{
124
		if ( _pCurrentItr ) _pCurrentItr->bLoad = bLoad;
128
		if ( _pCurrentItr ) _pCurrentItr->bLoad = bLoad;
-
 
129
	}
-
 
130
 
-
 
131
	bool CGameDirectories::isAllTextLoaded() const
-
 
132
	{
-
 
133
		for ( std::vector<SGameDir *>::iterator itr = _pDirs->begin(); itr != _pDirs->end(); itr++ ) {
-
 
134
			if ( !(*itr)->pVfs->isTextUpdated() ) return false;
-
 
135
		}
-
 
136
 
-
 
137
		return true;
125
	}
138
	}
126
 
139
 
127
	bool CGameDirectories::isDir(const Utils::String &dir) const
140
	bool CGameDirectories::isDir(const Utils::String &dir) const
128
	{
141
	{
129
		for ( std::vector<SGameDir *>::iterator itr = _pDirs->begin(); itr != _pDirs->end(); itr++ ) {
142
		for ( std::vector<SGameDir *>::iterator itr = _pDirs->begin(); itr != _pDirs->end(); itr++ ) {
Line 368... Line 381...
368
 
381
 
369
		gd->bLoad = bLoad;
382
		gd->bLoad = bLoad;
370
		gd->pVfs = new CVirtualFileSystem();
383
		gd->pVfs = new CVirtualFileSystem();
371
		gd->pVfs->setLanguage(44);
384
		gd->pVfs->setLanguage(44);
372
		gd->pVfs->LoadFilesystem(gd->dir);
385
		gd->pVfs->LoadFilesystem(gd->dir);
373
		gd->pVfs->SetAddon(addon);
386
		gd->pVfs->setAddon(addon);
374
 
387
 
375
		_pDirs->push_back(gd);
388
		_pDirs->push_back(gd);
376
	}
389
	}
377
 
390
 
378
	void CGameDirectories::_updateControlledDirs(const Utils::String &mydoc)
391
	void CGameDirectories::_updateControlledDirs(const Utils::String &mydoc)