2497
|
1 #pragma once
|
|
2
|
|
3
|
|
4
|
|
5
|
|
6 /* 348 */
|
|
7 enum CHEST_FLAGS
|
|
8 {
|
|
9 CHEST_TRAPPED = 0x1,
|
|
10 CHEST_ITEMS_PLACED = 0x2,
|
|
11 CHEST_OPENED = 0x4,
|
|
12 };
|
|
13
|
|
14
|
|
15
|
|
16 #pragma pack(push, 1)
|
|
17 struct ChestDesc
|
|
18 {
|
|
19 char pName[32];
|
|
20 char uWidth;
|
|
21 char uHeight;
|
|
22 __int16 uTextureID;
|
|
23 };
|
|
24 #pragma pack(pop)
|
|
25
|
|
26
|
|
27
|
|
28 #pragma pack(push, 1)
|
|
29 struct ChestList
|
|
30 {
|
|
31 inline ChestList(): //----- (00458438)
|
|
32 uNumChests(0), pChests(nullptr)
|
|
33 {}
|
|
34
|
|
35 void ToFile();
|
|
36 void FromFile(void *data_mm6, void *data_mm7, void *data_mm8);
|
|
37 int FromFileTxt(const char *Args);
|
|
38
|
|
39
|
|
40 unsigned int uNumChests;
|
|
41 struct ChestDesc *pChests;
|
|
42 };
|
|
43 #pragma pack(pop)
|
|
44
|
|
45
|
|
46
|
|
47 /* 65 */
|
|
48 #pragma pack(push, 1)
|
|
49 struct Chest //0x14cc
|
|
50 {
|
|
51 inline bool Initialized() const {return (uFlags & CHEST_ITEMS_PLACED) != 0;}
|
|
52 inline void SetInitialized(bool b) {if (b) uFlags |= CHEST_ITEMS_PLACED; else uFlags &= ~CHEST_ITEMS_PLACED;}
|
|
53 inline bool Trapped() const {return (uFlags & CHEST_TRAPPED) != 0;}
|
|
54
|
|
55 static bool CanPlaceItemAt(signed int a1, int a2, signed int uChestID);
|
|
56 static int CountChestItems(signed int uChestID);
|
|
57 static int PutItemInChest(int a1, ItemGen *a2, signed int uChestID);
|
|
58 static void PlaceItemAt(unsigned int put_cell_pos, unsigned int uItemIdx, signed int uChestID);
|
|
59 static void PlaceItems(signed int uChestID);
|
|
60 static bool Open(signed int uChestID);
|
|
61 static void DrawChestUI(signed int uChestID);
|
|
62 static void ToggleFlag(signed int uChestID, unsigned __int16 uFlag, unsigned int bToggle);
|
|
63 static void ChestUI_WritePointedObjectStatusString();
|
|
64 static void OnChestLeftClick();
|
|
65
|
|
66 unsigned __int16 uChestBitmapID; //0
|
|
67 unsigned __int16 uFlags; //2
|
|
68 struct ItemGen igChestItems[140]; //4
|
|
69 signed __int16 pInventoryIndices[140]; //0x13b4
|
|
70 };
|
|
71 #pragma pack(pop)
|
|
72
|
|
73 void __fastcall sub_420B13(int a1, int a2);
|
|
74
|
|
75
|
|
76 extern size_t uNumChests; // idb
|
|
77 extern struct ChestList *pChestList;
|
|
78 extern std::array<Chest, 20> pChests; |