Subversion Repositories spk

Rev

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

Rev 123 Rev 197
Line 4... Line 4...
4
#include "spkdefines.h"
4
#include "spkdefines.h"
5
#include "Utils/StringList.h"
5
#include "Utils/WStringList.h"
6
 
6
 
7
class CPackages;
7
class CPackages;
8
class CGameExe;
8
class CGameExe;
9
 
9
 
10
namespace SPK {
10
namespace SPK {
11
 
11
 
12
	class CVirtualFileSystem;
12
	class CVirtualFileSystem;
13
 
13
 
14
	typedef struct SGameDir {
14
	typedef struct SGameDir {
15
		bool			bLoad;
15
		bool			bLoad;
16
		Utils::String	dir;
16
		Utils::WString	dir;
17
		Utils::String	name;
17
		Utils::WString	name;
18
		int				iGame;
18
		int				iGame;
19
		CVirtualFileSystem *pVfs;
19
		CVirtualFileSystem *pVfs;
20
//		SGameExe		*pExe;
20
//		SGameExe		*pExe;
21
	} SGameDir;
21
	} SGameDir;
22
 
22
 
23
	tclass CGameDirectories
23
	tclass CGameDirectories
24
	{
24
	{
25
	private:
25
	private:
26
		std::vector<SGameDir *> *_pDirs;
26
		std::vector<SGameDir *> *_pDirs;
27
		Utils::CStringList	_lControlledDirs;
27
		Utils::WStringList	_lControlledDirs;
28
		SGameDir	*_pCurrentItr;
28
		SGameDir	*_pCurrentItr;
29
		SGameDir	*_pSelected;
29
		SGameDir	*_pSelected;
30
		SGameDir	*_pTemporary;
30
		SGameDir	*_pTemporary;
31
		int			 _iLanguage;
31
		int			 _iLanguage;
32
 
32
 
33
	public:
33
	public:
34
		CGameDirectories(const Utils::String &mydoc);
34
		CGameDirectories(const Utils::WString &mydoc);
35
		~CGameDirectories(void);
35
		~CGameDirectories(void);
36
 
36
 
37
		bool add(const Utils::String &dir, const Utils::String &name, int iGame, const Utils::String &addon, bool bLoad);
37
		bool add(const Utils::WString &dir, const Utils::WString &name, int iGame, const Utils::WString &addon, bool bLoad);
38
		bool remove(const Utils::String &dir);
38
		bool remove(const Utils::WString &dir);
39
 
39
 
40
		bool parse(const Utils::String &data, CPackages *pPackages);
40
		bool parse(const Utils::WString &data, CPackages *pPackages);
41
		bool findDir(const Utils::String &dir);
41
		bool findDir(const Utils::WString &dir);
42
		bool writeData(Utils::CStringList *lines);
42
		bool writeData(Utils::WStringList *lines);
43
		void updateCurrentVFS(bool bReload);
43
		void updateCurrentVFS(bool bReload);
44
 
44
 
45
		void clear();
45
		void clear();
46
 
46
 
47
		bool setSelectedGameDirectory(int iGame, bool temp = false);
47
		bool setSelectedGameDirectory(int iGame, bool temp = false);
48
		bool setSelectedDirectory(const Utils::String &dir, bool temp = false);
48
		bool setSelectedDirectory(const Utils::WString &dir, bool temp = false);
49
		void reselectTemporaryDirectory();
49
		void reselectTemporaryDirectory();
50
		void setLanguage(int iLang);
50
		void setLanguage(int iLang);
51
 
51
 
52
		void setLoad(bool bLoad);
52
		void setLoad(bool bLoad);
53
 
53
 
54
		bool isAllTextLoaded() const;
54
		bool isAllTextLoaded() const;
55
		bool isDir(const Utils::String &dir) const;
55
		bool isDir(const Utils::WString &dir) const;
56
		bool hasSelected() const;
56
		bool hasSelected() const;
57
		bool isEmpty() const;
57
		bool isEmpty() const;
58
		int highestGame() const;
58
		int highestGame() const;
59
 
59
 
60
		Utils::String currentName() const;
60
		Utils::WString currentName() const;
61
		int currentGame() const;
61
		int currentGame() const;
62
		bool currentLoad() const;
62
		bool currentLoad() const;
63
		CVirtualFileSystem *selectedVFS() const;
63
		CVirtualFileSystem *selectedVFS() const;
64
 
64
 
65
		void syncWithControlled(CGameExe *exe);
65
		void syncWithControlled(CGameExe *exe);
66
 
66
 
67
		Utils::String findText(int iGame, int iLanguage, int iPage, int iID);
67
		Utils::WString findText(int iGame, int iLanguage, int iPage, int iID);
68
		Utils::String findText(int iLanguage, int iPage, int iID, Utils::String missing = Utils::String::Null());
68
		Utils::WString findText(int iLanguage, int iPage, int iID, Utils::WString missing = Utils::WString::Null());
69
 
69
 
70
		Utils::String first(int iGame = -1);
70
		Utils::WString first(int iGame = -1);
71
		Utils::String next(int iGame = -1);
71
		Utils::WString next(int iGame = -1);
72
 
72
 
73
		Utils::String firstShield();
73
		Utils::WString firstShield();
74
		Utils::String nextShield();
74
		Utils::WString nextShield();
75
		Utils::String firstComponentSection();
75
		Utils::WString firstComponentSection();
76
		Utils::String nextComponentSection();
76
		Utils::WString nextComponentSection();
77
		Utils::String firstDummySection();
77
		Utils::WString firstDummySection();
78
		Utils::String nextDummySection();
78
		Utils::WString nextDummySection();
79
		Utils::String firstBodiesSection();
79
		Utils::WString firstBodiesSection();
80
		Utils::String nextBodiesSection();
80
		Utils::WString nextBodiesSection();
81
		Utils::String firstCockpit();
81
		Utils::WString firstCockpit();
82
		Utils::String nextCockpit();
82
		Utils::WString nextCockpit();
83
		std::pair<Utils::String, Utils::String> firstLaser();
83
		std::pair<Utils::WString, Utils::WString> firstLaser() const;
84
		std::pair<Utils::String, Utils::String> nextLaser();
84
		std::pair<Utils::WString, Utils::WString> nextLaser() const;
85
		std::pair<Utils::String, Utils::String> firstMissile();
85
		std::pair<Utils::WString, Utils::WString> firstMissile() const;
86
		std::pair<Utils::String, Utils::String> nextMissile();
86
		std::pair<Utils::WString, Utils::WString> nextMissile() const;
87
 
87
 
88
	private:
88
	private:
89
		SGameDir *_findGameDir(int iGame) const;	
89
		SGameDir *_findGameDir(int iGame) const;	
90
		SGameDir *_findGameDir(const Utils::String &dir) const;	
90
		SGameDir *_findGameDir(const Utils::WString &dir) const;	
91
		void _add(const Utils::String &dir, const Utils::String &name, int iGame, const Utils::String &addon, bool bLoad);
91
		void _add(const Utils::WString &dir, const Utils::WString &name, int iGame, const Utils::WString &addon, bool bLoad);
92
 
92
 
93
		void _updateControlledDirs(const Utils::String &mydoc);
93
		void _updateControlledDirs(const Utils::WString &mydoc);
94
	};
94
	};
95
 
95
 
96
}
96
}