Mercurial > mm7
annotate GUIWindow.cpp @ 1849:794f6ac640f4
Actor::ToggleFlag, sub_448518_npc_set_item cleanup
author | Grumpy7 |
---|---|
date | Sun, 13 Oct 2013 08:03:14 +0200 |
parents | 211dfe2d8db1 |
children | ab1c03cc2219 |
rev | line source |
---|---|
1165
29a8defbad9e
temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents:
1160
diff
changeset
|
1 #ifdef _MSC_VER |
29a8defbad9e
temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents:
1160
diff
changeset
|
2 #define _CRT_SECURE_NO_WARNINGS |
29a8defbad9e
temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents:
1160
diff
changeset
|
3 #endif |
29a8defbad9e
temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents:
1160
diff
changeset
|
4 |
0 | 5 #include "GUIWindow.h" |
6 #include "GUIFont.h" | |
7 #include "Party.h" | |
8 #include "LOD.h" | |
9 #include "Keyboard.h" | |
10 #include "Math.h" | |
11 #include "VideoPlayer.h" | |
12 #include "MapInfo.h" | |
13 #include "Time.h" | |
14 #include "AudioPlayer.h" | |
15 #include "Mouse.h" | |
16 #include "Viewport.h" | |
17 #include "Render.h" | |
18 #include "PlayerFrameTable.h" | |
19 #include "SaveLoad.h" | |
20 #include "StorylineTextTable.h" | |
21 #include "Events2D.h" | |
1299 | 22 #include "UI\UIHouses.h" |
1310 | 23 #include "UI\UIBooks.h" |
189 | 24 #include "texts.h" |
81
377535d6e366
structure boundaries fixed in many places. fixed quests, notes, awards, calendar.
zipi
parents:
74
diff
changeset
|
25 #include "Autonotes.h" |
949 | 26 #include "Awards.h" |
1297 | 27 #include "Chest.h" |
1638
ccde94f02b75
class IndoorCamera split into BLVRenderParams and ODMRenderParams
Nomad
parents:
1591
diff
changeset
|
28 #include "Outdoor.h" |
1640
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1639
diff
changeset
|
29 #include "Game.h" |
0 | 30 |
31 | |
32 #include "mm7_data.h" | |
33 | |
1268 | 34 typedef struct _RGBColor |
35 { | |
36 unsigned char R; | |
37 unsigned char B; | |
38 unsigned char G; | |
39 }RGBColor; | |
0 | 40 |
41 | |
1268 | 42 std::array<RGBColor, 20> spell_tooltip_colors={{ |
43 {0x96, 0xD4, 0xFF}, | |
44 {0xFF, 0x80, 0x00}, | |
45 {0xFF, 0xFF, 0x9B}, | |
46 {0xE1, 0xE1, 0xE1}, | |
47 {0x80, 0x80, 0x80}, | |
48 {0x96, 0xD4, 0xFF}, | |
49 {0xFF, 0x55, 0x00}, | |
50 {0x96, 0xD4, 0xFF}, | |
51 {0xFF, 0x55, 0x00}, | |
52 {0xE1, 0xE1, 0xE1}, | |
53 {0xFF, 0x55, 0x00}, | |
54 {0x96, 0xD4, 0xFF}, | |
55 {0xEB, 0x0F, 0xFF}, | |
56 {0xFF, 0x80, 0x00}, | |
57 {0x96, 0xD4, 0xFF}, | |
58 {0x80, 0x80, 0x80}, | |
59 {0xFF, 0x55, 0x00}, | |
60 {0x00, 0x80, 0xFF}, | |
61 {0x00, 0x80, 0xFF}, | |
62 {0x96, 0xD4, 0xFF}}}; | |
63 | |
0 | 64 |
65 int pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[1]; // idb | |
66 struct GUIWindow *pWindow_MainMenu; | |
1202 | 67 std::array<struct GUIWindow, 20> pWindowList; |
0 | 68 |
69 struct GUIMessageQueue *pMessageQueue_50CBD0 = new GUIMessageQueue; | |
1012 | 70 struct GUIMessageQueue *pMessageQueue_50C9E8 = new GUIMessageQueue; |
0 | 71 |
1038 | 72 |
73 | |
74 | |
75 | |
76 | |
783 | 77 // inlined |
78 //----- (mm6c::00420520) -------------------------------------------------- | |
79 void GUIMessageQueue::Flush() | |
80 { | |
81 if (uNumMessages) | |
82 uNumMessages = pMessages[0].field_8 != 0; | |
83 } | |
84 | |
85 | |
0 | 86 //----- (004356B9) -------------------------------------------------------- |
87 void GUIMessageQueue::PopMessage(enum UIMessageType *pType, int *pParam, int *a4) | |
88 { | |
89 signed int v4; // edx@1 | |
90 GUIMessage *v5; // eax@2 | |
91 | |
92 v4 = 0; | |
93 if ( this->uNumMessages ) | |
94 { | |
95 v5 = this->pMessages; | |
96 *pType = this->pMessages[0].eType; | |
97 *pParam = this->pMessages[0].param; | |
98 *a4 = this->pMessages[0].field_8; | |
99 if ( (signed int)(this->uNumMessages - 1) > 0 ) | |
100 { | |
101 do | |
102 { | |
103 v5->eType = v5[1].eType; | |
104 v5->param = v5[1].param; | |
105 v5->field_8 = v5[1].field_8; | |
106 ++v4; | |
107 ++v5; | |
108 } | |
109 while ( v4 < (signed int)(this->uNumMessages - 1) ); | |
110 } | |
111 --this->uNumMessages; | |
112 } | |
113 } | |
114 | |
115 | |
116 | |
994 | 117 |
118 | |
119 | |
120 //----- (0041B4E1) -------------------------------------------------------- | |
121 int __fastcall GUI_ReplaceHotkey(unsigned __int8 uOldHotkey, unsigned __int8 uNewHotkey, char bFirstCall) | |
122 { | |
123 unsigned __int8 v3; // bl@1 | |
124 int result; // eax@1 | |
125 int i; // edx@2 | |
126 GUIButton *j; // ecx@3 | |
127 int k; // edx@7 | |
128 GUIButton *l; // ecx@8 | |
129 unsigned __int8 v9; // [sp+4h] [bp-8h]@1 | |
130 char v10; // [sp+8h] [bp-4h]@1 | |
131 | |
132 v3 = uNewHotkey; | |
133 v10 = toupper(uOldHotkey); | |
134 result = toupper(v3); | |
135 v9 = result; | |
136 if ( bFirstCall ) | |
137 { | |
138 for ( i = uNumVisibleWindows; i >= 0; --i ) | |
139 { | |
140 result = 84 * pVisibleWindowsIdxs[i]; | |
141 for ( j = pWindowList[pVisibleWindowsIdxs[i] - 1].pControlsHead; j; j = j->pNext ) | |
142 j->field_28 = 0; | |
143 } | |
144 } | |
145 for ( k = uNumVisibleWindows; k >= 0; --k ) | |
146 { | |
147 result = 84 * pVisibleWindowsIdxs[k]; | |
148 for ( l = pWindowList[pVisibleWindowsIdxs[k] - 1].pControlsHead; l; l = l->pNext ) | |
149 { | |
150 LOBYTE(result) = v10; | |
151 if ( l->uHotkey == v10 ) | |
152 { | |
153 if ( !l->field_28 ) | |
154 { | |
155 LOBYTE(result) = v9; | |
156 l->field_28 = 1; | |
157 l->uHotkey = v9; | |
158 } | |
159 } | |
160 } | |
161 } | |
162 return result; | |
163 } | |
164 | |
165 | |
166 | |
167 | |
168 //----- (0041B438) -------------------------------------------------------- | |
169 GUIButton *__fastcall GUI_HandleHotkey(unsigned __int8 uHotkey) | |
170 { | |
171 char v1; // al@1 | |
172 int v2; // esi@1 | |
173 char v3; // dl@1 | |
174 GUIWindow *v4; // ecx@2 | |
175 GUIButton *result; // eax@2 | |
176 //int v6; // edx@12 | |
177 | |
178 v1 = toupper(uHotkey); | |
179 v2 = uNumVisibleWindows; | |
180 v3 = v1; | |
1210 | 181 for( v2 = uNumVisibleWindows; v2 >= 0 && pVisibleWindowsIdxs[v2] > 0; v2-- ) |
994 | 182 { |
1210 | 183 v4 = &pWindowList[pVisibleWindowsIdxs[v2] - 1]; |
184 for ( result = v4->pControlsHead; result; result = result->pNext ) | |
185 { | |
186 if ( result->uHotkey == v3 ) | |
187 { | |
188 pMessageQueue_50CBD0->AddMessage(result->msg, result->msg_param, 0); | |
189 return result; | |
190 } | |
191 } | |
192 if ( !v4->uFrameX && !v4->uFrameY && (v4->uFrameWidth == 640 && v4->uFrameHeight == 480) ) | |
193 break; | |
994 | 194 } |
195 return 0; | |
196 } | |
197 // 5075E0: using guessed type int pVisibleWindowsIdxs[20]; | |
198 | |
0 | 199 //----- (0041D73D) -------------------------------------------------------- |
1006 | 200 void GUIWindow::_41D73D_draw_buff_tooltip() |
201 { | |
1268 | 202 |
203 __int64 remaing_time; // ST28_8@11 | |
204 unsigned short text_color; | |
205 int Y_pos; // esi@11 | |
206 int string_count; // [sp+20h] [bp-4h]@7 | |
207 | |
208 | |
209 string_count = 0; | |
210 for (int i=0; i<20; ++i) | |
211 if ( pParty->pPartyBuffs[i].uExpireTime > 0i64 ) | |
212 ++string_count; | |
0 | 213 |
1268 | 214 uFrameHeight = pFontArrus->uFontHeight + 72; |
215 uFrameHeight += (string_count - 1) * pFontArrus->uFontHeight; | |
216 uFrameZ = uFrameWidth + uFrameX - 1; | |
217 uFrameW = uFrameY + uFrameHeight - 1; | |
218 DrawMessageBox(0); | |
219 DrawTitleText(pFontArrus, 0, 12, 0, pGlobalTXT_LocalizationStrings[451], 3u); | |
220 if ( !string_count ) | |
221 DrawTitleText(pFontComic, 0, 40, 0, pGlobalTXT_LocalizationStrings[153], 3u); | |
222 | |
223 GetTickCount(); | |
224 string_count = 0; | |
225 for (int i=0; i<20; ++i) | |
0 | 226 { |
1268 | 227 if ( pParty->pPartyBuffs[i].uExpireTime>0i64 )//!!! |
228 { | |
229 remaing_time = pParty->pPartyBuffs[i].uExpireTime- pParty->uTimePlayed;//!!! | |
230 Y_pos = string_count * pFontComic->uFontHeight + 40; | |
231 text_color = TargetColor(spell_tooltip_colors[i].R, spell_tooltip_colors[i].G, spell_tooltip_colors[i].B); | |
232 DrawText(pFontComic, 52, Y_pos, text_color, aSpellNames[i], 0, 0, 0); | |
1758
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
233 DrawBuff_remaining_time_string(Y_pos, this, remaing_time, pFontComic); |
1268 | 234 ++string_count; |
235 } | |
0 | 236 } |
237 } | |
238 | |
239 | |
240 //----- (0041D08F) -------------------------------------------------------- | |
1411 | 241 void GUIWindow::_41D08F_set_keyboard_control_group(int num_buttons, int a3, int a4, int a5) |
0 | 242 { |
1411 | 243 if (num_buttons) |
0 | 244 { |
1411 | 245 this->pNumPresenceButton = num_buttons; |
0 | 246 this->field_30 = a3; |
247 this->field_34 = a4; | |
248 this->pCurrentPosActiveItem = a5; | |
249 this->pStartingPosActiveItem = a5; | |
972 | 250 this->receives_keyboard_input = true; |
0 | 251 } |
252 else | |
253 { | |
254 this->pNumPresenceButton = 0; | |
255 this->field_30 = a3; | |
256 this->field_34 = a4; | |
257 this->pCurrentPosActiveItem = 0; | |
258 this->pStartingPosActiveItem = 0; | |
972 | 259 this->receives_keyboard_input = false; |
0 | 260 } |
261 } | |
262 | |
263 | |
264 //----- (0041C26A) -------------------------------------------------------- | |
265 void GUIWindow::Release() | |
266 { | |
961 | 267 //GUIWindow *v1; // esi@1 |
0 | 268 int i; // edi@20 |
961 | 269 //GUIButton *v8; // eax@26 |
270 GUIButton *pNextBtn; // edi@27 | |
271 //int v10; // esi@28 | |
272 //int v11; // ecx@28 | |
0 | 273 int v12; // edx@29 |
274 | |
961 | 275 //v1 = this; |
0 | 276 if ( !this ) |
277 return; | |
696 | 278 |
279 switch( this->eWindowType ) | |
0 | 280 { |
696 | 281 case WINDOW_GreetingNPC: |
282 { | |
1006 | 283 pIcons_LOD->SyncLoadedFilesCount(); |
696 | 284 pCurrentScreen = pMainScreenNum; |
1459 | 285 pKeyActionMap->SetWindowInputStatus(WINDOW_INPUT_CANCELLED); |
696 | 286 break; |
287 } | |
288 case WINDOW_HouseInterior: | |
289 { | |
290 for ( i = 0; i < uNumDialogueNPCPortraits; ++i ) | |
291 pDialogueNPCPortraits[i]->Release(); | |
292 uNumDialogueNPCPortraits = 0; | |
293 pTexture_Dialogue_Background->Release(); | |
0 | 294 |
1006 | 295 pIcons_LOD->SyncLoadedFilesCount(); |
1405
c0b273d33338
RemoveTexturesPackFromTextureList and RemoveTexturesFromTextureList
Ritor1
parents:
1404
diff
changeset
|
296 pIcons_LOD->RemoveTexturesPackFromTextureList(); |
696 | 297 dword_5C35D4 = 0; |
298 if ( bFlipOnExit ) | |
299 { | |
1638
ccde94f02b75
class IndoorCamera split into BLVRenderParams and ODMRenderParams
Nomad
parents:
1591
diff
changeset
|
300 pParty->sRotationY = (stru_5C6E00->uIntegerDoublePi - 1) & (stru_5C6E00->uIntegerPi + pParty->sRotationY); |
1640
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1639
diff
changeset
|
301 pGame->pIndoorCameraD3D->sRotationY = pParty->sRotationY; |
696 | 302 } |
303 pParty->uFlags |= 2u; | |
304 break; | |
305 } | |
306 case WINDOW_Transition: | |
307 { | |
308 pVideoPlayer->Unload(); | |
309 pTexture_outside->Release(); | |
310 pTexture_Dialogue_Background->Release(); | |
1006 | 311 pIcons_LOD->SyncLoadedFilesCount(); |
696 | 312 pCurrentScreen = pMainScreenNum; |
313 break; | |
314 } | |
315 case WINDOW_SpellBook: | |
316 { | |
1402 | 317 OnCloseSpellBookPage(); |
318 OnCloseSpellBook(); | |
696 | 319 break; |
320 } | |
321 case WINDOW_Book: | |
322 { | |
1402 | 323 OnCloseBook(); |
696 | 324 break; |
325 } | |
1402 | 326 case WINDOW_ChangeLocation: |
327 { | |
0 | 328 pTexture_outside->Release(); |
329 pTexture_Dialogue_Background->Release(); | |
1006 | 330 pIcons_LOD->SyncLoadedFilesCount(); |
11 | 331 pCurrentScreen = pMainScreenNum; |
696 | 332 break; |
333 } | |
334 case WINDOW_Dialogue: | |
335 { | |
336 if ( !dword_591084 ) | |
337 pDialogueNPCPortraits[0]->Release(); | |
338 uNumDialogueNPCPortraits = 0; | |
339 pTexture_Dialogue_Background->Release(); | |
340 | |
1006 | 341 pIcons_LOD->SyncLoadedFilesCount(); |
696 | 342 pCurrentScreen = pMainScreenNum; |
343 } | |
344 default: | |
345 { | |
346 break; | |
347 } | |
0 | 348 } |
961 | 349 //v8 = this->pControlsHead; |
350 if ( this->pControlsHead ) | |
0 | 351 { |
352 do | |
353 { | |
961 | 354 pNextBtn = this->pControlsHead->pNext; |
1583 | 355 free(this->pControlsHead); |
961 | 356 this->pControlsHead = pNextBtn; |
0 | 357 } |
961 | 358 while ( pNextBtn ); |
0 | 359 } |
961 | 360 this->pControlsHead = 0; |
361 this->pControlsTail = 0; | |
362 this->uNumControls = 0; | |
363 this->eWindowType = WINDOW_null; | |
364 while ( this->numVisibleWindows < uNumVisibleWindows ) | |
0 | 365 { |
961 | 366 v12 = pVisibleWindowsIdxs[this->numVisibleWindows + 1]; |
367 pVisibleWindowsIdxs[this->numVisibleWindows] = v12; | |
962 | 368 --pWindowList[v12 - 1].numVisibleWindows; |
961 | 369 ++this->numVisibleWindows; |
0 | 370 } |
961 | 371 pVisibleWindowsIdxs[uNumVisibleWindows] = 0; |
372 uNumVisibleWindows = uNumVisibleWindows - 1; | |
0 | 373 } |
374 | |
375 | |
376 | |
377 | |
378 | |
379 | |
380 //----- (0041CD3B) -------------------------------------------------------- | |
381 GUIButton *GUIWindow::GetControl(unsigned int uID) | |
382 { | |
383 GUIButton *result; // eax@1 | |
384 | |
385 result = this->pControlsHead; | |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1411
diff
changeset
|
386 for ( uID; uID; --uID ) |
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1411
diff
changeset
|
387 result = result->pNext; |
0 | 388 return result; |
389 } | |
390 | |
391 //----- (00411BFC) -------------------------------------------------------- | |
392 void GUIWindow::InitializeBookView() | |
393 { | |
1453 | 394 char *pString; // eax@12 |
395 int pTextHeight; // eax@12 | |
396 //__int64 page_count; // qax@12 | |
397 unsigned int page_count; // esi@12 | |
0 | 398 unsigned __int16 v18; // ax@38 |
1310 | 399 signed int max_beacons; // [sp+10h] [bp-5Ch]@38 |
1453 | 400 GUIWindow journal_window; // [sp+18h] [bp-54h]@8 |
0 | 401 |
402 pAudioPlayer->StopChannels(-1, -1); | |
403 InitializeBookFonts(); | |
1453 | 404 this->CreateButton(475, 445, 158, 34, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[79], 0); // Close |
151 | 405 pCurrentScreen = SCREEN_BOOKS; |
1446 | 406 full_num_items_in_book = 0; |
407 books_primary_item_per_page = 0; | |
408 books_page_number = 0; | |
949 | 409 num_achieved_awards = 0; |
1453 | 410 switch (this->par1C) |
411 { | |
412 case WINDOW_LloydsBeacon: | |
413 { | |
688 | 414 byte_506360 = 0; |
948 | 415 pTexture_CurrentBook = pIcons_LOD->LoadTexturePtr("lb_bordr", TEXTURE_16BIT_PALETTE); |
416 pTexture_LloydBeacons[0] = pIcons_LOD->LoadTexturePtr("sbmap", TEXTURE_16BIT_PALETTE); | |
1310 | 417 pTexture_LloydBeacons[1] = pIcons_LOD->LoadTexturePtr("sbmap", TEXTURE_16BIT_PALETTE); |
1453 | 418 pTex_book_button1_on = pIcons_LOD->LoadTexturePtr("tab-an-6b", TEXTURE_16BIT_PALETTE); |
419 pTex_book_button1_off = pIcons_LOD->LoadTexturePtr("tab-an-6a", TEXTURE_16BIT_PALETTE); | |
948 | 420 |
1453 | 421 pBtn_Book_1 = this->CreateButton(415, 13, 39, 36, 1, 0, UIMSG_LloydsBeacon_FlippingBtn, 0, 0, pGlobalTXT_LocalizationStrings[375], 0); // Set Beacon |
422 pBtn_Book_2 = this->CreateButton(415, 48, 39, 36, 1, 0, UIMSG_LloydsBeacon_FlippingBtn, 1, 0, pGlobalTXT_LocalizationStrings[523], 0); // Recall Beacon | |
1310 | 423 |
424 max_beacons = 1; | |
1453 | 425 v18 = pParty->pPlayers[_506348_current_lloyd_playerid].pActiveSkills[PLAYER_SKILL_WATER]; |
1310 | 426 if ( v18 & 0x100 || (v18 & 0x80) ) |
427 max_beacons = 5; | |
428 else if ( v18 & 0x40 ) | |
429 max_beacons = 3; | |
430 | |
1453 | 431 for ( int i = 0; i < max_beacons; ++i ) |
1430 | 432 CreateButton(pLloydsBeaconsPreviewXs[i], pLloydsBeaconsPreviewYs[i], |
1310 | 433 92, 68, 1, 180, UIMSG_InstallBeacon, i, 0, "", 0); |
434 | |
1453 | 435 for ( int i = 0; i < 5; ++i ) |
436 { | |
437 if (pParty->pPlayers[_506348_current_lloyd_playerid].pInstalledBeacons[i].uBeaconTime >= (signed __int64)pParty->uTimePlayed) | |
438 LoadThumbnailLloydTexture(i, _506348_current_lloyd_playerid + 1); | |
439 else | |
440 memset(&pParty->pPlayers[_506348_current_lloyd_playerid].pInstalledBeacons[i], 0, sizeof(LloydBeacon)); | |
441 } | |
442 } | |
443 break; | |
710 | 444 |
445 case WINDOW_TownPortal: | |
446 { | |
948 | 447 pTexture_CurrentBook = pIcons_LOD->LoadTexturePtr("townport", TEXTURE_16BIT_PALETTE); |
710 | 448 pTexture_TownPortalIcons[0] = pIcons_LOD->LoadTexturePtr("tpharmndy", TEXTURE_16BIT_PALETTE); |
449 pTexture_TownPortalIcons[1] = pIcons_LOD->LoadTexturePtr("tpelf", TEXTURE_16BIT_PALETTE); | |
450 pTexture_TownPortalIcons[2] = pIcons_LOD->LoadTexturePtr("tpwarlock", TEXTURE_16BIT_PALETTE); | |
451 pTexture_TownPortalIcons[3] = pIcons_LOD->LoadTexturePtr("tpisland", TEXTURE_16BIT_PALETTE); | |
452 pTexture_TownPortalIcons[4] = pIcons_LOD->LoadTexturePtr("tpheaven", TEXTURE_16BIT_PALETTE); | |
730 | 453 pTexture_TownPortalIcons[5] = pIcons_LOD->LoadTexturePtr("tphell", TEXTURE_16BIT_PALETTE); |
1393 | 454 |
455 static int pTownPortalBook_ws[6] = { 80, 66, 68, 72, 67, 74}; | |
456 static int pTownPortalBook_hs[6] = { 55, 56, 65, 67, 67, 59}; | |
1453 | 457 for ( uint i = 0; i < 6; ++i ) |
458 this->CreateButton(pTownPortalBook_xs[i], pTownPortalBook_ys[i], pTownPortalBook_ws[i], pTownPortalBook_hs[i], 1, 182, UIMSG_ClickTownInTP, i, 0, "", nullptr); | |
1310 | 459 |
710 | 460 } |
461 break; | |
462 | |
463 case WINDOW_QuestBook: | |
948 | 464 { |
465 pTexture_CurrentBook = pIcons_LOD->LoadTexturePtr("sbquiknot", TEXTURE_16BIT_PALETTE); | |
466 pSpellBookPagesTextr_10 = pIcons_LOD->LoadTexturePtr( "divbar", TEXTURE_16BIT_PALETTE); | |
1453 | 467 pTex_book_button1_on = pIcons_LOD->LoadTexturePtr("tab-an-6b", TEXTURE_16BIT_PALETTE); |
468 pTex_book_button2_on = pIcons_LOD->LoadTexturePtr("tab-an-7b", TEXTURE_16BIT_PALETTE); | |
469 pTex_book_button1_off = pIcons_LOD->LoadTexturePtr("tab-an-6a", TEXTURE_16BIT_PALETTE); | |
470 pTex_book_button2_off = pIcons_LOD->LoadTexturePtr("tab-an-7a", TEXTURE_16BIT_PALETTE); | |
471 pBtn_Book_1 = this->CreateButton(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 1, | |
472 pTex_book_button1_on->uTextureWidth, pTex_book_button1_on->uTextureHeight, | |
996 | 473 1, 0, UIMSG_ClickBooksBtn, 0xBu, 0, pGlobalTXT_LocalizationStrings[192],// "Scroll Up" |
1453 | 474 pTex_book_button1_on, 0); |
475 pBtn_Book_2 = this->CreateButton(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 38, | |
476 pTex_book_button2_on->uTextureHeight, pTex_book_button2_on->uTextureHeight, | |
996 | 477 1, 0, UIMSG_ClickBooksBtn, 0xAu, 0, pGlobalTXT_LocalizationStrings[193],// "Scroll Down" |
1453 | 478 pTex_book_button2_on, 0); |
949 | 479 num_achieved_awards = 0; |
1202 | 480 memset(achieved_awards.data(), 0, 4000); |
1453 | 481 for ( uint i = books_primary_item_per_page; i < 512; ++i ) |
482 { | |
483 if ( _449B57_test_bit(pParty->_quest_bits, i) && pQuestTable[i] ) | |
484 { | |
485 achieved_awards[num_achieved_awards] = (AwardType)i; | |
486 ++num_achieved_awards; | |
487 } | |
488 } | |
489 full_num_items_in_book = num_achieved_awards; | |
949 | 490 num_achieved_awards = 0; |
1453 | 491 } |
492 break; | |
981 | 493 |
1453 | 494 case WINDOW_AutonotesBook: |
495 { | |
948 | 496 pTexture_AutonotesBook = pIcons_LOD->LoadTexturePtr("sbautnot", TEXTURE_16BIT_PALETTE); |
497 pSpellBookPagesTextr_10 = pIcons_LOD->LoadTexturePtr("divbar", TEXTURE_16BIT_PALETTE); | |
1453 | 498 pTex_book_button1_on = pIcons_LOD->LoadTexturePtr("tab-an-6b", TEXTURE_16BIT_PALETTE); |
499 pTex_book_button2_on = pIcons_LOD->LoadTexturePtr("tab-an-7b", TEXTURE_16BIT_PALETTE); | |
500 pTex_book_button1_off = pIcons_LOD->LoadTexturePtr("tab-an-6a", TEXTURE_16BIT_PALETTE); | |
501 pTex_book_button2_off = pIcons_LOD->LoadTexturePtr("tab-an-7a", TEXTURE_16BIT_PALETTE); | |
502 pTex_book_button3_on = pIcons_LOD->LoadTexturePtr("tab-an-1b", TEXTURE_16BIT_PALETTE); | |
503 pTex_book_button3_off = pIcons_LOD->LoadTexturePtr("tab-an-1a", TEXTURE_16BIT_PALETTE); | |
504 pTex_book_button4_on = pIcons_LOD->LoadTexturePtr("tab-an-2b", TEXTURE_16BIT_PALETTE); | |
505 pTex_book_button4_off = pIcons_LOD->LoadTexturePtr("tab-an-2a", TEXTURE_16BIT_PALETTE); | |
506 pTex_book_button5_on = pIcons_LOD->LoadTexturePtr("tab-an-3b", TEXTURE_16BIT_PALETTE); | |
507 pTex_book_button5_off = pIcons_LOD->LoadTexturePtr("tab-an-3a", TEXTURE_16BIT_PALETTE); | |
508 pTex_book_button6_on = pIcons_LOD->LoadTexturePtr("tab-an-5b", TEXTURE_16BIT_PALETTE); | |
509 pTex_book_button6_off = pIcons_LOD->LoadTexturePtr("tab-an-5a", TEXTURE_16BIT_PALETTE); | |
510 pTex_book_button7_on = pIcons_LOD->LoadTexturePtr("tab-an-4b", TEXTURE_16BIT_PALETTE); | |
511 pTex_book_button7_off = pIcons_LOD->LoadTexturePtr("tab-an-4a", TEXTURE_16BIT_PALETTE); | |
512 pTex_book_button8_on = pIcons_LOD->LoadTexturePtr("tab-an-8b", TEXTURE_16BIT_PALETTE); | |
513 pTex_book_button8_off = pIcons_LOD->LoadTexturePtr("tab-an-8a", TEXTURE_16BIT_PALETTE); | |
948 | 514 |
1453 | 515 pBtn_Book_1 = this->CreateButton(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 1, 50, 34, 1, 0, |
516 UIMSG_ClickBooksBtn, 11, 0, pGlobalTXT_LocalizationStrings[193], pTex_book_button1_on, 0); | |
517 pBtn_Book_2 = this->CreateButton(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 38, 50, 34, 1, 0, | |
518 UIMSG_ClickBooksBtn, 10, 0, pGlobalTXT_LocalizationStrings[192], pTex_book_button2_on, 0); | |
519 pBtn_Book_3 = this->CreateButton(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 113, 50, 34, 1, 0, | |
520 UIMSG_ClickBooksBtn, 2, 0, pGlobalTXT_LocalizationStrings[85], pTex_book_button3_on, 0); // "Potion Notes" | |
521 pBtn_Book_4 = this->CreateButton(pViewport->uViewportTL_X + 399, pViewport->uViewportTL_Y + 150, 50, 34, 1, 0, | |
522 UIMSG_ClickBooksBtn, 3, 0, pGlobalTXT_LocalizationStrings[137], pTex_book_button4_on, 0); // "Fountain Notes" | |
523 pBtn_Book_5 = this->CreateButton(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 188, 50, 34, 1, 0, | |
524 UIMSG_ClickBooksBtn, 4, 0, pGlobalTXT_LocalizationStrings[8], pTex_book_button5_on, 0); // "Obelisk Notes" | |
525 pBtn_Book_6 = this->CreateButton(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 226, 50, 34, 1, 0, | |
526 UIMSG_ClickBooksBtn, 5, 0, pGlobalTXT_LocalizationStrings[141], pTex_book_button6_on, 0); // "Seer Notes" | |
527 pBtn_Autonotes_Misc = this->CreateButton(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 264, 50, 34, 1, 0, | |
528 UIMSG_ClickBooksBtn, 6, 0, pGlobalTXT_LocalizationStrings[123], pTex_book_button7_on, 0); // "Miscellaneous Notes" | |
529 pBtn_Autonotes_Instructors = this->CreateButton(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 302, 50, 34, 1, 0, | |
530 UIMSG_ClickBooksBtn, 7, 0, pGlobalTXT_LocalizationStrings[662], pTex_book_button8_on, 0); // "Instructors" | |
948 | 531 |
949 | 532 num_achieved_awards = 0; |
1453 | 533 for ( uint i = books_primary_item_per_page; i < 196; ++i ) |
534 { | |
535 if ( _506568_autonote_type == pAutonoteTxt[i].eType)//dword_72371C[2 * v10] ) | |
536 { | |
537 if ( i ) | |
538 { | |
539 if ( _449B57_test_bit(pParty->_autonote_bits, i) && pAutonoteTxt[i].pText ) | |
540 { | |
541 achieved_awards[num_achieved_awards] = (AwardType)i; | |
542 ++num_achieved_awards; | |
543 } | |
544 } | |
545 } | |
546 } | |
547 full_num_items_in_book = num_achieved_awards; | |
548 num_achieved_awards = 0; | |
549 } | |
550 break; | |
1310 | 551 |
1453 | 552 case WINDOW_MapsBook: |
553 { | |
688 | 554 dword_506364 = 1; |
948 | 555 pSpellBookPagesTextr_12 = pIcons_LOD->LoadTexturePtr("sbmap", TEXTURE_16BIT_PALETTE); |
1453 | 556 pTex_book_button1_on = pIcons_LOD->LoadTexturePtr("zoom-on", TEXTURE_16BIT_PALETTE); |
557 pTex_book_button2_on = pIcons_LOD->LoadTexturePtr("zoot-on", TEXTURE_16BIT_PALETTE); | |
558 pTex_book_button1_off = pIcons_LOD->LoadTexturePtr("zoom-off", TEXTURE_16BIT_PALETTE); | |
559 pTex_book_button2_off = pIcons_LOD->LoadTexturePtr("zoot-off", TEXTURE_16BIT_PALETTE); | |
560 pTex_book_button3_on = pIcons_LOD->LoadTexturePtr("tabNon", TEXTURE_16BIT_PALETTE); | |
561 pTex_book_button3_off = pIcons_LOD->LoadTexturePtr("tabNoff", TEXTURE_16BIT_PALETTE); | |
562 pTex_book_button4_on = pIcons_LOD->LoadTexturePtr("tabSon", TEXTURE_16BIT_PALETTE); | |
563 pTex_book_button4_off = pIcons_LOD->LoadTexturePtr("tabSoff", TEXTURE_16BIT_PALETTE); | |
564 pTex_book_button5_on = pIcons_LOD->LoadTexturePtr("tabEon", TEXTURE_16BIT_PALETTE); | |
565 pTex_book_button5_off = pIcons_LOD->LoadTexturePtr("tabEoff", TEXTURE_16BIT_PALETTE); | |
566 pTex_book_button6_on = pIcons_LOD->LoadTexturePtr("tabWon", TEXTURE_16BIT_PALETTE); | |
567 pTex_book_button6_off = pIcons_LOD->LoadTexturePtr("tabWoff", TEXTURE_16BIT_PALETTE); | |
948 | 568 |
1453 | 569 pBtn_Book_1 = this->CreateButton(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 1, 50, 34, 1, 0, |
570 UIMSG_ClickBooksBtn, 0, 0, pGlobalTXT_LocalizationStrings[251], pTex_book_button1_on, 0);// "Zoom In" | |
571 pBtn_Book_2 = this->CreateButton(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 38, 50, 34, 1, 0, | |
572 UIMSG_ClickBooksBtn, 1, 0, pGlobalTXT_LocalizationStrings[252], pTex_book_button2_on, 0);// "Zoom Out" | |
573 pBtn_Book_3 = this->CreateButton(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 113, 50, 34, 1, 0, | |
1310 | 574 UIMSG_ClickBooksBtn, 2, 0, pGlobalTXT_LocalizationStrings[192], (Texture *)"", 0);// Scroll Up |
1453 | 575 pBtn_Book_4 = this->CreateButton(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 150, 50, 34, 1, 0, |
1310 | 576 UIMSG_ClickBooksBtn, 3, 0, pGlobalTXT_LocalizationStrings[193], (Texture *)"", 0);// Scroll Down |
1453 | 577 pBtn_Book_5 = this->CreateButton(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 188, 50, 34, 1, 0, |
1310 | 578 UIMSG_ClickBooksBtn, 4, 0, pGlobalTXT_LocalizationStrings[573], (Texture *)"", 0);// "Scroll Right" |
1453 | 579 pBtn_Book_6 = this->CreateButton(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 226, 50, 34, 1, 0, |
1310 | 580 UIMSG_ClickBooksBtn, 5, 0, pGlobalTXT_LocalizationStrings[572], (Texture *)"", 0);// "Scroll Left" |
1453 | 581 } |
582 break; | |
948 | 583 |
1453 | 584 case WINDOW_CalendarBook: |
585 { | |
948 | 586 pSpellBookPagesTextr_13 = pIcons_LOD->LoadTexturePtr("sbdate-time", TEXTURE_16BIT_PALETTE); |
587 pTex_moon_new = pIcons_LOD->LoadTexturePtr("moon_new", TEXTURE_16BIT_PALETTE); | |
588 pTex_moon_4 = pIcons_LOD->LoadTexturePtr("moon_4", TEXTURE_16BIT_PALETTE); | |
589 pTex_moon_2 = pIcons_LOD->LoadTexturePtr("moon_2", TEXTURE_16BIT_PALETTE); | |
590 pTex_moon_2_2 = pIcons_LOD->LoadTexturePtr("moon_2", TEXTURE_16BIT_PALETTE); | |
591 pTex_moon_ful = pIcons_LOD->LoadTexturePtr("moon_ful", TEXTURE_16BIT_PALETTE); | |
1453 | 592 } |
593 break; | |
948 | 594 |
1453 | 595 case WINDOW_JournalBook: |
596 { | |
948 | 597 pSpellBookPagesTextr_11 = pIcons_LOD->LoadTexturePtr("sbplayrnot", TEXTURE_16BIT_PALETTE); |
1453 | 598 pTex_book_button1_on = pIcons_LOD->LoadTexturePtr("tab-an-6b", TEXTURE_16BIT_PALETTE); |
599 pTex_book_button2_on = pIcons_LOD->LoadTexturePtr("tab-an-7b", TEXTURE_16BIT_PALETTE); | |
600 pTex_book_button1_off = pIcons_LOD->LoadTexturePtr("tab-an-6a", TEXTURE_16BIT_PALETTE); | |
601 pTex_book_button2_off = pIcons_LOD->LoadTexturePtr("tab-an-7a", TEXTURE_16BIT_PALETTE); | |
948 | 602 |
1453 | 603 pBtn_Book_1 = this->CreateButton(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 1, |
604 pTex_book_button1_on->uTextureWidth, pTex_book_button1_on->uTextureHeight, 1, 0, | |
605 UIMSG_ClickBooksBtn, 11, 0, pGlobalTXT_LocalizationStrings[192], pTex_book_button1_on, 0); | |
606 pBtn_Book_2 = this->CreateButton(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 38, pTex_book_button2_on->uTextureHeight, | |
607 pTex_book_button2_on->uTextureHeight, 1, 0, UIMSG_ClickBooksBtn, 10, 0, | |
608 pGlobalTXT_LocalizationStrings[193], pTex_book_button2_on, 0); | |
948 | 609 |
949 | 610 num_achieved_awards = 0; |
1453 | 611 journal_window.uFrameX = 48; |
612 journal_window.uFrameY = 70; | |
613 journal_window.uFrameWidth = 360; | |
614 journal_window.uFrameHeight = 264; | |
615 journal_window.uFrameZ = 407; | |
616 journal_window.uFrameHeight = (LOBYTE(pAutonoteFont->uFontHeight) - 3) * 264 / LOBYTE(pAutonoteFont->uFontHeight) - 3; | |
617 journal_window.uFrameW = journal_window.uFrameHeight + 69; | |
949 | 618 memset(&achieved_awards, 0, 4000); |
1453 | 619 memset(Journal_limitation_factor.data(), 0, 100); |
1446 | 620 if ( books_primary_item_per_page < 29 ) |
1453 | 621 { |
622 for ( int i = books_primary_item_per_page; i < books_primary_item_per_page + 31; i++ ) | |
623 { | |
1747
cecb080929c4
Party_stru0 renamed to PartyTimeStruct, fixed its members, renamed Party::field_3C to Party::PartyTimes, started Player::SetVariable refactoring start
Grumpy7
parents:
1709
diff
changeset
|
624 if ( pParty->PartyTimes.HistoryEventTimes[i] > 0 ) |
688 | 625 { |
1453 | 626 if ( pStorylineText->StoreLine[i + 1].pText ) |
627 { | |
1747
cecb080929c4
Party_stru0 renamed to PartyTimeStruct, fixed its members, renamed Party::field_3C to Party::PartyTimes, started Player::SetVariable refactoring start
Grumpy7
parents:
1709
diff
changeset
|
628 pString = BuildDialogueString(pStorylineText->StoreLine[i + 1].pText, uActiveCharacter - 1, 0, 0, 0, &pParty->PartyTimes.HistoryEventTimes[i]); |
1453 | 629 pTextHeight = pAutonoteFont->CalcTextHeight(pString, &journal_window, 1, 0); |
630 page_count = ((pTextHeight - (pAutonoteFont->uFontHeight - 3)) / (signed int)journal_window.uFrameHeight) + 1; | |
631 memset32((char *)&achieved_awards[num_achieved_awards] , i + 1, page_count); | |
632 for ( uint j = 0; j <= page_count - 1; ++j ) | |
633 Journal_limitation_factor[num_achieved_awards++] = j; | |
634 } | |
688 | 635 } |
1453 | 636 } |
688 | 637 } |
1453 | 638 full_num_items_in_book = num_achieved_awards; |
639 num_achieved_awards = 0; | |
640 } | |
641 break; | |
642 } | |
0 | 643 } |
644 | |
645 //----- (00415551) -------------------------------------------------------- | |
646 void GUIWindow::DrawMessageBox(int arg0) | |
647 { | |
648 unsigned int v2; // edi@1 | |
649 GUIWindow *v3; // ebx@1 | |
650 signed int v4; // esi@2 | |
651 unsigned int v5; // eax@2 | |
652 unsigned int v6; // edx@4 | |
653 unsigned int v7; // ecx@6 | |
654 unsigned int v8; // eax@9 | |
655 __int32 v9; // eax@10 | |
656 unsigned int v10; // eax@18 | |
657 LONG v11; // ecx@18 | |
658 unsigned int v12; // edx@18 | |
659 unsigned int v13; // eax@18 | |
660 const char *v14; // ecx@18 | |
661 int v15; // eax@19 | |
662 unsigned int v16; // esi@19 | |
663 const char *v17; // ebx@25 | |
664 int v18; // eax@26 | |
665 GUIWindow v19; // [sp+Ch] [bp-60h]@18 | |
666 POINT a2; // [sp+60h] [bp-Ch]@8 | |
667 unsigned int v21; // [sp+68h] [bp-4h]@18 | |
668 unsigned int v22; // [sp+74h] [bp+8h]@2 | |
669 unsigned int v23; // [sp+74h] [bp+8h]@18 | |
670 | |
671 v2 = 0; | |
672 v3 = this; | |
673 if ( arg0 ) | |
674 { | |
693 | 675 v4 = pViewport->uViewportTL_X; |
676 v5 = pViewport->uViewportBR_X; | |
677 v2 = pViewport->uViewportTL_Y; | |
678 v22 = pViewport->uViewportBR_Y; | |
0 | 679 } |
680 else | |
681 { | |
682 v4 = 0; | |
683 v5 = 640; | |
684 v22 = 480; | |
685 } | |
686 v6 = this->uFrameX; | |
687 if ( (signed int)this->uFrameX >= v4 ) | |
688 { | |
689 v7 = this->uFrameWidth; | |
690 if ( (signed int)(v7 + v6) <= (signed int)v5 ) | |
691 goto LABEL_9; | |
692 v3->uFrameX = v5 - v7; | |
693 } | |
694 else | |
695 { | |
696 this->uFrameX = v4; | |
697 } | |
698 v3->uFrameY = pMouse->GetCursorPos(&a2)->y + 30; | |
699 LABEL_9: | |
700 v8 = v3->uFrameY; | |
701 if ( (signed int)v8 >= (signed int)v2 ) | |
702 { | |
703 if ( (signed int)(v8 + v3->uFrameHeight) <= (signed int)v22 ) | |
704 goto LABEL_14; | |
705 v9 = pMouse->GetCursorPos(&a2)->y - v3->uFrameHeight - 30; | |
706 } | |
707 else | |
708 { | |
709 v9 = pMouse->GetCursorPos(&a2)->y + 30; | |
710 } | |
711 v3->uFrameY = v9; | |
712 LABEL_14: | |
713 if ( (signed int)v3->uFrameY < (signed int)v2 ) | |
714 v3->uFrameY = v2; | |
715 if ( (signed int)v3->uFrameX < v4 ) | |
716 v3->uFrameX = v4; | |
717 v10 = v3->uFrameWidth; | |
718 v11 = v3->uFrameX; | |
719 v12 = v3->uFrameY; | |
720 v21 = v10; | |
721 a2.y = v11; | |
722 v3->uFrameZ = v10 + v11 - 1; | |
723 v13 = v3->uFrameHeight; | |
724 v3->uFrameW = v13 + v12 - 1; | |
725 memcpy(&v19, v3, sizeof(v19)); | |
726 v19.uFrameX += 12; | |
727 v19.uFrameWidth -= 24; | |
728 v19.uFrameY += 12; | |
729 v19.uFrameHeight -= 12; | |
730 v19.uFrameZ = v19.uFrameWidth + v19.uFrameX - 1; | |
731 v23 = v12; | |
732 v19.uFrameW = v19.uFrameHeight + v19.uFrameY - 1; | |
733 v14 = v3->Hint; | |
734 if ( v14 ) | |
735 { | |
736 v15 = pFontLucida->CalcTextHeight(v14, &v19, 0, 0); | |
737 v12 = v23; | |
738 v16 = v15 + 24; | |
739 } | |
740 else | |
741 { | |
742 v16 = v13; | |
743 } | |
744 if ( (signed int)v16 < 64 ) | |
745 v16 = 64; | |
746 if ( (signed int)(v16 + v12) > 479 ) | |
747 v16 = 479 - v12; | |
748 DrawPopupWindow(a2.y, v12, v21, v16); | |
749 v17 = v3->Hint; | |
750 if ( v17 ) | |
751 { | |
752 v18 = pFontLucida->CalcTextHeight(v17, &v19, 0, 0); | |
1004 | 753 v19.DrawTitleText(pFontLucida, 0, (signed int)(v16 - v18) / 2 - 14, 0, v17, 3); |
0 | 754 } |
755 } | |
756 | |
757 | |
758 | |
759 | |
760 //----- (00411B59) -------------------------------------------------------- | |
761 void __fastcall LoadThumbnailLloydTexture(unsigned int uSlot, unsigned int uPlayer) | |
762 { | |
763 unsigned int v2; // esi@1 | |
764 unsigned int v3; // edi@1 | |
765 FILE *v4; // ebx@1 | |
766 FILE *v5; // eax@2 | |
767 char pContainerName[64]; // [sp+Ch] [bp-44h]@1 | |
768 unsigned int v7; // [sp+4Ch] [bp-4h]@1 | |
769 | |
770 v2 = uSlot; | |
771 v7 = uPlayer; | |
772 v3 = uSlot + 1; | |
773 sprintf(pContainerName, "data\\lloyd%d%d.pcx", uPlayer, uSlot + 1); | |
774 v4 = fopen(pContainerName, "rb"); | |
775 if ( v4 ) | |
776 { | |
777 pSavegameThumbnails[v2].LoadFromFILE(v4, 0, 1u); | |
778 fclose(v4); | |
779 } | |
780 else | |
781 { | |
782 sprintf(pContainerName, "lloyd%d%d.pcx", v7, v3); | |
783 v5 = pNew_LOD->FindContainer(pContainerName, 1); | |
784 if ( v5 ) | |
785 pSavegameThumbnails[v2].LoadFromFILE(v5, 0, 0); | |
786 else | |
1206
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
787 *((int *)&pSavegameThumbnails.data()->pPixels + 10 * v2) = 0; |
0 | 788 } |
789 } | |
790 | |
791 | |
792 //----- (00411621) -------------------------------------------------------- | |
198 | 793 void GUIWindow::OpenSpellBook() |
0 | 794 { |
11 | 795 Player *pPlayer; // edi@1 |
198 | 796 //GUIWindow *pWindow; // esi@1 |
797 //unsigned int v3; // ebp@1 | |
0 | 798 int v4; // eax@3 |
198 | 799 ///GUIButton *result; // eax@25 |
0 | 800 int a2; // [sp+10h] [bp-8h]@1 |
198 | 801 //int v7; // [sp+14h] [bp-4h]@1 |
0 | 802 |
11 | 803 pPlayer = pPlayers[uActiveCharacter]; |
198 | 804 //pWindow = this; |
805 LoadSpellbook(pPlayer->lastOpenedSpellbookPage); | |
806 //v3 = 0; | |
0 | 807 a2 = 0; |
198 | 808 |
809 auto chapter = &pPlayer->spellbook.pChapters[pPlayer->lastOpenedSpellbookPage]; | |
810 for (uint i = 0; i < 11; ++i) | |
0 | 811 { |
198 | 812 if (!chapter->bIsSpellAvailable[i]) |
813 continue; | |
363 | 814 v4= pPlayer->lastOpenedSpellbookPage; |
815 //v4 = (12 * pPlayer->lastOpenedSpellbookPage + pSpellbookSpellIndices[pPlayer->lastOpenedSpellbookPage][i + 1]); | |
693 | 816 CreateButton(pViewport->uViewportTL_X + pIconPos[v4][pSpellbookSpellIndices[v4][i+1]].Xpos, |
817 pViewport->uViewportTL_Y + pIconPos[v4][pSpellbookSpellIndices[v4][i+1]].Ypos, //dword_4E20D0 | |
1402 | 818 SBPageSSpellsTextureList[i + 1]->uTextureWidth, |
819 SBPageSSpellsTextureList[i + 1]->uTextureHeight, | |
832 | 820 1, 79, UIMSG_SelectSpell, i, 0, "", 0); |
0 | 821 ++a2; |
198 | 822 //++v3; |
0 | 823 } |
198 | 824 //while ( (signed int)v3 < 11 ); |
825 | |
1118 | 826 CreateButton(0, 0, 0, 0, 1, 0, UIMSG_SpellBook_PressTab, 0, '\t', "", 0); |
0 | 827 if ( a2 ) |
972 | 828 _41D08F_set_keyboard_control_group(a2, 0, 0, 0); |
948 | 829 |
830 if (pPlayer->pActiveSkills[PLAYER_SKILL_FIRE]) CreateButton(399, 10, 50, 36, 1, 0, UIMSG_OpenSpellbookPage, 0, 0, aSpellSchoolNames[0], 0); | |
831 if (pPlayer->pActiveSkills[PLAYER_SKILL_AIR]) CreateButton(399, 46, 50, 36, 1, 0, UIMSG_OpenSpellbookPage, 1, 0, aSpellSchoolNames[1], 0); | |
832 if (pPlayer->pActiveSkills[PLAYER_SKILL_WATER]) CreateButton(399, 83, 50, 36, 1, 0, UIMSG_OpenSpellbookPage, 2, 0, aSpellSchoolNames[2], 0); | |
833 if (pPlayer->pActiveSkills[PLAYER_SKILL_EARTH]) CreateButton(399, 121, 50, 36, 1, 0, UIMSG_OpenSpellbookPage, 3, 0, aSpellSchoolNames[3], 0); | |
834 if (pPlayer->pActiveSkills[PLAYER_SKILL_SPIRIT]) CreateButton(399, 158, 50, 36, 1, 0, UIMSG_OpenSpellbookPage, 4, 0, aSpellSchoolNames[4], 0); | |
835 if (pPlayer->pActiveSkills[PLAYER_SKILL_MIND]) CreateButton(400, 196, 50, 36, 1, 0, UIMSG_OpenSpellbookPage, 5, 0, aSpellSchoolNames[5], 0); | |
836 if (pPlayer->pActiveSkills[PLAYER_SKILL_BODY]) CreateButton(400, 234, 50, 36, 1, 0, UIMSG_OpenSpellbookPage, 6, 0, aSpellSchoolNames[6], 0); | |
837 if (pPlayer->pActiveSkills[PLAYER_SKILL_LIGHT]) CreateButton(400, 271, 50, 36, 1, 0, UIMSG_OpenSpellbookPage, 7, 0, aSpellSchoolNames[7], 0); | |
838 if (pPlayer->pActiveSkills[PLAYER_SKILL_DARK]) CreateButton(400, 307, 50, 36, 1, 0, UIMSG_OpenSpellbookPage, 8, 0, aSpellSchoolNames[8], 0); | |
839 | |
1402 | 840 CreateButton(476, 450, pSBClickQuickSpellBtnTextr->uTextureWidth, pSBClickQuickSpellBtnTextr->uTextureHeight, 1, 78, UIMSG_ClickInstallRemoveQuickSpellBtn, 0, 0, "", 0); |
841 pBtn_InstallRemoveSpell = CreateButton(476, 450, 48, 32, 1, 78, UIMSG_ClickInstallRemoveQuickSpellBtn, 0, 0, "", pSBClickQuickSpellBtnTextr, 0); | |
842 CreateButton(561, 450, pSpellBookClickCloseBtnTextr->uTextureWidth, pSpellBookClickCloseBtnTextr->uTextureHeight, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[79], 0); | |
843 pBtn_CloseBook = CreateButton(561, 450, 48, 32, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[79], pSpellBookClickCloseBtnTextr, 0); | |
0 | 844 } |
845 // 50640C: using guessed type int dword_50640C[]; | |
846 | |
847 //----- (004B3157) -------------------------------------------------------- | |
405 | 848 void GUIWindow::HouseDialogManager() |
0 | 849 { |
854 | 850 unsigned __int16 pWhiteColor; // di@2 |
851 const char *pHouseName; // edx@4 | |
0 | 852 signed int v3; // edx@5 |
853 char *v4; // edi@9 | |
854 | 854 int pTextHeight; // eax@45 |
0 | 855 int v6; // edi@45 |
856 char *v7; // eax@45 | |
857 int v8; // edi@46 | |
858 int v9; // eax@50 | |
859 unsigned int v10; // [sp-10h] [bp-C8h]@53 | |
873 | 860 char *pTitleText; // [sp-8h] [bp-C0h]@50 |
854 | 861 GUIWindow pDialogWindow; // [sp+Ch] [bp-ACh]@4 |
862 GUIWindow pWindow; // [sp+60h] [bp-58h]@2 | |
863 int pColor2; // [sp+B4h] [bp-4h]@2 | |
0 | 864 |
336 | 865 if ( !window_SpeakInHouse ) |
0 | 866 return; |
854 | 867 memcpy(&pWindow, this, sizeof(pWindow)); |
868 pWindow.uFrameWidth -= 18; | |
869 pWindow.uFrameZ -= 18; | |
949 | 870 pWhiteColor = TargetColor(0xFFu, 0xFFu, 0xFFu); |
871 pColor2 = TargetColor(0x15u, 0x99u, 0xE9u); | |
0 | 872 pRenderer->DrawTextureIndexed(0x1DDu, 0, pTexture_Dialogue_Background); |
910 | 873 pRenderer->DrawTextureTransparent(0x1D4u, 0, &pIcons_LOD->pTextures[uTextureID_right_panel_loop]); |
457 | 874 if ( pDialogueNPCCount != uNumDialogueNPCPortraits || !uHouse_ExitPic ) |
0 | 875 { |
854 | 876 pDialogWindow.uFrameWidth = 130; |
877 pDialogWindow.uFrameHeight = 2 * LOBYTE(pFontCreate->uFontHeight); | |
878 pHouseName = p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].pName; | |
879 if ( pHouseName ) | |
0 | 880 { |
854 | 881 v3 = 2 * LOBYTE(pFontCreate->uFontHeight) - 6 - pFontCreate->CalcTextHeight(pHouseName, &pDialogWindow, 0, 0); |
0 | 882 if ( v3 < 0 ) |
883 v3 = 0; | |
854 | 884 pWindow.DrawTitleText(pFontCreate, 0x1EAu, v3 / 2 + 4, pWhiteColor, |
0 | 885 //(const char *)p2DEvents_minus1_::04[13 * (unsigned int)ptr_507BC0->ptr_1C], |
336 | 886 p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].pName, 3); |
0 | 887 } |
888 } | |
854 | 889 pWindow.uFrameWidth += 8; |
890 pWindow.uFrameZ += 8; | |
457 | 891 if ( !pDialogueNPCCount ) |
0 | 892 { |
1411 | 893 if ( in_current_building_type == BuildingType_Jail ) |
0 | 894 { |
480 | 895 JailDialog(); |
854 | 896 if ( pDialogueNPCCount == uNumDialogueNPCPortraits && uHouse_ExitPic ) |
897 { | |
898 pRenderer->DrawTextureIndexed(556, 451, &pIcons_LOD->pTextures[uTextureID_x_x_u]); | |
899 pRenderer->DrawTextureIndexed(476, 451, &pIcons_LOD->pTextures[uTextureID_x_ok_u]); | |
900 } | |
901 else | |
902 { | |
903 pRenderer->DrawTextureIndexed(471, 445, &pIcons_LOD->pTextures[uExitCancelTextureId]); | |
904 } | |
905 return; | |
0 | 906 } |
827 | 907 if ( current_npc_text ) |
0 | 908 { |
854 | 909 pDialogWindow.uFrameWidth = 458; |
910 pDialogWindow.uFrameZ = 457; | |
911 pTextHeight = pFontArrus->CalcTextHeight(current_npc_text, &pDialogWindow, 13, 0); | |
912 v6 = pTextHeight + 7; | |
1496 | 913 pRenderer->GetLeather(8, 352 - (pTextHeight + 7), &pIcons_LOD->pTextures[uTextureID_Leather], |
854 | 914 pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight - (pTextHeight + 7)); |
915 pRenderer->DrawTextureIndexed(8, 347 - v6, pTexture_591428); | |
916 v7 = FitTextInAWindow(current_npc_text, pFontArrus, &pDialogWindow, 0xDu, 0); | |
336 | 917 window_SpeakInHouse->DrawText(pFontArrus, 13, 354 - v6, 0, v7, 0, 0, 0); |
0 | 918 } |
919 if ( uNumDialogueNPCPortraits <= 0 ) | |
854 | 920 { |
921 if ( pDialogueNPCCount == uNumDialogueNPCPortraits && uHouse_ExitPic ) | |
922 { | |
923 pRenderer->DrawTextureIndexed(556, 451, &pIcons_LOD->pTextures[uTextureID_x_x_u]); | |
924 pRenderer->DrawTextureIndexed(476, 451, &pIcons_LOD->pTextures[uTextureID_x_ok_u]); | |
925 } | |
926 else | |
927 { | |
928 pRenderer->DrawTextureIndexed(471, 445, &pIcons_LOD->pTextures[uExitCancelTextureId]); | |
929 } | |
930 return; | |
931 } | |
873 | 932 for ( v8 = 0; v8 < uNumDialogueNPCPortraits; ++v8 ) |
0 | 933 { |
419 | 934 pRenderer->DrawTextureIndexed(pNPCPortraits_x[uNumDialogueNPCPortraits - 1][v8] - 4, |
874 | 935 pNPCPortraits_y[uNumDialogueNPCPortraits - 1][v8] - 4, &pIcons_LOD->pTextures[uTextureID_50795C]); |
419 | 936 pRenderer->DrawTextureIndexed(pNPCPortraits_x[uNumDialogueNPCPortraits - 1][v8], |
937 pNPCPortraits_y[uNumDialogueNPCPortraits - 1][v8], pDialogueNPCPortraits[v8]); | |
0 | 938 if ( uNumDialogueNPCPortraits < 4 ) |
854 | 939 { |
873 | 940 if ( v8 + 1 == uNumDialogueNPCPortraits && uHouse_ExitPic ) |
854 | 941 { |
873 | 942 pTitleText = pMapStats->pInfos[uHouse_ExitPic].pName; |
943 v9 = 94 * v8 + 113; | |
854 | 944 } |
945 else | |
946 { | |
873 | 947 if ( !v8 && dword_591080 ) |
948 { | |
949 pTitleText = (char *)p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].pProprieterTitle; | |
950 pWindow.DrawTitleText(pFontCreate, 0x1E3u, 113, pColor2, pTitleText, 3); | |
951 continue; | |
952 } | |
1211 | 953 pTitleText = HouseNPCData[v8 +1 - (dword_591080 != 0)]->pName; |
954 v9 = pNPCPortraits_y[uNumDialogueNPCPortraits - 1][v8] + pDialogueNPCPortraits[v8]->uTextureHeight + 2; | |
854 | 955 } |
873 | 956 v10 = v9; |
1211 | 957 pWindow.DrawTitleText(pFontCreate, 483, v10, pColor2, pTitleText, 3); |
854 | 958 } |
874 | 959 } |
873 | 960 if ( pDialogueNPCCount == uNumDialogueNPCPortraits && uHouse_ExitPic ) |
0 | 961 { |
873 | 962 pRenderer->DrawTextureIndexed(556, 451, &pIcons_LOD->pTextures[uTextureID_x_x_u]); |
963 pRenderer->DrawTextureIndexed(476, 451, &pIcons_LOD->pTextures[uTextureID_x_ok_u]); | |
0 | 964 } |
873 | 965 else |
966 { | |
967 pRenderer->DrawTextureIndexed(471, 445, &pIcons_LOD->pTextures[uExitCancelTextureId]); | |
968 } | |
969 return; | |
0 | 970 } |
457 | 971 v4 = (char *)pDialogueNPCCount - 1; |
419 | 972 pRenderer->DrawTextureIndexed(pNPCPortraits_x[0][0] - 4, pNPCPortraits_y[0][0] - 4, &pIcons_LOD->pTextures[uTextureID_50795C]); |
973 pRenderer->DrawTextureIndexed(pNPCPortraits_x[0][0], pNPCPortraits_y[0][0], pDialogueNPCPortraits[(signed int)v4]); | |
151 | 974 if ( pCurrentScreen == SCREEN_E ) |
0 | 975 { |
984 | 976 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); |
854 | 977 if ( pDialogueNPCCount == uNumDialogueNPCPortraits && uHouse_ExitPic ) |
978 { | |
979 pRenderer->DrawTextureIndexed(556, 451, &pIcons_LOD->pTextures[uTextureID_x_x_u]); | |
980 pRenderer->DrawTextureIndexed(476, 451, &pIcons_LOD->pTextures[uTextureID_x_ok_u]); | |
981 } | |
982 else | |
983 { | |
984 pRenderer->DrawTextureIndexed(471, 445, &pIcons_LOD->pTextures[uExitCancelTextureId]); | |
985 } | |
986 return; | |
0 | 987 } |
1634 | 988 if ( v4 || !dword_591080 )//íà èçóìðóäíîì îñòðîâå çàõîäèò íà êîðàáëå ïîêà íå âûïîëíåíû êâåñòû |
0 | 989 { |
1634 | 990 SimpleHouseDialog(); |
0 | 991 } |
992 else | |
993 { | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
994 sprintfex( pTmpBuf.data(), pGlobalTXT_LocalizationStrings[429], |
336 | 995 p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].pProprieterName, |
996 p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].pProprieterTitle); | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
997 pWindow.DrawTitleText(pFontCreate, 0x1E3u, 0x71u, pColor2, pTmpBuf.data(), 3); |
484 | 998 switch ( in_current_building_type ) |
0 | 999 { |
1411 | 1000 case BuildingType_WeaponShop: |
405 | 1001 WeaponShopDialog(); |
0 | 1002 break; |
1411 | 1003 case BuildingType_ArmorShop: |
405 | 1004 ArmorShopDialog(); |
0 | 1005 break; |
1411 | 1006 case BuildingType_MagicShop: |
405 | 1007 MagicShopDialog(); |
0 | 1008 break; |
1411 | 1009 case BuildingType_AlchemistShop: |
405 | 1010 AlchemistDialog(); |
0 | 1011 break; |
1411 | 1012 case BuildingType_FireGuild: |
1013 case BuildingType_AirGuild: | |
1014 case BuildingType_WaterGuild: | |
1015 case BuildingType_EarthGuild: | |
1016 case BuildingType_SpiritGuild: | |
1017 case BuildingType_MindGuild: | |
1018 case BuildingType_BodyGuild: | |
1019 case BuildingType_LightGuild: | |
1020 case BuildingType_DarkGuild: | |
480 | 1021 GuildDialog(); |
1022 break; | |
1411 | 1023 case BuildingType_18: |
987 | 1024 __debugbreak(); //What over the dialog? |
480 | 1025 sub_4B6478(); |
1026 break; | |
1411 | 1027 case BuildingType_TownHall: |
480 | 1028 TownHallDialog(); |
1029 break; | |
1411 | 1030 case BuildingType_Tavern: |
480 | 1031 TavernDialog(); |
1032 break; | |
1411 | 1033 case BuildingType_Bank: |
480 | 1034 BankDialog(); |
1035 break; | |
1411 | 1036 case BuildingType_Temple: |
495 | 1037 TempleDialog(); |
480 | 1038 break; |
1411 | 1039 case BuildingType_Stables: |
1591 | 1040 case BuildingType_Boats: |
480 | 1041 TravelByTransport(); |
1042 break; | |
1411 | 1043 case BuildingType_Training: |
480 | 1044 TrainingDialog(); |
1045 break; | |
1411 | 1046 case BuildingType_Jail: |
480 | 1047 JailDialog(); |
1048 break; | |
0 | 1049 default: |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1411
diff
changeset
|
1050 //__debugbreak();//New BuildingType (if enter Boat) |
0 | 1051 break; |
1052 } | |
1053 } | |
457 | 1054 if ( pDialogueNPCCount == uNumDialogueNPCPortraits && uHouse_ExitPic ) |
0 | 1055 { |
370 | 1056 pRenderer->DrawTextureIndexed(556, 451, &pIcons_LOD->pTextures[uTextureID_x_x_u]); |
1057 pRenderer->DrawTextureIndexed(476, 451, &pIcons_LOD->pTextures[uTextureID_x_ok_u]); | |
0 | 1058 } |
1059 else | |
1060 { | |
526 | 1061 pRenderer->DrawTextureIndexed(471, 445, &pIcons_LOD->pTextures[uExitCancelTextureId]); |
0 | 1062 } |
1063 } | |
1064 | |
1065 //----- (004B1854) -------------------------------------------------------- | |
1758
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1066 void GUIWindow::DrawShops_next_generation_time_string( __int64 next_generation_time ) |
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1067 { |
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1068 unsigned int full_time; // esi@1 |
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1069 signed __int64 hours; // kr00_8@1 |
1838 | 1070 const char *text; // eax@2 |
1758
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1071 signed __int64 minutes; // [sp+Ch] [bp-10h]@1 |
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1072 signed __int64 seconds; // [sp+14h] [bp-8h]@1 |
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1073 unsigned int days; // [sp+20h] [bp+4h]@1 |
0 | 1074 |
1758
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1075 full_time = (signed __int64)((double)next_generation_time * 0.234375); |
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1076 seconds = (signed __int64)full_time % 60; |
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1077 minutes = (signed __int64)(full_time / 60) % 60; |
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1078 hours = ((full_time / 60) / 60) % 24; |
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1079 days = (unsigned int)((full_time / 60) / 60) / 24; |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
1080 strcpy(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[532]); |
1758
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1081 if ( days ) |
0 | 1082 { |
1758
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1083 text = pGlobalTXT_LocalizationStrings[57];//Days |
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1084 if ( days <= 1 ) |
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1085 text = pGlobalTXT_LocalizationStrings[56];//Day |
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1086 sprintfex(pTmpBuf2.data(), "%d %s ", days, text); |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
1087 strcat(pTmpBuf.data(), pTmpBuf2.data()); |
0 | 1088 } |
1758
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1089 if ( hours ) |
0 | 1090 { |
1758
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1091 if ( hours <= 1 ) |
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1092 text = pGlobalTXT_LocalizationStrings[109];//Hour |
0 | 1093 else |
1758
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1094 text = pGlobalTXT_LocalizationStrings[110];//Hours |
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1095 sprintfex(pTmpBuf2.data(), "%d %s ", (int)hours, text); |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
1096 strcat(pTmpBuf.data(), pTmpBuf2.data()); |
0 | 1097 } |
1758
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1098 if ( minutes && !days ) |
0 | 1099 { |
1758
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1100 if ( minutes <= 1 ) |
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1101 text = pGlobalTXT_LocalizationStrings[437];//"Minute" |
0 | 1102 else |
1758
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1103 text = pGlobalTXT_LocalizationStrings[436]; //"Minutes" |
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1104 sprintfex(pTmpBuf2.data(), "%d %s ", (int)minutes, text); |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
1105 strcat(pTmpBuf.data(), pTmpBuf2.data()); |
0 | 1106 } |
1758
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1107 if ( seconds && !hours ) |
0 | 1108 { |
1758
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1109 if ( seconds <= 1 ) |
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1110 text = pGlobalTXT_LocalizationStrings[439]; //"Second" |
0 | 1111 else |
1758
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1112 text = pGlobalTXT_LocalizationStrings[438]; //"Seconds" |
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1113 sprintfex(pTmpBuf2.data(), "%d %s ", (int)seconds, text); |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
1114 strcat(pTmpBuf.data(), pTmpBuf2.data()); |
0 | 1115 } |
1758
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1116 this->DrawTitleText(pFontArrus, 0, (212 - pFontArrus->CalcTextHeight(pTmpBuf.data(), this, 0, 0)) / 2 + 101, TargetColor(0xFFu, 0xFFu, 0x9Bu), pTmpBuf.data(), 3); |
0 | 1117 } |
1118 | |
1119 | |
1120 | |
1121 //----- (0044D406) -------------------------------------------------------- | |
1268 | 1122 void GUIWindow::DrawTitleText( GUIFont *a2, signed int uHorizontalMargin, unsigned int uVerticalMargin, unsigned __int16 uDefaultColor, |
1123 const char *pInString, unsigned int uLineSpacing ) | |
762 | 1124 { |
0 | 1125 GUIWindow *pWindow; // esi@1 |
1126 unsigned int v8; // ebx@1 | |
1127 char *v9; // eax@1 | |
1128 unsigned int v11; // edi@1 | |
1129 signed int v12; // esi@1 | |
1130 int v13; // eax@2 | |
1131 GUIFont *pFont; // [sp+Ch] [bp-4h]@1 | |
1132 const char *Stra; // [sp+24h] [bp+14h]@5 | |
1133 | |
1134 pWindow = this; | |
1135 pFont = a2; | |
1136 v8 = this->uFrameWidth - uHorizontalMargin; | |
1137 ui_current_text_color = uDefaultColor; | |
1138 v9 = FitTextInAWindow(pInString, a2, this, uHorizontalMargin, 0); | |
762 | 1139 Stra = strtok(v9, "\n"); |
0 | 1140 v11 = uHorizontalMargin + pWindow->uFrameX; |
1141 v12 = uVerticalMargin + pWindow->uFrameY; | |
1142 while ( 1 ) | |
1143 { | |
762 | 1144 if ( !Stra ) |
0 | 1145 break; |
762 | 1146 v13 = (signed int)(v8 - pFont->GetLineWidth(Stra)) >> 1; |
0 | 1147 if ( v13 < 0 ) |
1148 v13 = 0; | |
1149 pFont->DrawTextLine(uDefaultColor, v11 + v13, v12, Stra, 640); | |
49 | 1150 v12 += pFont->uFontHeight - uLineSpacing; |
762 | 1151 Stra = strtok(0, "\n"); |
0 | 1152 } |
1153 } | |
1154 // 5C6DB4: using guessed type int ui_current_text_color; | |
1155 | |
1156 | |
1157 | |
1158 //----- (0044CE08) -------------------------------------------------------- | |
1006 | 1159 void GUIWindow::DrawText( GUIFont *a2, signed int uX, int uY, unsigned int uFontColor, const char *Str, int a7, int a8, unsigned int uFontShadowColor ) |
1160 { | |
0 | 1161 GUIWindow *v9; // edi@1 |
1162 GUIFont *v10; // ebx@1 | |
1163 int v11; // eax@2 | |
1164 signed int v12; // esi@9 | |
1165 signed int v13; // edi@9 | |
1166 int v14; // edx@9 | |
1167 int v15; // eax@25 | |
1168 unsigned int v16; // ecx@25 | |
1169 int v17; // eax@27 | |
1170 int v18; // edi@32 | |
1171 int v19; // esi@38 | |
1172 std::string v21; // [sp-18h] [bp-50h]@2 | |
1173 const char *v22; // [sp-8h] [bp-40h]@2 | |
1174 int v23; // [sp-4h] [bp-3Ch]@2 | |
1175 char Dest[6]; // [sp+Ch] [bp-2Ch]@32 | |
1176 //char v25; // [sp+Fh] [bp-29h]@32 | |
1177 //char v26; // [sp+11h] [bp-27h]@34 | |
1178 const char *v27; // [sp+20h] [bp-18h]@25 | |
1179 int v28; // [sp+24h] [bp-14h]@25 | |
1180 int v29; // [sp+28h] [bp-10h]@1 | |
1181 size_t v30; // [sp+2Ch] [bp-Ch]@4 | |
1182 GUIWindow *v31; // [sp+30h] [bp-8h]@1 | |
1183 const char *v32; // [sp+34h] [bp-4h]@7 | |
1184 size_t pInString; // [sp+4Ch] [bp+14h]@11 | |
1185 | |
1186 auto a1 = this; | |
1187 v29 = 0; | |
1188 v9 = a1; | |
1189 v10 = a2; | |
1190 v31 = a1; | |
1191 if ( !Str ) | |
1192 { | |
1193 MessageBoxW(nullptr, L"Invalid string passed!", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Font.cpp:859", 0); | |
1006 | 1194 return; |
0 | 1195 } |
1196 v11 = strcmp(Str, "null"); | |
1197 if ( v11 ) | |
1198 { | |
1199 v30 = strlen(Str); | |
1200 LOBYTE(v11) = 0; | |
1201 if ( !uX ) | |
1202 uX = 12; | |
1203 if ( a8 ) | |
1204 { | |
1205 v32 = Str; | |
1206 } | |
1207 else | |
1208 { | |
1209 v11 = (int)FitTextInAWindow(Str, v10, v9, uX, 0); | |
1210 v32 = (const char *)v11; | |
1211 } | |
1212 v12 = uX + v9->uFrameX; | |
1213 v13 = uY + v9->uFrameY; | |
1214 v14 = 0; | |
1215 if ( !a8 || (v11 = v13 + LOBYTE(v10->uFontHeight), v11 <= a8) ) | |
1216 { | |
1217 pInString = 0; | |
1218 if ( (signed int)v30 > 0 ) | |
1219 { | |
1220 do | |
1221 { | |
1222 LOBYTE(v11) = v32[v14]; | |
1223 if ( (unsigned __int8)v11 >= v10->cFirstChar && (unsigned __int8)v11 <= v10->cLastChar | |
1224 || (char)v11 == 12 | |
1225 || (char)v11 == 13 | |
1226 || (char)v11 == 9 | |
1227 || (char)v11 == 10 ) | |
1228 { | |
1229 switch ( (unsigned __int8)v11 ) | |
1230 { | |
1231 case 9u: | |
1232 strncpy(Dest, &v32[v14 + 1], 3u); | |
1233 Dest[3] = 0; | |
1234 pInString += 3; | |
1235 v29 = atoi(Dest); | |
1236 v19 = atoi(Dest); | |
1237 LOBYTE(v11) = (char)v31; | |
1238 v12 = uX + v31->uFrameX + v19; | |
1239 break; | |
1240 case 0xAu: | |
1241 v11 = LOBYTE(v10->uFontHeight); | |
1242 uY = uY + v11 - 3; | |
1243 v13 = uY + v31->uFrameY; | |
1244 v12 = uX + v29 + v31->uFrameX; | |
1245 if ( a8 ) | |
1246 goto LABEL_36; | |
1247 break; | |
1248 case 0xCu: | |
1249 strncpy(Dest, &v32[v14 + 1], 5u); | |
1250 Dest[5] = 0; | |
1251 v11 = atoi(Dest); | |
1252 pInString += 5; | |
1253 uFontColor = v11; | |
1254 break; | |
1255 case 0xDu: | |
1256 strncpy(Dest, &v32[v14 + 1], 3u); | |
1257 Dest[3] = 0; | |
1258 pInString += 3; | |
1259 v18 = atoi(Dest); | |
1260 v11 = v10->GetLineWidth(&v32[pInString]); | |
1261 v12 = v31->uFrameZ - v11 - v18; | |
1262 v13 = uY + v31->uFrameY; | |
1263 if ( a8 ) | |
1264 { | |
1265 v11 = LOBYTE(v10->uFontHeight); | |
1266 LABEL_36: | |
1267 v11 = v11 + v13 - 3; | |
1268 if ( v11 > a8 ) | |
1006 | 1269 return; |
0 | 1270 break; |
1271 } | |
1272 break; | |
1273 default: | |
1274 if ( (char)v11 == 34 && v32[v14 + 1] == 34 ) | |
1275 { | |
1276 ++v14; | |
1277 pInString = v14; | |
1278 } | |
1279 v27 = &v32[v14]; | |
1280 v15 = (unsigned __int8)v32[v14]; | |
1281 v16 = *((int *)&v10->cFirstChar + 3 * v15 + 9); | |
1282 v28 = *((int *)&v10->cFirstChar + 3 * v15 + 9); | |
1283 if ( v14 > 0 ) | |
1284 v12 += v10->pMetrics[v15].uLeftSpacing; | |
1160 | 1285 v17 = (int)((char *)&v10[1] + v10->font_pixels_offset[v15]); |
0 | 1286 if ( (short)uFontColor ) |
1287 pRenderer->DrawText( | |
1288 v12, | |
1289 v13, | |
1290 (unsigned __int8 *)v17, | |
1291 v16, | |
1292 LOBYTE(v10->uFontHeight), | |
1293 v10->pFontPalettes[0], | |
1294 uFontColor, | |
1295 uFontShadowColor); | |
1296 else | |
1297 pRenderer->DrawTextPalette( | |
1298 v12, | |
1299 v13, | |
1268 | 1300 (unsigned char*)v17, |
0 | 1301 v16, |
1302 LOBYTE(v10->uFontHeight), | |
1303 v10->pFontPalettes[0], | |
1304 a7); | |
1305 LOBYTE(v11) = v30; | |
1306 v12 += v28; | |
1307 if ( (signed int)pInString < (signed int)v30 ) | |
1308 { | |
1309 LOBYTE(v11) = 3 * *v27; | |
1310 v12 += v10->pMetrics[(unsigned __int8)*v27].uRightSpacing; | |
1311 } | |
1312 break; | |
1313 } | |
1314 } | |
1315 v14 = pInString++ + 1; | |
1316 } | |
1317 while ( (signed int)pInString < (signed int)v30 ); | |
1318 } | |
1319 } | |
1320 } | |
1006 | 1321 return; |
0 | 1322 } |
1323 | |
1324 | |
1325 //----- (0044CB4F) -------------------------------------------------------- | |
1268 | 1326 int GUIWindow::DrawTextInRect( GUIFont *pFont, unsigned int uX, unsigned int uY, unsigned int uColor, const char *text, int rect_width, int reverse_text ) |
1327 { | |
1328 | |
24 | 1329 int pLineWidth; // ebx@1 |
1268 | 1330 int text_width; // esi@3 |
0 | 1331 unsigned __int8 v12; // cl@7 |
1332 signed int v13; // esi@19 | |
1333 signed int v14; // ebx@19 | |
1334 unsigned __int8 v15; // cl@21 | |
1335 int v16; // eax@22 | |
1336 int v17; // ecx@22 | |
1337 int v18; // ecx@23 | |
1338 int v19; // ecx@24 | |
1339 unsigned int v20; // ecx@26 | |
1268 | 1340 unsigned char* v21; // eax@28 |
0 | 1341 int v22; // ebx@34 |
1342 int v23; // eax@34 | |
1343 int v24; // ebx@36 | |
1268 | 1344 char Str[6]; // [sp+Ch] [bp-20h]@34 |
0 | 1345 char v26; // [sp+Fh] [bp-1Dh]@34 |
1346 char v27; // [sp+11h] [bp-1Bh]@35 | |
1347 int v28; // [sp+20h] [bp-Ch]@17 | |
1348 GUIWindow *pWindow; // [sp+24h] [bp-8h]@1 | |
24 | 1349 size_t pNumLen; // [sp+28h] [bp-4h]@1 |
0 | 1350 size_t Str1a; // [sp+40h] [bp+14h]@5 |
1351 size_t Str1b; // [sp+40h] [bp+14h]@19 | |
1352 const char *Sourcea; // [sp+44h] [bp+18h]@20 | |
1353 int v34; // [sp+48h] [bp+1Ch]@26 | |
1268 | 1354 int i; |
0 | 1355 |
1268 | 1356 |
0 | 1357 pWindow = this; |
1268 | 1358 pNumLen = strlen(text); |
1359 pLineWidth = pFont->GetLineWidth(text); | |
1360 if ( pLineWidth < rect_width ) | |
0 | 1361 { |
1268 | 1362 pWindow->DrawText(pFont, uX, uY, uColor, text, 0, 0, 0); |
24 | 1363 return pLineWidth; |
0 | 1364 } |
1268 | 1365 strcpy(pTmpBuf2.data(), text); |
1366 text_width = 0; | |
1367 if ( reverse_text ) | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
1368 _strrev(pTmpBuf2.data()); |
0 | 1369 Str1a = 0; |
1268 | 1370 for (i=0; i<pNumLen; ++i) |
0 | 1371 { |
1268 | 1372 if ( text_width >= rect_width ) |
0 | 1373 break; |
1268 | 1374 v12 = pTmpBuf2[i]; |
1375 if ( pFont->IsCharValid(v12) ) | |
0 | 1376 { |
1268 | 1377 switch (v12) |
0 | 1378 { |
1268 | 1379 case '\t':// Horizontal tab 09 |
1380 case '\n': //Line Feed 0A 10 | |
1381 case '\r': //Form Feed, page eject 0C 12 | |
1382 break; | |
1383 case '\f': //Carriage Return 0D 13 | |
1384 i += 5; | |
1385 break; | |
1386 default: | |
1387 if ( i > 0 ) | |
1388 text_width += pFont->pMetrics[v12].uLeftSpacing; | |
1389 text_width += pFont->pMetrics[v12].uWidth; | |
1390 if ( i < pNumLen ) | |
1391 text_width += pFont->pMetrics[v12].uRightSpacing; | |
1392 } | |
0 | 1393 } |
1394 } | |
1268 | 1395 pTmpBuf2[i - 1] = 0; |
1396 | |
1397 | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
1398 pNumLen = strlen(pTmpBuf2.data()); |
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
1399 v28 = pFont->GetLineWidth(pTmpBuf2.data()); |
1268 | 1400 if ( reverse_text ) |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
1401 _strrev(pTmpBuf2.data()); |
1268 | 1402 |
0 | 1403 v13 = uX + pWindow->uFrameX; |
1404 v14 = uY + pWindow->uFrameY; | |
1268 | 1405 for (i=0; i<pNumLen; ++i) |
0 | 1406 { |
1268 | 1407 v15 = pTmpBuf2[i]; |
1408 if ( pFont->IsCharValid(v15) ) | |
0 | 1409 { |
1268 | 1410 switch (v12) |
1411 { | |
1412 case '\t':// Horizontal tab 09 | |
1413 { | |
1414 strncpy(Str, &pTmpBuf2[i+1], 3); | |
1415 Str[3] = 0; | |
1416 // atoi(Str); | |
1417 i += 3; | |
1418 break; | |
1419 } | |
1420 case '\n': //Line Feed 0A 10 | |
1421 { | |
1422 v24 = pFont->uFontHeight; | |
1423 v13 = uX; | |
1424 uY = uY + pFont->uFontHeight - 3; | |
1425 v14 = uY+pFont->uFontHeight - 3; | |
1426 break; | |
1427 } | |
1428 case '\r': //Form Feed, page eject 0C 12 | |
0 | 1429 { |
1268 | 1430 strncpy(Str, &pTmpBuf2[i+1], 5); |
1431 Str[5] = 0; | |
1432 i += 5; | |
1433 uColor = atoi(Str); | |
1434 break; | |
1435 } | |
1436 case '\f': //Carriage Return 0D 13 | |
1437 { | |
1438 strncpy(Str, &pTmpBuf2[i+1], 3); | |
1439 Str[3] = 0; | |
1440 i += 3; | |
1441 v23 = pFont->GetLineWidth(&pTmpBuf2[i]); | |
1442 v13 = pWindow->uFrameZ - v23 - atoi(Str); | |
1443 v14 = uY; | |
1444 break; | |
0 | 1445 } |
1268 | 1446 default: |
1447 v20 = pFont->pMetrics[v15].uWidth; | |
1448 if ( i > 0 ) | |
1449 v13 += pFont->pMetrics[v15].uLeftSpacing; | |
1450 v21 = &pFont->pFontData[pFont->font_pixels_offset[v15]]; | |
1451 if ( uColor ) | |
1452 pRenderer->DrawText(v13, v14, v21, v20, pFont->uFontHeight, pFont->pFontPalettes[0], uColor, 0); | |
1453 else | |
1454 pRenderer->DrawTextPalette(v13, v14, v21, v20, pFont->uFontHeight, pFont->pFontPalettes[0], 0); | |
1455 v13 += v20; | |
1456 if ( i < (signed int)pNumLen ) | |
1457 v13 += pFont->pMetrics[v15].uRightSpacing; | |
1458 } | |
0 | 1459 } |
1268 | 1460 |
1461 | |
0 | 1462 } |
1463 return v28; | |
1464 } | |
1465 | |
1466 //----- (0041D12F) -------------------------------------------------------- | |
189 | 1467 GUIButton *GUIWindow::CreateButton(unsigned int uX, unsigned int uY, unsigned int uWidth, unsigned int uHeight, |
832 | 1468 int a6, int a7, UIMessageType msg, unsigned int msg_param, unsigned __int8 uHotkey, const char *pName, Texture *pTextures, ...) |
0 | 1469 { |
17 | 1470 GUIButton *pButton; // esi@1 |
0 | 1471 unsigned int v13; // eax@1 |
1472 unsigned int v14; // ebx@4 | |
1473 unsigned int v15; // eax@4 | |
189 | 1474 unsigned int TextureNum=0; // ebx@4 |
0 | 1475 unsigned int v17; // eax@4 |
1476 Texture *v18; // eax@4 | |
1477 Texture **v19; // ecx@5 | |
1478 Texture **v20; // edx@5 | |
1479 GUIButton *v21; // eax@7 | |
189 | 1480 va_list texturs_ptr; |
0 | 1481 |
1583 | 1482 pButton = (GUIButton *)malloc(0xBC); |
17 | 1483 pButton->pParent = this; |
1268 | 1484 pButton->uWidth = uWidth; |
17 | 1485 pButton->uHeight = uHeight; |
1268 | 1486 |
0 | 1487 if ( a6 == 2 && !uHeight ) |
17 | 1488 pButton->uHeight = uWidth; |
1268 | 1489 |
17 | 1490 pButton->uButtonType = a6; |
1268 | 1491 pButton->uX = uX + this->uFrameX; |
1492 pButton->uY = uY + this->uFrameY; | |
1493 pButton->uZ = pButton->uX + uWidth - 1; | |
1494 pButton->uW = pButton->uY + uHeight - 1; | |
271 | 1495 pButton->field_2C_is_pushed = 0; |
17 | 1496 pButton->field_1C = a7; |
832 | 1497 pButton->msg = msg; |
1498 pButton->msg_param = msg_param; | |
17 | 1499 pButton->uHotkey = uHotkey; |
1268 | 1500 //strlen(pName); |
17 | 1501 strcpy(pButton->pButtonName, pName); |
189 | 1502 va_start(texturs_ptr, pName); |
1503 while (NULL!=(pTextures=va_arg(texturs_ptr, Texture *))) | |
0 | 1504 { |
189 | 1505 pButton->pTextures[TextureNum]=pTextures; |
1506 ++TextureNum; | |
0 | 1507 } |
189 | 1508 va_end(texturs_ptr); |
1509 pButton->uNumTextures = TextureNum; | |
1510 if ( this->pControlsTail ) | |
1511 this->pControlsTail->pNext = pButton; | |
0 | 1512 else |
17 | 1513 this->pControlsHead = pButton; |
1514 pButton->pPrev = this->pControlsTail; | |
1515 this->pControlsTail = pButton; | |
1516 pButton->pNext = 0; | |
0 | 1517 ++this->uNumControls; |
17 | 1518 return pButton; |
0 | 1519 } |
1520 | |
1521 //----- (00459C2B) -------------------------------------------------------- | |
1268 | 1522 void GUIWindow::DrawFlashingInputCursor( signed int uX, int uY, struct GUIFont *a2 ) |
1523 { | |
0 | 1524 if ( GetTickCount() % 1000 > 500 ) |
1268 | 1525 DrawText(a2, uX, uY, 0, "_", 0, 0, 0); |
0 | 1526 } |
1527 | |
1528 //----- (0041C432) -------------------------------------------------------- | |
1268 | 1529 GUIWindow * GUIWindow::Create( unsigned int uX, unsigned int uY, unsigned int uWidth, unsigned int uHeight, enum WindowType eWindowType, int pButton, const char* hint ) |
1530 { | |
0 | 1531 unsigned int uNextFreeWindowID; // ebp@1 |
1532 //int *v8; // eax@1 | |
1533 //GUIWindow *pWindow; // esi@4 | |
962 | 1534 //int v10; // eax@4 |
0 | 1535 unsigned int v11; // ebx@15 |
423 | 1536 NPCData *speakingNPC; // ebp@15 |
1537 int v14; // eax@20 | |
1538 int v16; // eax@25 | |
1539 int v18; // eax@30 | |
1540 int v20; // eax@35 | |
1541 int v22; // eax@40 | |
1542 int v24; // eax@45 | |
0 | 1543 int v25; // eax@65 |
1544 unsigned int v26; // ebx@65 | |
1545 char *v27; // eax@71 | |
1546 const char *v29; // [sp-8h] [bp-18h]@68 | |
1547 char *v30; // [sp-4h] [bp-14h]@68 | |
1548 int uWidtha; // [sp+14h] [bp+4h]@66 | |
423 | 1549 int num_menu_buttons; // [sp+20h] [bp+10h]@15 |
0 | 1550 |
1551 for (uNextFreeWindowID = 0; uNextFreeWindowID < 20; ++uNextFreeWindowID) | |
1552 { | |
1553 if (pWindowList[uNextFreeWindowID].eWindowType == WINDOW_null) | |
1554 break; | |
1555 } | |
1556 | |
1557 auto pWindow = &pWindowList[uNextFreeWindowID]; | |
1558 pWindow->uFrameWidth = uWidth; | |
1268 | 1559 pWindow->uFrameHeight = uHeight; |
1560 | |
1561 pWindow->uFrameX = uX; | |
1562 pWindow->uFrameY = uY; | |
0 | 1563 pWindow->uFrameZ = uX + uWidth - 1; |
1564 pWindow->uFrameW = uY + uHeight - 1; | |
1268 | 1565 |
11 | 1566 pWindow->ptr_1C = (void *)pButton; |
1268 | 1567 pWindow->Hint = hint; |
1568 | |
0 | 1569 pWindow->eWindowType = eWindowType; |
972 | 1570 pWindow->receives_keyboard_input = false; |
496 | 1571 ++uNumVisibleWindows; |
1572 pWindow->numVisibleWindows = uNumVisibleWindows; | |
1573 pVisibleWindowsIdxs[uNumVisibleWindows] = uNextFreeWindowID + 1; | |
0 | 1574 if ( (signed int)eWindowType <= 20 ) |
1575 { | |
1576 if (eWindowType != WINDOW_Chest) | |
1577 { | |
1578 switch (eWindowType) | |
1579 { | |
1268 | 1580 case WINDOW_Book: { |
0 | 1581 pWindow->InitializeBookView(); |
1582 break; | |
1268 | 1583 } |
1584 case WINDOW_Dialogue: { | |
11 | 1585 pMainScreenNum = pCurrentScreen; |
151 | 1586 pCurrentScreen = SCREEN_NPC_DIALOGUE; |
832 | 1587 pBtn_ExitCancel = pWindow->CreateButton(0x1D7u, 0x1BDu, 0xA9u, 0x23u, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[79], //"Exit" |
735 | 1588 pIcons_LOD->GetTexture(uExitCancelTextureId), 0); |
496 | 1589 if ( pWindow->par1C != 1 ) |
0 | 1590 { |
423 | 1591 num_menu_buttons = 0; |
0 | 1592 v11 = LOBYTE(pFontArrus->uFontHeight) - 3; |
602 | 1593 speakingNPC = GetNPCData(sDialogue_SpeakingActorNPC_ID); |
827 | 1594 if ( GetGreetType(sDialogue_SpeakingActorNPC_ID) == 1 )//QuestsNPC_greet |
0 | 1595 { |
423 | 1596 if ( speakingNPC->joins ) |
0 | 1597 { |
832 | 1598 pWindow->CreateButton(480, 130, 140, v11, 1, 0, UIMSG_SelectNPCDialogueOption, 0xDu, 0, "", 0); |
423 | 1599 num_menu_buttons = 1; |
0 | 1600 } |
423 | 1601 if ( speakingNPC->evt_A ) |
0 | 1602 { |
423 | 1603 if ( num_menu_buttons < 4 ) |
0 | 1604 { |
423 | 1605 v14 = NPC_EventProcessor(speakingNPC->evt_A); |
0 | 1606 if ( v14 == 1 || v14 == 2 ) |
832 | 1607 pWindow->CreateButton(0x1E0u, num_menu_buttons++ * v11 + 130, 0x8Cu, v11, 1, 0, UIMSG_SelectNPCDialogueOption, 0x13u, 0, "", 0); |
0 | 1608 } |
1609 } | |
423 | 1610 if ( speakingNPC->evt_B ) |
0 | 1611 { |
423 | 1612 if ( num_menu_buttons < 4 ) |
0 | 1613 { |
423 | 1614 v16 = NPC_EventProcessor(speakingNPC->evt_B); |
0 | 1615 if ( v16 == 1 || v16 == 2 ) |
832 | 1616 pWindow->CreateButton(0x1E0u, num_menu_buttons++ * v11 + 130, 0x8Cu, v11, 1, 0, UIMSG_SelectNPCDialogueOption, 0x14u, 0, "", 0); |
0 | 1617 } |
1618 } | |
423 | 1619 if ( speakingNPC->evt_C ) |
0 | 1620 { |
423 | 1621 if ( num_menu_buttons < 4 ) |
0 | 1622 { |
423 | 1623 v18 = NPC_EventProcessor(speakingNPC->evt_C); |
0 | 1624 if ( v18 == 1 || v18 == 2 ) |
832 | 1625 pWindow->CreateButton( 0x1E0u, num_menu_buttons++ * v11 + 130, 0x8Cu, v11, 1, 0, UIMSG_SelectNPCDialogueOption, 0x15u, 0, "", 0); |
0 | 1626 } |
1627 } | |
423 | 1628 if ( speakingNPC->evt_D ) |
0 | 1629 { |
423 | 1630 if ( num_menu_buttons < 4 ) |
0 | 1631 { |
423 | 1632 v20 = NPC_EventProcessor(speakingNPC->evt_D); |
0 | 1633 if ( v20 == 1 || v20 == 2 ) |
832 | 1634 pWindow->CreateButton(0x1E0u, num_menu_buttons++ * v11 + 130, 0x8Cu, v11, 1, 0, UIMSG_SelectNPCDialogueOption, 0x16u, 0, "", 0); |
0 | 1635 } |
1636 } | |
423 | 1637 if ( speakingNPC->evt_E ) |
0 | 1638 { |
423 | 1639 if ( num_menu_buttons < 4 ) |
0 | 1640 { |
423 | 1641 v22 = NPC_EventProcessor(speakingNPC->evt_E); |
0 | 1642 if ( v22 == 1 || v22 == 2 ) |
832 | 1643 pWindow->CreateButton(0x1E0u, num_menu_buttons++ * v11 + 130, 0x8Cu, v11, 1, 0, UIMSG_SelectNPCDialogueOption, 0x17u, 0, "", 0); |
0 | 1644 } |
1645 } | |
423 | 1646 if (speakingNPC->evt_F ) |
0 | 1647 { |
423 | 1648 if ( num_menu_buttons < 4 ) |
0 | 1649 { |
423 | 1650 v24 = NPC_EventProcessor(speakingNPC->evt_F); |
0 | 1651 if ( v24 == 1 || v24 == 2 ) |
832 | 1652 pWindow->CreateButton(0x1E0u, num_menu_buttons++ * v11 + 130, 0x8Cu, v11, 1, 0, UIMSG_SelectNPCDialogueOption, 0x18u, 0, "", 0); |
0 | 1653 } |
1654 } | |
1655 } | |
1656 else | |
1657 { | |
423 | 1658 if ( speakingNPC->joins ) |
0 | 1659 { |
832 | 1660 pWindow->CreateButton(0x1E0u, 0x82u, 0x8Cu, v11, 1, 0, UIMSG_SelectNPCDialogueOption, 0x4Du, 0, pGlobalTXT_LocalizationStrings[407], 0);//Ïîäðîáíåå |
423 | 1661 if (speakingNPC->Hired()) |
0 | 1662 { |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
1663 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[408], speakingNPC->pName); //Îòïóñòèòü |
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
1664 pWindow->CreateButton(0x1E0u, v11 + 130, 0x8Cu, v11, 1, 0, UIMSG_SelectNPCDialogueOption, 0x4Cu, 0, pTmpBuf.data(), 0); |
0 | 1665 } |
1666 else | |
1667 { | |
832 | 1668 pWindow->CreateButton(0x1E0u, v11 + 130, 0x8Cu, v11, 1, 0, UIMSG_SelectNPCDialogueOption, 0x4Cu, 0, pGlobalTXT_LocalizationStrings[406], 0);//Íàíÿòü |
0 | 1669 } |
423 | 1670 num_menu_buttons = 2; |
0 | 1671 } |
1672 } | |
972 | 1673 pWindow->_41D08F_set_keyboard_control_group(num_menu_buttons, 1, 0, 1); |
0 | 1674 } |
1675 break; | |
1268 | 1676 } |
1677 case WINDOW_ChangeLocation: { | |
11 | 1678 pMainScreenNum = pCurrentScreen; |
151 | 1679 pCurrentScreen = SCREEN_CHANGE_LOCATION; |
987 | 1680 pBtn_ExitCancel = pWindow->CreateButton( 566, 445, 75, 33, 1, 0, UIMSG_CHANGE_LOCATION_ClickCencelBtn, 0, 'N', pGlobalTXT_LocalizationStrings[156], pIcons_LOD->GetTexture(uTextureID_BUTTDESC2), 0);//Îñòàòüñÿ â ýòîé îáëàñòè |
948 | 1681 pBtn_YES = pWindow->CreateButton( 486, 445, 75, 33, 1, 0, UIMSG_OnTravelByFoot, 0, 'Y', pWindow->Hint, pIcons_LOD->GetTexture(uTextureID_BUTTYES2), 0); |
1682 pWindow->CreateButton(pNPCPortraits_x[0][0], pNPCPortraits_y[0][0], 63, 73, 1, 0, UIMSG_OnTravelByFoot, 1, ' ', pWindow->Hint, 0, 0, 0); | |
1683 pWindow->CreateButton( 8, 8, 460, 344, 1, 0, UIMSG_OnTravelByFoot, 1, 0, pWindow->Hint, 0); | |
0 | 1684 break; |
1268 | 1685 } |
1686 case WINDOW_SpellBook: {// îêíî êíèãè çàêëîâ | |
0 | 1687 InitializeBookTextures(); |
11 | 1688 pWindow->OpenSpellBook(); |
0 | 1689 break; |
1268 | 1690 } |
1691 case WINDOW_GreetingNPC: {// îêíî ïðèâåòñòâèÿ ÍÏÑ | |
11 | 1692 pMainScreenNum = pCurrentScreen; |
3 | 1693 pKeyActionMap->EnterText(0, 15, pWindow); |
151 | 1694 pCurrentScreen = SCREEN_BRANCHLESS_NPC_DIALOG; |
0 | 1695 break; |
1268 | 1696 } |
1697 | |
0 | 1698 } |
1699 return pWindow; | |
1700 } | |
11 | 1701 //LABEL_62: |
948 | 1702 pWindow->CreateButton(0x3Du, 0x1A8u, 0x1Fu, 0, 2, 94, UIMSG_SelectCharacter, 1u, '1', "", 0); |
1703 pWindow->CreateButton(0xB1u, 0x1A8u, 0x1Fu, 0, 2, 94, UIMSG_SelectCharacter, 2u, '2', "", 0); | |
1704 pWindow->CreateButton(0x124u, 0x1A8u, 0x1Fu, 0, 2, 94, UIMSG_SelectCharacter, 3u, '3', "", 0); | |
1705 pWindow->CreateButton(0x197u, 0x1A8u, 0x1Fu, 0, 2, 94, UIMSG_SelectCharacter, 4u, '4', "", 0); | |
832 | 1706 pWindow->CreateButton(0, 0, 0, 0, 1, 0, UIMSG_CycleCharacters, 0, 9u, "", 0); |
0 | 1707 return pWindow; |
1708 } | |
1709 if (eWindowType == WINDOW_HouseInterior) | |
1710 { | |
151 | 1711 pCurrentScreen = SCREEN_HOUSE; |
1589 | 1712 pBtn_ExitCancel = pWindow->CreateButton(471, 445, 169, 35, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[80],//Âûéòè èç çäàíèÿ |
735 | 1713 pIcons_LOD->GetTexture(uExitCancelTextureId), 0); |
1589 | 1714 for ( v26 = 0; v26 < uNumDialogueNPCPortraits; ++v26 ) |
1715 { | |
1716 if ( v26 + 1 == uNumDialogueNPCPortraits && uHouse_ExitPic ) | |
0 | 1717 { |
1589 | 1718 v30 = pMapStats->pInfos[uHouse_ExitPic].pName; |
1719 v29 = (char*)pGlobalTXT_LocalizationStrings[LOCSTR_ENTER_S]; | |
1720 } | |
1721 else | |
1722 { | |
1723 if ( v26 || !dword_591080 ) | |
1724 v27 = HouseNPCData[v26 +1 - ((dword_591080 != 0)? 1:0)]->pName; | |
0 | 1725 else |
1589 | 1726 v27 = (char*)p2DEvents[pButton - 1].pProprieterName; |
1727 v30 = v27; | |
1728 v29 = (char*)pGlobalTXT_LocalizationStrings[435]; | |
0 | 1729 } |
1589 | 1730 sprintfex(byte_591180[v26].data(), v29, v30); |
1731 HouseNPCPortraitsButtonsList[v26] = pWindow->CreateButton(pNPCPortraits_x[uNumDialogueNPCPortraits - 1][v26], | |
1732 pNPCPortraits_y[uNumDialogueNPCPortraits - 1][v26], | |
1733 63, 73, 1, 0, UIMSG_ClickHouseNPCPortrait, v26, 0, byte_591180[v26].data(), 0, 0, 0); | |
1734 } | |
1211 | 1735 if ( uNumDialogueNPCPortraits == 1 ) |
0 | 1736 { |
336 | 1737 window_SpeakInHouse = &pWindowList[uNextFreeWindowID]; |
0 | 1738 _4B4224_UpdateNPCTopics(0); |
1739 } | |
1740 } | |
1741 else | |
1742 { | |
158 | 1743 if (eWindowType == WINDOW_Transition) |
0 | 1744 { |
11 | 1745 pMainScreenNum = pCurrentScreen; |
151 | 1746 pCurrentScreen = SCREEN_INPUT_BLV; |
960 | 1747 pBtn_ExitCancel = pWindow->CreateButton(0x236u, 0x1BDu, 0x4Bu, 0x21u, 1, 0, UIMSG_TransitionWindowCloseBtn, 0, 'N', pGlobalTXT_LocalizationStrings[34], pIcons_LOD->GetTexture(uTextureID_BUTTDESC2), 0);//Îòìåíà |
948 | 1748 pBtn_YES = pWindow->CreateButton(0x1E6u, 0x1BDu, 0x4Bu, 0x21u, 1, 0, UIMSG_TransitionUI_Confirm, 0, 'Y', pWindow->Hint, pIcons_LOD->GetTexture(uTextureID_BUTTYES2), 0); |
1749 pWindow->CreateButton(pNPCPortraits_x[0][0], pNPCPortraits_y[0][0], 0x3Fu, 0x49u, 1, 0, UIMSG_TransitionUI_Confirm, 1, 0x20u, pWindow->Hint, 0); | |
1750 pWindow->CreateButton(8, 8, 0x1CCu, 0x158u, 1, 0, UIMSG_TransitionUI_Confirm, 1u, 0, pWindow->Hint, 0); | |
0 | 1751 return pWindow; |
1752 } | |
961 | 1753 if (eWindowType == WINDOW_CastSpell) |
0 | 1754 { |
1755 pEventTimer->Pause(); | |
1756 pAudioPlayer->StopChannels(-1, -1); | |
1757 pMouse->SetCursorBitmap("MICON2"); | |
11 | 1758 ShowStatusBarString(pGlobalTXT_LocalizationStrings[39], 2u);//Âûáåðèòå öåëü |
0 | 1759 return pWindow; |
1760 } | |
158 | 1761 if (eWindowType == WINDOW_Scroll) |
11 | 1762 { |
948 | 1763 pWindow->CreateButton(0x3Du, 0x1A8u, 0x1Fu, 0, 2, 94, UIMSG_SelectCharacter, 1u, '1', "", 0); |
1764 pWindow->CreateButton(0xB1u, 0x1A8u, 0x1Fu, 0, 2, 94, UIMSG_SelectCharacter, 2u, '2', "", 0); | |
1765 pWindow->CreateButton(0x124u, 0x1A8u, 0x1Fu, 0, 2, 94, UIMSG_SelectCharacter, 3u, '3', "", 0); | |
1766 pWindow->CreateButton(0x197u, 0x1A8u, 0x1Fu, 0, 2, 94, UIMSG_SelectCharacter, 4u, '4', "", 0); | |
1767 pWindow->CreateButton(0, 0, 0, 0, 1, 0, UIMSG_CycleCharacters, 0, '\t', "", 0); | |
11 | 1768 return pWindow; |
1769 } | |
898 | 1770 if (eWindowType == WINDOW_CastSpell_InInventory) |
0 | 1771 { |
1772 pMouse->SetCursorBitmap("MICON2"); | |
832 | 1773 pBtn_ExitCancel = pWindow->CreateButton(0x188u, 0x13Eu, 0x4Bu, 0x21u, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[34],//Îòìåíà |
945 | 1774 pIcons_LOD->GetTexture(uTextureID_BUTTDESC2), 0); |
11 | 1775 ShowStatusBarString(pGlobalTXT_LocalizationStrings[39], 2);//Âûáðàòü öåëü |
0 | 1776 ++pIcons_LOD->uTexturePacksCount; |
1777 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 103; | |
151 | 1778 pCurrentScreen = SCREEN_CASTING; |
0 | 1779 if ( !pIcons_LOD->uNumPrevLoadedFiles ) |
1780 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; | |
1781 } | |
1782 } | |
1783 return pWindow; | |
1295 | 1784 } |
1785 //----- (004B3EF0) -------------------------------------------------------- | |
1786 void DrawJoinGuildWindow( int pEventCode ) | |
1787 { | |
1788 uDialogueType = 81;//enum JoinGuildDialog | |
1789 current_npc_text = (char *)pNPCTopics[pEventCode + 99].pText; | |
1790 ContractSelectText(pEventCode); | |
1791 pDialogueWindow->Release(); | |
1792 pDialogueWindow = GUIWindow::Create(0, 0, 640, 0x15E, WINDOW_MainMenu, pEventCode, 0); | |
1793 pBtn_ExitCancel = pDialogueWindow->CreateButton(471, 445, 169, 35, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[34], pIcons_LOD->GetTexture(uExitCancelTextureId), 0); // Cancel | |
1794 pDialogueWindow->CreateButton( 0, 0, 0, 0, 1, 0, UIMSG_BuyInShop_Identify_Repair, 0, 0, "", 0); | |
1795 pDialogueWindow->CreateButton(480, 160, 140, 30, 1, 0, UIMSG_ClickNPCTopic, 0x52u, 0, pGlobalTXT_LocalizationStrings[122], 0); | |
1796 pDialogueWindow->_41D08F_set_keyboard_control_group(1, 1, 0, 2); | |
1797 dialog_menu_id = HOUSE_DIALOGUE_OTHER; | |
1798 } | |
1799 //----- (0044603D) -------------------------------------------------------- | |
1458 | 1800 void DialogueEnding() |
1295 | 1801 { |
1802 sDialogue_SpeakingActorNPC_ID = 0; | |
1803 pDialogueWindow->Release(); | |
1804 pDialogueWindow = 0; | |
1805 pMiscTimer->Resume(); | |
1806 pEventTimer->Resume(); | |
1297 | 1807 } |
1808 //----- (004156F0) -------------------------------------------------------- | |
1809 void GUI_UpdateWindows() | |
1810 { | |
1811 GUIWindow *pWindow; // esi@4 | |
1812 //unsigned int pWindowType; // eax@4 | |
1813 const char *pHint; // edx@66 | |
1814 GUIButton *pButtonPtr_1C; // ebp@79 | |
1815 char *pHint1; // edx@80 | |
1816 int v26; // eax@98 | |
1817 unsigned int v27; // ebp@106 | |
1818 GUIWindow *pGUIWindow2; // ecx@109 | |
1819 GUIFont *pGUIFont; // ST1C_4@115 | |
1820 int v31; // eax@115 | |
1821 GUIButton *pButton; // ebp@118 | |
1822 int v39; // eax@129 | |
1823 unsigned int pNumMessages; // eax@142 | |
1824 GUIButton *pGUIButton; // ebp@146 | |
1825 //unsigned int pX; // [sp-1Ch] [bp-124h]@17 | |
1826 //unsigned int pY; // [sp-18h] [bp-120h]@17 | |
1827 //Texture *pTexture; // [sp-14h] [bp-11Ch]@17 | |
1828 //Texture *pTexture2; // [sp-14h] [bp-11Ch]@86 | |
1829 int i; // [sp+0h] [bp-108h]@3 | |
1830 ItemGen pItemGen; // [sp+4h] [bp-104h]@98 | |
1831 GUIButton GUIButton2; // [sp+28h] [bp-E0h]@133 | |
1832 ItemGen ItemGen2; // [sp+E4h] [bp-24h]@129 | |
1833 | |
1834 if (GetCurrentMenuID() != MENU_CREATEPARTY) | |
1835 UI_OnKeyDown(VK_NEXT); | |
1836 | |
1837 for ( i = 1; i <= uNumVisibleWindows; ++i ) | |
1838 { | |
1839 pWindow = &pWindowList[pVisibleWindowsIdxs[i] - 1]; | |
1840 switch (pWindow->eWindowType) | |
1841 { | |
1842 case WINDOW_OptionsButtons: | |
1843 { | |
1844 pRenderer->DrawTextureIndexed(pViewport->uViewportTL_Y, | |
1845 pViewport->uViewportTL_X, pIcons_LOD->GetTexture(uTextureID_Options)); | |
1846 viewparams->bRedrawGameUI = 1; | |
1847 continue; | |
1848 } | |
1849 case WINDOW_CharacterRecord: | |
1850 { | |
1851 CharacterUI_CharacterScreen_Draw(pPlayers[uActiveCharacter]); | |
1852 continue; | |
1853 } | |
1854 case WINDOW_Options: | |
1855 { | |
1856 GameMenuUI_Options_Draw(); | |
1857 continue; | |
1858 } | |
1859 case WINDOW_Book: | |
1860 { | |
1861 BookUI_Draw((WindowType)(int)pWindow->ptr_1C); | |
1862 continue; | |
1863 } | |
1864 case WINDOW_Dialogue: | |
1865 { | |
1866 GameUI_DrawDialogue(); | |
1867 continue; | |
1868 } | |
1869 case WINDOW_QuickReference: | |
1870 { | |
1871 GameUI_QuickRef_Draw(); | |
1872 continue; | |
1873 } | |
1874 case WINDOW_Rest: | |
1875 { | |
1876 RestUI_Draw(); | |
1877 continue; | |
1878 } | |
1879 case WINDOW_ChangeLocation: | |
1880 { | |
1881 TravelUI_Draw(); | |
1882 continue; | |
1883 } | |
1884 case WINDOW_SpellBook: | |
1885 { | |
1886 DrawSpellBookContent(pPlayers[uActiveCharacter]); | |
1887 continue; | |
1888 } | |
1889 case WINDOW_GreetingNPC: | |
1890 { | |
1891 GameUI_DrawBranchlessDialogue(); | |
1892 continue; | |
1893 } | |
1894 case WINDOW_Chest: | |
1895 { | |
1896 if ( pCurrentScreen == SCREEN_CHEST ) | |
1897 { | |
1312 | 1898 Chest::DrawChestUI(pWindow->par1C); |
1297 | 1899 } |
1900 else if ( pCurrentScreen == SCREEN_CHEST_INVENTORY ) | |
1901 { | |
1902 pRenderer->ClearZBuffer(0, 479); | |
1903 draw_leather(); | |
1904 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); | |
1905 pRenderer->DrawTextureIndexed(pBtn_ExitCancel->uX, pBtn_ExitCancel->uY, pIcons_LOD->GetTexture(uExitCancelTextureId)); | |
1906 } | |
1907 continue; | |
1908 } | |
1909 case WINDOW_SaveLoadButtons: | |
1910 { | |
1911 SaveUI_Draw(); | |
1912 continue; | |
1913 } | |
1914 case WINDOW_MainMenu_Load: | |
1915 { | |
1916 LoadUI_Draw(); | |
1917 continue; | |
1918 } | |
1919 case WINDOW_HouseInterior: | |
1920 { | |
1921 pWindowList[pVisibleWindowsIdxs[i] - 1].HouseDialogManager(); | |
1922 if ( !window_SpeakInHouse ) | |
1923 continue; | |
1312 | 1924 if ( window_SpeakInHouse->par1C >= 53 ) |
1297 | 1925 continue; |
1747
cecb080929c4
Party_stru0 renamed to PartyTimeStruct, fixed its members, renamed Party::field_3C to Party::PartyTimes, started Player::SetVariable refactoring start
Grumpy7
parents:
1709
diff
changeset
|
1926 if ( pParty->PartyTimes._shop_ban_times[window_SpeakInHouse->par1C] <=pParty->uTimePlayed ) |
1297 | 1927 { |
1312 | 1928 if ( window_SpeakInHouse->par1C < 53 ) |
1297 | 1929 { |
1747
cecb080929c4
Party_stru0 renamed to PartyTimeStruct, fixed its members, renamed Party::field_3C to Party::PartyTimes, started Player::SetVariable refactoring start
Grumpy7
parents:
1709
diff
changeset
|
1930 pParty->PartyTimes._shop_ban_times[window_SpeakInHouse->par1C] = 0; |
1297 | 1931 } |
1932 continue; | |
1933 } | |
1934 pNumMessages = pMessageQueue_50CBD0->uNumMessages; | |
1935 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); | |
1936 continue; | |
1937 } | |
1938 case WINDOW_Transition: | |
1939 { | |
1940 TransitionUI_Draw(); | |
1941 continue; | |
1942 } | |
1943 case WINDOW_Scroll: | |
1944 { | |
1945 CreateScrollWindow(); | |
1946 continue; | |
1947 } | |
1948 case WINDOW_CastSpell_InInventory: | |
1949 { | |
1950 pRenderer->ClearZBuffer(0, 479); | |
1951 draw_leather(); | |
1952 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); | |
1953 CharacterUI_DrawPaperdoll(pPlayers[uActiveCharacter]); | |
1954 pRenderer->DrawTextureTransparent(pBtn_ExitCancel->uX, pBtn_ExitCancel->uY, pIcons_LOD->GetTexture(uTextureID_x_x_u)); | |
1955 continue; | |
1956 } | |
1458 | 1957 case WINDOW_ModalWindow: |
1297 | 1958 { |
1458 | 1959 ModalWindow_ShowHint(); |
1297 | 1960 continue; |
1961 } | |
1962 case WINDOW_50: | |
1963 { | |
1964 v27 = TargetColor(255, 255, 255); | |
1965 if ( ptr_507BD0->receives_keyboard_input_2 == WINDOW_INPUT_IN_PROGRESS) | |
1966 { | |
1967 ptr_507BD0->DrawMessageBox(0); | |
1968 ptr_507BD0->DrawText(pFontCreate, 30, 40, v27, (const char *)pKeyActionMap->pPressedKeysBuffer, 0, 0, 0); | |
1969 v31 = pFontCreate->GetLineWidth((const char *)pKeyActionMap->pPressedKeysBuffer); | |
1970 ptr_507BD0->DrawFlashingInputCursor(v31 + 30, 40, pFontCreate); | |
1971 continue; | |
1972 } | |
1973 if ( ptr_507BD0->receives_keyboard_input_2 == WINDOW_INPUT_CONFIRMED) | |
1974 { | |
1975 pWindow->receives_keyboard_input_2 = WINDOW_INPUT_NONE; | |
1976 pMessageQueue_50CBD0->AddMessage((UIMessageType)(int)ptr_507BD0->ptr_1C, 0, 0); | |
1977 pEventTimer->Resume(); | |
1978 ptr_507BD0->Release(); | |
1979 pCurrentScreen = SCREEN_GAME; | |
1980 viewparams->bRedrawGameUI = true; | |
1981 continue; | |
1982 } | |
1983 if ( ptr_507BD0->receives_keyboard_input_2 == WINDOW_INPUT_CANCELLED) | |
1984 { | |
1985 pWindow->receives_keyboard_input_2 = WINDOW_INPUT_NONE; | |
1986 pEventTimer->Resume(); | |
1987 ptr_507BD0->Release(); | |
1988 continue; | |
1989 } | |
1990 } | |
1991 case WINDOW_59: | |
1992 { | |
1993 pWindow->DrawMessageBox(0); | |
1994 pWindow->DrawText(pFontLucida, 10, 20, 0, "Making item number", 0, 0, 0); | |
1995 pWindow->DrawText(pFontLucida, 10, 40, 0, (const char *)pKeyActionMap->pPressedKeysBuffer, 0, 0, 0); | |
1996 if ( !pKeyActionMap->field_204 ) | |
1997 { | |
1998 ItemGen2.Reset(); | |
1999 pWindow->Release(); | |
2000 pEventTimer->Resume(); | |
2001 pCurrentScreen = 0; | |
2002 viewparams->bRedrawGameUI = true; | |
2003 v26 = atoi((const char *)pKeyActionMap->pPressedKeysBuffer); | |
2004 if ( v26 > 0 ) | |
2005 { | |
2006 if ( v26 < 800 ) | |
2007 { | |
2008 ItemGen2.uAttributes |= 1u; | |
2009 ItemGen2.uItemID = v26; | |
2010 if ( pItemsTable->pItems[v26].uEquipType == 12 ) | |
2011 { | |
1709
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1640
diff
changeset
|
2012 ItemGen2.uNumCharges = rand() % 6 + ItemGen2.GetDamageMod() + 1; |
1297 | 2013 ItemGen2.uMaxCharges = LOBYTE(ItemGen2.uNumCharges); |
2014 } | |
2015 else | |
2016 { | |
2017 if ( v26 >= 221 && v26 < 271 ) | |
2018 ItemGen2.uEnchantmentType = rand() % 10 + 1; | |
2019 } | |
2020 pItemsTable->SetSpecialBonus(&ItemGen2); | |
2021 pParty->SetHoldingItem(&ItemGen2); | |
2022 } | |
2023 } | |
2024 } | |
2025 continue; | |
2026 } | |
2027 case WINDOW_PressedButton2: | |
2028 { | |
2029 if ( pWindow->Hint != (char *)1 ) | |
2030 pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0); | |
2031 pButton = (GUIButton *)pWindow->ptr_1C; | |
2032 if ( pButton->uX >= 0 && pButton->uX <= 640 ) | |
2033 { | |
2034 if ( pButton->uY >= 0 && pButton->uY <= 480 ) | |
2035 { | |
2036 pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, pButton->pTextures[0]); | |
2037 viewparams->bRedrawGameUI = 1; | |
2038 if ( pWindow->Hint ) | |
2039 { | |
2040 if ( pWindow->Hint != (char *)1 ) | |
2041 pButton->DrawLabel(pWindow->Hint, pFontCreate, 0, 0); | |
2042 } | |
2043 pWindow->Release(); | |
2044 continue; | |
2045 } | |
2046 } | |
2047 viewparams->bRedrawGameUI = 1; | |
2048 if ( pWindow->Hint ) | |
2049 { | |
2050 if ( pWindow->Hint != (char *)1 ) | |
2051 pButton->DrawLabel(pWindow->Hint, pFontCreate, 0, 0); | |
2052 } | |
2053 pWindow->Release(); | |
2054 continue; | |
2055 } | |
2056 case WINDOW_CharactersPressedButton: | |
2057 { | |
2058 if ( pWindow->Hint != (char *)1 ) | |
2059 pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0); | |
2060 pButton = (GUIButton *)pWindow->ptr_1C; | |
2061 pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, pButton->pTextures[1]); | |
2062 viewparams->bRedrawGameUI = 1; | |
2063 if ( pWindow->Hint ) | |
2064 { | |
2065 if ( pWindow->Hint != (char *)1 ) | |
2066 pButton->DrawLabel(pWindow->Hint, pFontCreate, 0, 0); | |
2067 } | |
2068 pWindow->Release(); | |
2069 continue; | |
2070 } | |
2071 case WINDOW_PressedButton: | |
2072 { | |
2073 if ( pWindow->Hint != (char *)1 ) | |
2074 pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0); | |
2075 pButton = (GUIButton *)pWindow->ptr_1C; | |
2076 pRenderer->DrawTextureTransparent(pWindow->uFrameX, pWindow->uFrameY, pButton->pTextures[0]); | |
2077 viewparams->bRedrawGameUI = 1; | |
2078 if ( pWindow->Hint ) | |
2079 { | |
2080 if ( pWindow->Hint != (char *)1 ) | |
2081 pButton->DrawLabel(pWindow->Hint, pFontCreate, 0, 0); | |
2082 } | |
2083 pWindow->Release(); | |
2084 continue; | |
2085 } | |
2086 case WINDOW_5D: | |
2087 { | |
2088 if ( pWindow->Hint != (char *)1 ) | |
2089 pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0); | |
2090 pButton = (GUIButton *)pWindow->ptr_1C; | |
2091 pRenderer->DrawTextureTransparent(pWindow->uFrameX, pWindow->uFrameY, pButton->pTextures[1]); | |
2092 viewparams->bRedrawGameUI = 1; | |
2093 pWindow->Release(); | |
2094 continue; | |
2095 } | |
2096 case WINDOW_SaveLoadBtn: | |
2097 { | |
2098 if (pWindow->Hint != (char *)1) | |
2099 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0); | |
2100 pButton = (GUIButton *)pWindow->ptr_1C; | |
2101 pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, pButton->pTextures[0]); | |
2102 pHint = pWindow->Hint; | |
2103 viewparams->bRedrawGameUI = 1; | |
2104 if ( pHint && pHint != (char *)1 ) | |
2105 pButton->DrawLabel(pHint, pFontCreate, 0, 0); | |
2106 pWindow->Release(); | |
2107 if (pCurrentScreen == SCREEN_SAVEGAME) | |
2108 pMessageQueue_50CBD0->AddMessage(UIMSG_SaveGame, 0, 0); | |
2109 else | |
2110 pMessageQueue_50CBD0->AddMessage(UIMSG_LoadGame, 0, 0); | |
2111 continue; | |
2112 } | |
2113 case WINDOW_LoadGame_CancelBtn: | |
2114 { | |
2115 if ( pWindow->Hint != (char *)1 ) | |
2116 pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0); | |
2117 pButton = (GUIButton *)pWindow->ptr_1C; | |
2118 pRenderer->DrawTextureTransparent(pWindow->uFrameX, pWindow->uFrameY, pButton->pTextures[0]); | |
2119 viewparams->bRedrawGameUI = 1; | |
2120 if ( pWindow->Hint && pWindow->Hint != (char *)1 ) | |
2121 pButton->DrawLabel(pWindow->Hint, pFontCreate, 0, 0); | |
2122 pWindow->Release(); | |
2123 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); | |
2124 continue; | |
2125 } | |
2126 case WINDOW_CloseRestWindowBtn: | |
2127 { | |
2128 if ( pWindow->Hint != (char *)1 ) | |
2129 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0); | |
2130 pGUIButton = (GUIButton *)pWindow->ptr_1C; | |
2131 pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, pGUIButton->pTextures[0]); | |
2132 pHint = pWindow->Hint; | |
2133 viewparams->bRedrawGameUI = 1; | |
2134 if ( pHint && pHint != (char *)1 ) | |
2135 pGUIButton->DrawLabel(pHint, pFontCreate, 0, 0); | |
2136 pWindow->Release(); | |
2137 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); | |
2138 continue; | |
2139 } | |
2140 case WINDOW_ExitCharacterWindow: | |
2141 { | |
2142 if ( pWindow->Hint != (char *)1 ) | |
2143 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0); | |
2144 pButton = (GUIButton *)pWindow->ptr_1C; | |
2145 pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, pButton->pTextures[1]); | |
2146 pHint = pWindow->Hint; | |
2147 viewparams->bRedrawGameUI = 1; | |
2148 if ( pHint && pHint != (char *)1 ) | |
2149 pButton->DrawLabel(pHint, pFontCreate, 0, 0); | |
2150 pWindow->Release(); | |
2151 pNumMessages = pMessageQueue_50CBD0->uNumMessages; | |
2152 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); | |
2153 continue; | |
2154 } | |
2155 case WINDOW_RestWindow: | |
2156 { | |
2157 memset(&GUIButton2, 0, 0xBCu); | |
2158 GUIButton2.uZ = 197; | |
2159 GUIButton2.uW = 197; | |
2160 GUIButton2.uX = 27; | |
2161 GUIButton2.uY = 161; | |
2162 GUIButton2.uWidth = 171; | |
2163 GUIButton2.uHeight = 37; | |
2164 GUIButton2.pParent = pButton_RestUI_WaitUntilDawn->pParent; | |
2165 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0); | |
2166 pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, *((Texture **)pWindow->ptr_1C + 15)); | |
2167 viewparams->bRedrawGameUI = 1; | |
2168 GUIButton2.DrawLabel(pGlobalTXT_LocalizationStrings[183], pFontCreate, 0, 0);//Îòäûõ è ëå÷åíèå 8 ÷àñîâ | |
2169 GUIButton2.pParent = 0; | |
2170 pGUIWindow2 = pWindow; | |
2171 pGUIWindow2->Release(); | |
2172 continue; | |
2173 } | |
2174 case WINDOW_BooksWindow: | |
2175 { | |
2176 pButton = (GUIButton *)pWindow->ptr_1C; | |
2177 pRenderer->DrawTextureIndexed(pWindow->uFrameY, | |
2178 pWindow->uFrameX, pButton->pTextures[0]); | |
2179 viewparams->bRedrawGameUI = true; | |
2180 continue; | |
2181 } | |
2182 case WINDOW_CharacterWindow_Inventory: | |
2183 { | |
2184 pWindow->DrawMessageBox(0); | |
2185 pWindow->DrawText(pFontLucida, 10, 20, 0, "Making item number", 0, 0, 0); | |
2186 pWindow->DrawText(pFontLucida, 10, 40, 0, (const char *)pKeyActionMap->pPressedKeysBuffer, 0, 0, 0); | |
2187 if ( !pKeyActionMap->field_204 ) | |
2188 { | |
2189 ItemGen2.Reset(); | |
2190 pWindow->Release(); | |
2191 pEventTimer->Resume(); | |
2192 pCurrentScreen = SCREEN_GAME; | |
2193 viewparams->bRedrawGameUI = 1; | |
2194 v39 = atoi((const char *)pKeyActionMap->pPressedKeysBuffer); | |
2195 if ( v39 > 0 ) | |
2196 { | |
2197 if ( v39 < 800 ) | |
2198 SpawnActor(v39); | |
2199 } | |
2200 } | |
2201 continue; | |
2202 } | |
2203 case WINDOW_KeyMappingOptions: | |
2204 { | |
2205 GameMenuUI_DrawKeyBindings(); | |
2206 continue; | |
2207 } | |
2208 case WINDOW_VideoOptions: | |
2209 { | |
2210 GameMenuUI_DrawVideoOptions(); | |
2211 continue; | |
2212 } | |
2213 default: | |
2214 { | |
2215 continue; | |
2216 } | |
2217 } | |
2218 } | |
2219 if ( GetCurrentMenuID() == -1 ) | |
2220 GameUI_DrawFoodAndGold(); | |
2221 if ( sub_4637E0_is_there_popup_onscreen() ) | |
1802 | 2222 UI_OnMouseRightClick(0); |
1297 | 2223 } |
2224 //----- (00415485) -------------------------------------------------------- | |
2225 void DrawCopyrightWindow() | |
2226 { | |
2227 GUIWindow Dst; // [sp+8h] [bp-54h]@1 | |
2228 | |
2229 memset(&Dst, 0, 0x54u); | |
2230 Dst.uFrameWidth = 624; | |
2231 Dst.uFrameHeight = 256; | |
2232 Dst.uFrameX = 8; | |
2233 Dst.uFrameY = 30; // c 1999 The 3DO Company. | |
2234 Dst.uFrameHeight = pFontSmallnum->CalcTextHeight(pGlobalTXT_LocalizationStrings[157], &Dst, 24, 0) | |
2235 + 2 * LOBYTE(pFontSmallnum->uFontHeight) | |
2236 + 24; | |
2237 Dst.uFrameY = 470 - Dst.uFrameHeight; | |
2238 Dst.uFrameZ = Dst.uFrameX + Dst.uFrameWidth - 1; | |
2239 Dst.uFrameW = 469; | |
2240 //Dst.Hint = "abcagfdsgsg ljsrengvlkjesnfkjwnef"; | |
2241 Dst.DrawMessageBox(0); | |
2242 | |
2243 Dst.uFrameWidth -= 24; | |
2244 Dst.uFrameX += 12; | |
2245 Dst.uFrameY += 12; | |
2246 Dst.uFrameHeight -= 12; | |
2247 Dst.uFrameZ = Dst.uFrameX + Dst.uFrameWidth - 1; | |
2248 Dst.uFrameW = Dst.uFrameY + Dst.uFrameHeight - 1; | |
2249 Dst.DrawTitleText(pFontSmallnum, 0, 0xCu, ui_mainmenu_copyright_color, pGlobalTXT_LocalizationStrings[157], 3); | |
2250 } | |
1458 | 2251 |
2252 | |
2253 | |
2254 | |
2255 int modal_window_prev_screen; | |
2256 | |
2257 //----- (004141CA) -------------------------------------------------------- | |
2258 void ModalWindow(const char *pStrHint, UIMessageType OnRelease_message) | |
2259 { | |
2260 pEventTimer->Pause(); | |
2261 modal_window_prev_screen = pCurrentScreen; | |
2262 pModalWindow = GUIWindow::Create(0, 0, 640, 480, WINDOW_ModalWindow, OnRelease_message, pStrHint); | |
2263 pCurrentScreen = SCREEN_MODAL_WINDOW; | |
2264 } | |
2265 | |
1297 | 2266 //----- (0041420D) -------------------------------------------------------- |
1458 | 2267 void ModalWindow_ShowHint() |
1297 | 2268 { |
2269 GUIWindow pWindow; // [sp+4h] [bp-54h]@1 | |
2270 | |
1458 | 2271 sprintf(pTmpBuf2.data(), "%s\n \n%s", pModalWindow->Hint, pGlobalTXT_LocalizationStrings[61]);// Press Escape |
1297 | 2272 pWindow.Hint = pTmpBuf2.data(); |
2273 pWindow.uFrameWidth = 400; | |
2274 pWindow.uFrameHeight = 100; | |
2275 pWindow.uFrameX = 120; | |
2276 pWindow.uFrameY = 140; | |
2277 pWindow.uFrameZ = 519; | |
2278 pWindow.uFrameW = 239; | |
2279 pWindow.DrawMessageBox(0); | |
2280 } | |
2281 | |
2282 //----- (0041426F) -------------------------------------------------------- | |
1458 | 2283 void ModalWindow_Release() |
1297 | 2284 { |
1458 | 2285 pMessageQueue_50CBD0->AddMessage((UIMessageType)pModalWindow->par1C, 0, 0); |
1297 | 2286 |
1458 | 2287 pModalWindow->Release(); |
2288 pModalWindow = nullptr; | |
1297 | 2289 |
1458 | 2290 pCurrentScreen = modal_window_prev_screen; |
1297 | 2291 pEventTimer->Resume(); |
2292 } | |
2293 | |
2294 //----- (00467FB6) -------------------------------------------------------- | |
2295 void CreateScrollWindow() | |
2296 { | |
2297 unsigned int v0; // eax@1 | |
2298 char *v1; // ST18_4@3 | |
2299 unsigned int v2; // eax@3 | |
2300 GUIWindow a1; // [sp+Ch] [bp-54h]@1 | |
2301 | |
2302 memcpy(&a1, pGUIWindow_ScrollWindow, sizeof(a1)); | |
2303 a1.Hint = 0; | |
2304 a1.uFrameX = 1; | |
2305 a1.uFrameY = 1; | |
2306 a1.uFrameWidth = 468; | |
1312 | 2307 v0 = pFontSmallnum->CalcTextHeight(pScrolls[pGUIWindow_ScrollWindow->par1C], &a1, 0, 0) |
1297 | 2308 + 2 * LOBYTE(pFontCreate->uFontHeight) |
2309 + 24; | |
2310 a1.uFrameHeight = v0; | |
2311 if ( (signed int)(v0 + a1.uFrameY) > 479 ) | |
2312 { | |
2313 v0 = 479 - a1.uFrameY; | |
2314 a1.uFrameHeight = 479 - a1.uFrameY; | |
2315 } | |
2316 a1.uFrameZ = a1.uFrameWidth + a1.uFrameX - 1; | |
2317 a1.uFrameW = v0 + a1.uFrameY - 1; | |
2318 a1.DrawMessageBox(0); | |
2319 a1.uFrameX += 12; | |
2320 a1.uFrameWidth -= 24; | |
2321 a1.uFrameY += 12; | |
2322 a1.uFrameHeight -= 12; | |
2323 a1.uFrameZ = a1.uFrameWidth + a1.uFrameX - 1; | |
2324 a1.uFrameW = a1.uFrameHeight + a1.uFrameY - 1; | |
2325 v1 = pItemsTable->pItems[(unsigned int)pGUIWindow_ScrollWindow->ptr_1C + 700].pName; | |
2326 v2 = TargetColor(0xFFu, 0xFFu, 0x9Bu); | |
2327 sprintf(pTmpBuf.data(), format_4E2D80, v2, v1); | |
2328 a1.DrawTitleText(pFontCreate, 0, 0, 0, pTmpBuf.data(), 3u); | |
2329 a1.DrawText( | |
2330 pFontSmallnum, | |
2331 1, | |
2332 LOBYTE(pFontCreate->uFontHeight) - 3, | |
2333 0, | |
2334 pScrolls[(unsigned int)pGUIWindow_ScrollWindow->ptr_1C], | |
2335 0, | |
2336 0, | |
2337 0); | |
2338 } | |
2339 //----- (00467F48) -------------------------------------------------------- | |
2340 void CreateMsgScrollWindow( signed int mscroll_id ) | |
2341 { | |
2342 signed int v1; // esi@1 | |
2343 | |
2344 v1 = mscroll_id; | |
2345 if ( !pGUIWindow_ScrollWindow && mscroll_id >= 700 ) | |
2346 { | |
2347 if ( mscroll_id <= 782 ) | |
2348 { | |
2349 uTextureID_720980 = pIcons_LOD->LoadTexture("leather", TEXTURE_16BIT_PALETTE); | |
2350 pGUIWindow_ScrollWindow = GUIWindow::Create(0, 0, 640, 480, WINDOW_Scroll, v1 - 700, 0); | |
2351 } | |
2352 } | |
2353 } | |
2354 //----- (00467F9F) -------------------------------------------------------- | |
1458 | 2355 void free_book_subwindow() |
1297 | 2356 { |
2357 if ( pGUIWindow_ScrollWindow ) | |
2358 { | |
2359 pGUIWindow_ScrollWindow->Release(); | |
2360 pGUIWindow_ScrollWindow = 0; | |
2361 } | |
0 | 2362 } |