0
|
1 #include "GUIButton.h"
|
|
2 #include "GUIWindow.h"
|
|
3 #include "GUIFont.h"
|
|
4 #include "Allocator.h"
|
|
5
|
|
6 #include "mm7_data.h"
|
|
7
|
|
8
|
|
9
|
|
10
|
|
11
|
|
12
|
167
|
13 struct GUIButton *pBtn_CloseBook;
|
|
14 struct GUIButton *pBtn_InstallRemoveSpell;
|
0
|
15 struct GUIButton *pBtn_Autonotes_Instructors;
|
|
16 struct GUIButton *pBtn_Autonotes_Misc;
|
|
17 struct GUIButton *pBtn_Book_6;
|
|
18 struct GUIButton *pBtn_Book_5;
|
|
19 struct GUIButton *pBtn_Book_4;
|
|
20 struct GUIButton *pBtn_Book_3;
|
|
21 struct GUIButton *pBtn_Book_2;
|
|
22 struct GUIButton *pBtn_Book_1;
|
|
23
|
|
24
|
|
25 struct GUIButton *pPlayerCreationUI_BtnReset;
|
|
26 struct GUIButton *pPlayerCreationUI_BtnOK;
|
167
|
27 struct GUIButton *pBtn_ExitCancel;
|
|
28 struct GUIButton *pBtn_YES;
|
0
|
29 struct GUIButton *pPlayerCreationUI_BtnPlus;
|
|
30 struct GUIButton *pPlayerCreationUI_BtnMinus;
|
|
31
|
|
32
|
167
|
33 struct GUIButton *pButton_RestUI_Main;
|
0
|
34 struct GUIButton *pButton_RestUI_Exit;
|
|
35 struct GUIButton *pButton_RestUI_Wait5Minutes;
|
|
36 struct GUIButton *pButton_RestUI_WaitUntilDawn;
|
|
37 struct GUIButton *pButton_RestUI_Wait1Hour;
|
|
38
|
|
39
|
167
|
40 struct GUIButton *pCharacterScreen_ExitBtn;
|
0
|
41 struct GUIButton *pCharacterScreen_AwardsBtn;
|
|
42 struct GUIButton *pCharacterScreen_InventoryBtn;
|
|
43 struct GUIButton *pCharacterScreen_SkillsBtn;
|
|
44 struct GUIButton *pCharacterScreen_StatsBtn;
|
167
|
45 struct GUIButton *pCharacterScreen_DollBtn;
|
|
46 struct GUIButton *pCharacterScreen_DetalizBtn;
|
0
|
47
|
|
48
|
167
|
49 struct GUIButton *pBtn_NPCRight;
|
|
50 struct GUIButton *pBtn_NPCLeft;
|
|
51 struct GUIButton *pBtn_GameSettings;
|
|
52 struct GUIButton *pBtn_QuickReference;
|
|
53 struct GUIButton *pBtn_CastSpell;
|
|
54 struct GUIButton *pBtn_Rest;
|
|
55 struct GUIButton *pBtn_History;
|
|
56 struct GUIButton *pBtn_Calendar;
|
|
57 struct GUIButton *pBtn_Maps;
|
|
58 struct GUIButton *pBtn_Autonotes;
|
|
59 struct GUIButton *pBtn_Quests;
|
0
|
60
|
|
61
|
|
62 struct GUIButton *pMainMenu_BtnExit;
|
|
63 struct GUIButton *pMainMenu_BtnCredits;
|
|
64 struct GUIButton *pMainMenu_BtnLoad;
|
|
65 struct GUIButton *pMainMenu_BtnNew;
|
|
66
|
|
67
|
167
|
68 struct GUIButton *pBtn_Up;
|
|
69 struct GUIButton *pBtn_Down;
|
0
|
70 struct GUIButton *ptr_507BA4;
|
|
71
|
|
72
|
167
|
73 struct GUIWindow *pPrimaryWindow;
|
|
74 struct GUIWindow *pChestWindow;
|
0
|
75 struct GUIWindow *pDialogueWindow;
|
|
76 struct GUIWindow *ptr_507BC0;
|
167
|
77 struct GUIWindow *pGUIWindow_ScrollWindow;
|
0
|
78 struct GUIWindow *ptr_507BC8;
|
|
79 struct GUIWindow *pGUIWindow_CurrentMenu;
|
|
80 struct GUIWindow *ptr_507BD0;
|
166
|
81 struct GUIWindow *pGUIWindow_Settings;
|
0
|
82 struct GUIWindow *ptr_507BDC;
|
167
|
83 struct GUIWindow *pGUIWindow_EscMessageWindow;
|
|
84 struct GUIWindow *pBooksWindow;
|
0
|
85 struct GUIWindow *pGUIWindow2;
|
|
86
|
|
87
|
167
|
88 struct GUIButton *pBtn_Resume;
|
|
89 struct GUIButton *pBtn_QuitGame;
|
|
90 struct GUIButton *pBtn_GameControls;
|
|
91 struct GUIButton *pBtn_LoadGame;
|
|
92 struct GUIButton *pBtn_SaveGame;
|
|
93 struct GUIButton *pBtn_NewGame;
|
|
94
|
|
95 struct GUIButton *pBtn_SliderRight;
|
|
96 struct GUIButton *pBtn_SliderLeft;
|
0
|
97
|
|
98
|
|
99 struct GUIButton *ptr_69BD58;
|
|
100 struct GUIButton *ptr_69BD5C;
|
|
101 struct GUIButton *ptr_69BD60;
|
|
102 struct GUIButton *ptr_69BD64;
|
|
103
|
|
104
|
|
105 GUIButton *pCreationUI_BtnPressRight2[4];
|
|
106 GUIButton *pCreationUI_BtnPressLeft2[4];
|
|
107 GUIButton *pCreationUI_BtnPressLeft[4];
|
|
108 GUIButton *pCreationUI_BtnPressRight[4];
|
|
109
|
|
110
|
|
111
|
|
112
|
|
113
|
|
114
|
|
115 //----- (0041D0D8) --------------------------------------------------------
|
|
116 void GUIButton::_41D0D8(GUIButton *ptr)
|
|
117 {
|
|
118 GUIWindow *v1; // eax@2
|
|
119 GUIButton *v2; // edx@2
|
|
120 GUIButton *v3; // eax@6
|
|
121
|
|
122 if ( ptr )
|
|
123 {
|
|
124 v1 = ptr->pParent;
|
|
125 v2 = ptr->pNext;
|
|
126 if ( ptr == v1->pControlsHead )
|
|
127 {
|
|
128 if ( v2 )
|
|
129 {
|
|
130 v1->pControlsHead = v2;
|
|
131 ptr->pNext->pPrev = 0;
|
|
132 }
|
|
133 else
|
|
134 {
|
|
135 v1->pControlsHead = 0;
|
|
136 ptr->pParent->pControlsTail = 0;
|
|
137 }
|
|
138 }
|
|
139 else
|
|
140 {
|
|
141 v3 = ptr->pPrev;
|
|
142 if ( v2 )
|
|
143 {
|
|
144 v3->pNext = v2;
|
|
145 ptr->pNext->pPrev = v3;
|
|
146 }
|
|
147 else
|
|
148 {
|
|
149 v3->pNext = 0;
|
|
150 ptr->pParent->pControlsTail = v3;
|
|
151 }
|
|
152 }
|
|
153 --ptr->pParent->uNumControls;
|
|
154 pAllocator->FreeChunk(ptr);
|
|
155 }
|
|
156 }
|
|
157
|
|
158
|
|
159 //----- (00415180) --------------------------------------------------------
|
|
160 char GUIButton::DrawLabel(const char *edx0, GUIFont *pFont, int a5, int *a9)
|
|
161 {
|
|
162 const char *v5; // ebx@1
|
|
163 GUIButton *v6; // esi@1
|
|
164 int v7; // eax@1
|
|
165
|
|
166 v5 = edx0;
|
|
167 v6 = this;
|
|
168 //strlen(edx0);
|
|
169 v7 = pFont->GetLineWidth(edx0);
|
|
170 return pParent->DrawText(
|
|
171 pFont,
|
|
172 v6->uX + (signed int)(v6->uWidth - v7) / 2,
|
|
173 v6->uY + (signed int)(v6->uHeight - LOBYTE(pFont->uFontHeight)) / 2,
|
|
174 a5,
|
|
175 v5,
|
|
176 0,
|
|
177 0,
|
|
178 (unsigned int)a9);
|
|
179 }
|