forked from Phobos-developers/YRpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
LoadOptionsClass.h
125 lines (101 loc) · 3.05 KB
/
LoadOptionsClass.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
#pragma once
#include <GeneralDefinitions.h>
#include <ArrayClasses.h>
#include <Helpers/String.h>
class FileEntryClass {
public:
// constructor / destructors
FileEntryClass() :
TechLevel(0),
HouseIndex(-1),
CampaignIndex(-1),
IsValid(true),
IsWrongVersion(false),
GameMode(GameMode::Campaign),
LastWriteTime({0, 0})
{ }
static int Compare(const FileEntryClass& lhs, const FileEntryClass& rhs) {
return -CompareFileTime(&lhs.LastWriteTime, &rhs.LastWriteTime);
}
bool operator < (const FileEntryClass& rhs) const {
return Compare(*this, rhs) < 0;
}
FixedWString<0x80> Name;
FixedString<0x20> Filename;
int TechLevel;
int HouseIndex;
FixedWString<0x40> HouseName;
int CampaignIndex;
FILETIME LastWriteTime;
bool IsValid;
bool IsWrongVersion;
PROTECTED_PROPERTY(BYTE, align_1B6[2]);
GameMode GameMode;
};
enum class LoadOptionsMode : unsigned int {
None = 0,
Load = 1,
Save = 2,
Delete = 3
};
class NOVTABLE LoadOptionsClass
{
public:
// constructor
LoadOptionsClass()
{ JMP_THIS(0x558740); }
// virtuals
virtual ~LoadOptionsClass()
{ JMP_THIS(0x55A0D0); }
virtual bool LoadMission(const char* pFilename) const
{ JMP_THIS(0x559D60); }
virtual bool SaveMission(const char* pFilename, const wchar_t* pDescription) const
{ JMP_THIS(0x559E7B); }
virtual bool DeleteMission(const char* pFilename) const
{ JMP_THIS(0x559EB0); }
virtual bool GetFileEntry(FileEntryClass& FileEntry, const WIN32_FIND_DATAA& pFindData) const
{ JMP_THIS(0x559ED0); }
virtual const wchar_t* GetUIString_Load() const
{ JMP_THIS(0x55A050); }
virtual const wchar_t* GetUIString_Save() const
{ JMP_THIS(0x55A070); }
virtual const wchar_t* GetUIString_Delete() const
{ JMP_THIS(0x55A090); }
virtual const wchar_t* GetUIString_GameSaved() const
{ JMP_THIS(0x55A0B0); }
//Non virtuals
bool LoadDialog()
{ JMP_THIS(0x5587F0); }
//Properties
LoadOptionsMode Mode;
const char* Extension; //"SAV", "SED" for MapSeedClass
const wchar_t* Description;
unsigned int SpaceRequirement; //default is 0x800 = 2048
DWORD unknown_14;
DWORD unknown_18;
DWORD unknown_1C;
DECLARE_PROPERTY(DynamicVectorClass<FileEntryClass*>, FileEntries);
};
class SavegameInformation
{
public:
SavegameInformation()
{ JMP_THIS(0x680FF0); }
bool Write(IStorage* pStorage) const
{ JMP_THIS(0x6812E0); }
bool Read(IStorage* pStorage)
{ JMP_THIS(0x681840); }
int InternalVersion; // PIDSI_CHARCOUNT (16)
int Version; // PIDSI_REVNUMBER (9)
FixedWString<0x80> ScenarioDescription; // PIDSI_TITLE (2)
FixedWString<0x40> PlayerHouse; // PIDSI_SUBJECT (3)
int Campaign; // 101
int ScenarioNumber; // 100
FixedString<MAX_PATH> unknown_190;
FixedString<0x40> PlayerName; // PIDSI_AUTHOR (4) and PIDSI_LASTAUTHOR (8)
FixedString<MAX_PATH> ExecutableName; // PIDSI_APPNAME (18)
FILETIME StartTime; // PIDSI_CREATE_DTM (12)
FILETIME PlayTime; // PIDSI_EDITTIME (10)
FILETIME LastSaveTime; // PIDSI_LASTSAVE_DTM (13)
GameMode GameType; // 102
};