0
|
1 #include "GUIWindow.h"
|
|
2 #include "GUIFont.h"
|
|
3
|
1296
|
4 #include "mm7_data.h"
|
|
5 #include "LOD.h"
|
1297
|
6 #include "Texts.h"
|
0
|
7
|
|
8
|
|
9
|
|
10
|
|
11 struct GUIButton *pBtn_CloseBook;
|
|
12 struct GUIButton *pBtn_InstallRemoveSpell;
|
|
13 struct GUIButton *pBtn_Autonotes_Instructors;
|
|
14 struct GUIButton *pBtn_Autonotes_Misc;
|
|
15 struct GUIButton *pBtn_Book_6;
|
|
16 struct GUIButton *pBtn_Book_5;
|
|
17 struct GUIButton *pBtn_Book_4;
|
|
18 struct GUIButton *pBtn_Book_3;
|
|
19 struct GUIButton *pBtn_Book_2;
|
|
20 struct GUIButton *pBtn_Book_1;
|
|
21
|
|
22
|
|
23 struct GUIButton *pPlayerCreationUI_BtnReset;
|
|
24 struct GUIButton *pPlayerCreationUI_BtnOK;
|
|
25 struct GUIButton *pBtn_ExitCancel;
|
|
26 struct GUIButton *pBtn_YES;
|
|
27 struct GUIButton *pPlayerCreationUI_BtnPlus;
|
|
28 struct GUIButton *pPlayerCreationUI_BtnMinus;
|
|
29
|
|
30
|
|
31 struct GUIButton *pButton_RestUI_Main;
|
|
32 struct GUIButton *pButton_RestUI_Exit;
|
|
33 struct GUIButton *pButton_RestUI_Wait5Minutes;
|
|
34 struct GUIButton *pButton_RestUI_WaitUntilDawn;
|
|
35 struct GUIButton *pButton_RestUI_Wait1Hour;
|
|
36
|
|
37
|
|
38 struct GUIButton *pCharacterScreen_ExitBtn;
|
|
39 struct GUIButton *pCharacterScreen_AwardsBtn;
|
|
40 struct GUIButton *pCharacterScreen_InventoryBtn;
|
|
41 struct GUIButton *pCharacterScreen_SkillsBtn;
|
|
42 struct GUIButton *pCharacterScreen_StatsBtn;
|
|
43 struct GUIButton *pCharacterScreen_DollBtn;
|
|
44 struct GUIButton *pCharacterScreen_DetalizBtn;
|
|
45
|
|
46
|
|
47 struct GUIButton *pBtn_NPCRight;
|
|
48 struct GUIButton *pBtn_NPCLeft;
|
|
49 struct GUIButton *pBtn_GameSettings;
|
|
50 struct GUIButton *pBtn_QuickReference;
|
|
51 struct GUIButton *pBtn_CastSpell;
|
|
52 struct GUIButton *pBtn_Rest;
|
|
53 struct GUIButton *pBtn_History;
|
|
54 struct GUIButton *pBtn_Calendar;
|
|
55 struct GUIButton *pBtn_Maps;
|
|
56 struct GUIButton *pBtn_Autonotes;
|
|
57 struct GUIButton *pBtn_Quests;
|
|
58
|
|
59
|
|
60 struct GUIButton *pMainMenu_BtnExit;
|
|
61 struct GUIButton *pMainMenu_BtnCredits;
|
|
62 struct GUIButton *pMainMenu_BtnLoad;
|
|
63 struct GUIButton *pMainMenu_BtnNew;
|
|
64
|
|
65
|
|
66 struct GUIButton *pBtn_Up;
|
|
67 struct GUIButton *pBtn_Down;
|
|
68 struct GUIButton *ptr_507BA4;
|
|
69
|
|
70
|
|
71 struct GUIWindow *pPrimaryWindow;
|
|
72 struct GUIWindow *pChestWindow;
|
|
73 struct GUIWindow *pDialogueWindow;
|
336
|
74 struct GUIWindow *window_SpeakInHouse;
|
0
|
75 struct GUIWindow *pGUIWindow_ScrollWindow;
|
|
76 struct GUIWindow *ptr_507BC8;
|
|
77 struct GUIWindow *pGUIWindow_CurrentMenu;
|
|
78 struct GUIWindow *ptr_507BD0;
|
|
79 struct GUIWindow *pGUIWindow_Settings;
|
|
80 struct GUIWindow *ptr_507BDC;
|
|
81 struct GUIWindow *pGUIWindow_EscMessageWindow;
|
|
82 struct GUIWindow *pBooksWindow;
|
|
83 struct GUIWindow *pGUIWindow2;
|
|
84
|
|
85
|
|
86 struct GUIButton *pBtn_Resume;
|
|
87 struct GUIButton *pBtn_QuitGame;
|
|
88 struct GUIButton *pBtn_GameControls;
|
|
89 struct GUIButton *pBtn_LoadGame;
|
|
90 struct GUIButton *pBtn_SaveGame;
|
|
91 struct GUIButton *pBtn_NewGame;
|
|
92
|
|
93 struct GUIButton *pBtn_SliderRight;
|
|
94 struct GUIButton *pBtn_SliderLeft;
|
|
95
|
|
96
|
2
|
97 struct GUIButton *pBtnDownArrow;
|
|
98 struct GUIButton *pBtnArrowUp;
|
|
99 struct GUIButton *pBtnCancel;
|
|
100 struct GUIButton *pBtnLoadSlot;
|
0
|
101
|
|
102
|
1202
|
103 std::array<GUIButton*, 4> pCreationUI_BtnPressRight2;
|
|
104 std::array<GUIButton*, 4> pCreationUI_BtnPressLeft2;
|
|
105 std::array<GUIButton*, 4> pCreationUI_BtnPressLeft;
|
|
106 std::array<GUIButton*, 4> pCreationUI_BtnPressRight;
|
0
|
107
|
|
108
|
|
109
|
|
110
|
|
111
|
|
112
|
|
113 //----- (0041D0D8) --------------------------------------------------------
|
697
|
114 void GUIButton::Release()
|
0
|
115 {
|
|
116 GUIWindow *v1; // eax@2
|
|
117 GUIButton *v2; // edx@2
|
|
118 GUIButton *v3; // eax@6
|
697
|
119 GUIButton *ptr;
|
0
|
120
|
697
|
121 ptr=this;
|
0
|
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 }
|
|
155 }
|
|
156
|
|
157
|
|
158 //----- (00415180) --------------------------------------------------------
|
1006
|
159 void GUIButton::DrawLabel( const char *label_text, struct GUIFont *pFont, int a5, int uFontShadowColor )
|
|
160 {
|
0
|
161 const char *v5; // ebx@1
|
|
162 GUIButton *v6; // esi@1
|
|
163 int v7; // eax@1
|
|
164
|
1006
|
165 v5 = label_text;
|
0
|
166 v6 = this;
|
|
167 //strlen(edx0);
|
1006
|
168 v7 = pFont->GetLineWidth(label_text);
|
0
|
169 return pParent->DrawText(
|
|
170 pFont,
|
|
171 v6->uX + (signed int)(v6->uWidth - v7) / 2,
|
1006
|
172 v6->uY + (signed int)(v6->uHeight - pFont->uFontHeight) / 2,
|
0
|
173 a5,
|
1006
|
174 label_text,
|
0
|
175 0,
|
|
176 0,
|
1006
|
177 uFontShadowColor);
|
0
|
178 }
|
1295
|
179 //----- (004B36CC) --------------------------------------------------------
|
|
180 void CreateButtonInColumn( int column_pos, unsigned int control_id )
|
|
181 {
|
|
182 pDialogueWindow->CreateButton( 480, 30 * column_pos + 146, 140, 30, 1, 0, UIMSG_SelectShopDialogueOption, control_id, 0, "", 0);
|
1296
|
183 }
|
|
184 //----- (00419379) --------------------------------------------------------
|
|
185 void __cdecl sub_419379()
|
|
186 {
|
|
187 GUIButton *pButton; // esi@2
|
|
188
|
|
189 if ( dword_507CBC )
|
|
190 {
|
|
191 dword_507CBC = 0;
|
|
192 ptr_507BA4->Release();
|
|
193 pBtn_Up->Release();
|
|
194 pBtn_Down->Release();
|
|
195 pBtn_Down = 0;
|
|
196 pBtn_Up = 0;
|
|
197 for ( pButton = pGUIWindow_CurrentMenu->pControlsHead; pButton; pButton = pButton->pNext )
|
|
198 {
|
|
199 if ( pButton->msg == UIMSG_InventoryLeftClick )
|
|
200 {
|
|
201 pButton->uX = dword_50698C_uX;
|
|
202 pButton->uY = dword_506988_uY;
|
|
203 pButton->uZ = dword_506984_uZ;
|
|
204 pButton->uW = dword_506980_uW;
|
|
205 pGUIWindow_CurrentMenu->_41D08F_set_keyboard_control_group(1, 0, 0, 0);
|
|
206 }
|
|
207 }
|
|
208 }
|
|
209 }
|
|
210 //----- (00419220) --------------------------------------------------------
|
|
211 void __cdecl sub_419220()
|
|
212 {
|
|
213 GUIButton *i; // eax@2
|
|
214
|
|
215 if ( !dword_507CBC )
|
|
216 {
|
|
217 dword_507CBC = 1;
|
|
218 for ( i = pGUIWindow_CurrentMenu->pControlsHead; i; i = i->pNext )
|
|
219 {
|
|
220 if ( i->msg == UIMSG_InventoryLeftClick )
|
|
221 {
|
|
222 dword_50698C_uX = i->uX;
|
|
223 dword_506988_uY = i->uY;
|
|
224 dword_506984_uZ = i->uZ;
|
|
225 dword_506980_uW = i->uW;
|
|
226 i->uW = 0;
|
|
227 i->uZ = 0;
|
|
228 i->uY = 0;
|
|
229 i->uX = 0;
|
|
230 }
|
|
231 }
|
|
232 pBtn_Up = pGUIWindow_CurrentMenu->CreateButton(438, 46,
|
|
233 pIcons_LOD->GetTexture(uTextureID_ar_up_up)->uTextureWidth,
|
|
234 pIcons_LOD->GetTexture(uTextureID_ar_up_up)->uTextureHeight,
|
|
235 1, 0, UIMSG_ClickAwardsUpBtn, 0, 0, "",
|
|
236 pIcons_LOD->GetTexture(uTextureID_ar_up_up),
|
|
237 pIcons_LOD->GetTexture(uTextureID_ar_up_dn), 0);
|
|
238 pBtn_Down = pGUIWindow_CurrentMenu->CreateButton(438, 292,
|
|
239 pIcons_LOD->GetTexture(uTextureID_ar_dn_up)->uTextureWidth,
|
|
240 pIcons_LOD->GetTexture(uTextureID_ar_dn_up)->uTextureHeight,
|
|
241 1, 0, UIMSG_ClickAwardsDownBtn, 0, 0, "",
|
|
242 pIcons_LOD->GetTexture(uTextureID_ar_dn_up),
|
|
243 pIcons_LOD->GetTexture(uTextureID_ar_dn_dn), 0);
|
|
244 ptr_507BA4 = pGUIWindow_CurrentMenu->CreateButton(440, 62, 16, 232, 1, 0, UIMSG_ClickAwardScrollBar, 0, 0, "", 0);
|
|
245 }
|
1297
|
246 }
|
|
247 //----- (004BCA33) --------------------------------------------------------
|
|
248 void UI_CreateEndConversationButton()
|
|
249 {
|
|
250 pDialogueWindow->Release();
|
|
251 pDialogueWindow = GUIWindow::Create(0, 0, 640, 345, WINDOW_MainMenu, 0, 0);
|
|
252 pBtn_ExitCancel = pDialogueWindow->CreateButton( 471, 445, 169, 35, 1, 0, UIMSG_Escape, 0, 0,
|
|
253 pGlobalTXT_LocalizationStrings[74], //"End Conversation"
|
|
254 pIcons_LOD->GetTexture(uExitCancelTextureId), 0);
|
|
255 pDialogueWindow->CreateButton(8, 8, 450, 320, 1, 0, UIMSG_BuyInShop_Identify_Repair, 0, 0, "", 0);
|
1295
|
256 } |