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