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