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
|
|
13 struct GUIButton *pBtn_CloseBook;
|
|
14 struct GUIButton *pBtn_InstallRemoveSpell;
|
|
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;
|
|
27 struct GUIButton *pBtn_ExitCancel;
|
|
28 struct GUIButton *pBtn_YES;
|
|
29 struct GUIButton *pPlayerCreationUI_BtnPlus;
|
|
30 struct GUIButton *pPlayerCreationUI_BtnMinus;
|
|
31
|
|
32
|
|
33 struct GUIButton *pButton_RestUI_Main;
|
|
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
|
|
40 struct GUIButton *pCharacterScreen_ExitBtn;
|
|
41 struct GUIButton *pCharacterScreen_AwardsBtn;
|
|
42 struct GUIButton *pCharacterScreen_InventoryBtn;
|
|
43 struct GUIButton *pCharacterScreen_SkillsBtn;
|
|
44 struct GUIButton *pCharacterScreen_StatsBtn;
|
|
45 struct GUIButton *pCharacterScreen_DollBtn;
|
|
46 struct GUIButton *pCharacterScreen_DetalizBtn;
|
|
47
|
|
48
|
|
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;
|
|
60
|
|
61
|
|
62 struct GUIButton *pMainMenu_BtnExit;
|
|
63 struct GUIButton *pMainMenu_BtnCredits;
|
|
64 struct GUIButton *pMainMenu_BtnLoad;
|
|
65 struct GUIButton *pMainMenu_BtnNew;
|
|
66
|
|
67
|
|
68 struct GUIButton *pBtn_Up;
|
|
69 struct GUIButton *pBtn_Down;
|
|
70 struct GUIButton *ptr_507BA4;
|
|
71
|
|
72
|
|
73 struct GUIWindow *pPrimaryWindow;
|
|
74 struct GUIWindow *pChestWindow;
|
|
75 struct GUIWindow *pDialogueWindow;
|
336
|
76 struct GUIWindow *window_SpeakInHouse;
|
0
|
77 struct GUIWindow *pGUIWindow_ScrollWindow;
|
|
78 struct GUIWindow *ptr_507BC8;
|
|
79 struct GUIWindow *pGUIWindow_CurrentMenu;
|
|
80 struct GUIWindow *ptr_507BD0;
|
|
81 struct GUIWindow *pGUIWindow_Settings;
|
|
82 struct GUIWindow *ptr_507BDC;
|
|
83 struct GUIWindow *pGUIWindow_EscMessageWindow;
|
|
84 struct GUIWindow *pBooksWindow;
|
|
85 struct GUIWindow *pGUIWindow2;
|
|
86
|
|
87
|
|
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;
|
|
97
|
|
98
|
2
|
99 struct GUIButton *pBtnDownArrow;
|
|
100 struct GUIButton *pBtnArrowUp;
|
|
101 struct GUIButton *pBtnCancel;
|
|
102 struct GUIButton *pBtnLoadSlot;
|
0
|
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) --------------------------------------------------------
|
697
|
116 void GUIButton::Release()
|
0
|
117 {
|
|
118 GUIWindow *v1; // eax@2
|
|
119 GUIButton *v2; // edx@2
|
|
120 GUIButton *v3; // eax@6
|
697
|
121 GUIButton *ptr;
|
0
|
122
|
697
|
123 ptr=this;
|
0
|
124 if ( ptr )
|
|
125 {
|
|
126 v1 = ptr->pParent;
|
|
127 v2 = ptr->pNext;
|
|
128 if ( ptr == v1->pControlsHead )
|
|
129 {
|
|
130 if ( v2 )
|
|
131 {
|
|
132 v1->pControlsHead = v2;
|
|
133 ptr->pNext->pPrev = 0;
|
|
134 }
|
|
135 else
|
|
136 {
|
|
137 v1->pControlsHead = 0;
|
|
138 ptr->pParent->pControlsTail = 0;
|
|
139 }
|
|
140 }
|
|
141 else
|
|
142 {
|
|
143 v3 = ptr->pPrev;
|
|
144 if ( v2 )
|
|
145 {
|
|
146 v3->pNext = v2;
|
|
147 ptr->pNext->pPrev = v3;
|
|
148 }
|
|
149 else
|
|
150 {
|
|
151 v3->pNext = 0;
|
|
152 ptr->pParent->pControlsTail = v3;
|
|
153 }
|
|
154 }
|
|
155 --ptr->pParent->uNumControls;
|
|
156 }
|
|
157 }
|
|
158
|
|
159
|
|
160 //----- (00415180) --------------------------------------------------------
|
|
161 char GUIButton::DrawLabel(const char *edx0, GUIFont *pFont, int a5, int *a9)
|
|
162 {
|
|
163 const char *v5; // ebx@1
|
|
164 GUIButton *v6; // esi@1
|
|
165 int v7; // eax@1
|
|
166
|
|
167 v5 = edx0;
|
|
168 v6 = this;
|
|
169 //strlen(edx0);
|
|
170 v7 = pFont->GetLineWidth(edx0);
|
|
171 return pParent->DrawText(
|
|
172 pFont,
|
|
173 v6->uX + (signed int)(v6->uWidth - v7) / 2,
|
|
174 v6->uY + (signed int)(v6->uHeight - LOBYTE(pFont->uFontHeight)) / 2,
|
|
175 a5,
|
|
176 v5,
|
|
177 0,
|
|
178 0,
|
|
179 (unsigned int)a9);
|
|
180 }
|