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) --------------------------------------------------------
|
|
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 }
|