forked from Phobos-developers/YRpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
DisplayClass.h
126 lines (107 loc) · 4.59 KB
/
DisplayClass.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
126
#pragma once
#include <MapClass.h>
class CCINIClass;
class ObjectTypeClass;
class NOVTABLE DisplayClass : public MapClass
{
public:
//Static
static constexpr constant_ptr<DisplayClass, 0x87F7E8u> const Instance{};
//WIP: DisplayClass::TacticalClass goes HERE
bool ProcessClickCoords(Point2D *src, CellStruct *XYdst, CoordStruct *XYZdst, ObjectClass **Target, BYTE *a5, BYTE *a6)
{ JMP_THIS(0x692300); }
// the foundation for placement with green/red
void SetActiveFoundation(CellStruct *Coords)
{ JMP_THIS(0x4A8BF0); }
//Destructor
virtual ~DisplayClass() RX;
//GScreenClass
//MapClass
//DisplayClass
virtual HRESULT Load(IStream* pStm) RX;
virtual HRESULT Save(IStream* pStm) RX;
virtual void LoadFromINI(CCINIClass* pINI) RX; //Loads the map from a map file.
virtual const wchar_t* GetToolTip(UINT nDlgID) R0;
virtual void CloseWindow() RX; //prolly wrong naming
virtual void vt_entry_8C() RX;
virtual bool MapCell(CellStruct* pMapCoord, HouseClass* pHouse) R0;
virtual bool RevealFogShroud(CellStruct* pMapCoord, HouseClass* pHouse, bool bIncreaseShroudCounter) R0;
virtual bool MapCellFoggedness(CellStruct* pMapCoord, HouseClass* pHouse) R0;
virtual bool MapCellVisibility(CellStruct* pMapCoord, HouseClass* pHouse) R0;
virtual MouseCursorType GetLastMouseCursor() = 0;
virtual bool ScrollMap(DWORD dwUnk1, DWORD dwUnk2, DWORD dwUnk3) R0;
virtual void Set_View_Dimensions(const RectangleStruct& rect) RX;
virtual void vt_entry_AC(DWORD dwUnk) RX;
virtual void vt_entry_B0(DWORD dwUnk) RX;
virtual void vt_entry_B4(Point2D* pPoint) RX;
//Decides which mouse pointer to set and then does it.
//Mouse is over cell pMapCoords which is bShrouded and holds pObject.
virtual bool ConvertAction(const CellStruct& cell, bool bShrouded, ObjectClass* pObject, Action action, bool dwUnk) RX;
virtual void LeftMouseButtonDown(const Point2D& point) RX;
virtual void LeftMouseButtonUp(const CoordStruct& coords, const CellStruct& cell, ObjectClass* pObject, Action action, DWORD dwUnk2) RX;
virtual void RightMouseButtonUp(DWORD dwUnk) RX;
//Non-virtual
Action DecideAction(const CellStruct& cell, ObjectClass* pObject, DWORD dwUnk)
{ JMP_THIS(0x692610); }
/* pass in CurrentFoundationData and receive the width/height of a bounding rectangle in cells */
CellStruct* FoundationBoundsSize(CellStruct& outBuffer, CellStruct const* const pFoundationData) const
{ JMP_THIS(0x4A94F0); }
CellStruct FoundationBoundsSize(CellStruct const* const pFoundationData) const {
CellStruct outBuffer;
FoundationBoundsSize(outBuffer, pFoundationData);
return outBuffer;
}
/* marks or unmarks the cells pointed to by CurrentFoundationData as containing a building */
void MarkFoundation(CellStruct * BaseCell, bool Mark)
{ JMP_THIS(0x4A95A0); }
// Submit object to layer.
void Submit(ObjectClass* pObject)
{ JMP_THIS(0x4A9720); }
// Remove object from layer.
void Remove(ObjectClass* pObject)
{ JMP_THIS(0x4A9770); }
protected:
//Constructor
DisplayClass() {} //don't need this
//===========================================================================
//===== Properties ==========================================================
//===========================================================================
public:
CellStruct CurrentFoundation_CenterCell; //Currently placing the building here
CellStruct CurrentFoundation_TopLeftOffset; // offset from center cell of the current foundation (under the mouse) to the top left cell
CellStruct* CurrentFoundation_Data; //Foundation data of the building we're currently placing (note: limited to 120 cells)
bool unknown_1180;
bool unknown_1181;
CellStruct CurrentFoundationCopy_CenterCell; // this is a copy of the CurrentFoundation data above..
CellStruct CurrentFoundationCopy_TopLeftOffset;
CellStruct * CurrentFoundationCopy_Data; // (note: limited to 50 [!] cells)
DWORD unknown_1190;
DWORD unknown_1194;
DWORD unknown_1198;
bool FollowObject;
ObjectClass* ObjectToFollow;
ObjectClass* CurrentBuilding; //Building we're currently placing
ObjectTypeClass* CurrentBuildingType; //Type of that building
DWORD unknown_11AC;
bool RepairMode;
bool SellMode;
bool PowerToggleMode;
bool PlanningMode;
bool PlaceBeaconMode;
int CurrentSWTypeIndex; //Index of the SuperWeaponType we have currently selected
DWORD unknown_11BC;
DWORD unknown_11C0;
DWORD unknown_11C4;
DWORD unknown_11C8;
bool unknown_bool_11CC;
bool unknown_bool_11CD;
bool unknown_bool_11CE;
bool DraggingRectangle;
bool unknown_bool_11D0;
bool unknown_bool_11D1;
DWORD unknown_11D4;
DWORD unknown_11D8;
DWORD unknown_11DC;
DWORD unknown_11E0;
PROTECTED_PROPERTY(DWORD, padding_11E4);
};