Mercurial > mm7
annotate GUIWindow.cpp @ 994:3431f6abc786
GameUI clean
author | Nomad |
---|---|
date | Tue, 14 May 2013 12:35:06 +0200 |
parents | 9e132060ada3 |
children | 5876a9cafa3e |
rev | line source |
---|---|
0 | 1 #include "GUIWindow.h" |
2 #include "GUIFont.h" | |
3 #include "Party.h" | |
4 #include "LOD.h" | |
5 #include "Keyboard.h" | |
6 #include "IndoorCamera.h" | |
7 #include "Math.h" | |
8 #include "VideoPlayer.h" | |
9 #include "Allocator.h" | |
10 #include "MapInfo.h" | |
11 #include "Time.h" | |
12 #include "AudioPlayer.h" | |
13 #include "Mouse.h" | |
14 #include "Viewport.h" | |
15 #include "Render.h" | |
16 #include "PlayerFrameTable.h" | |
17 #include "SaveLoad.h" | |
18 #include "FactionTable.h" | |
19 #include "StorylineTextTable.h" | |
20 #include "Events2D.h" | |
629 | 21 #include "UIHouses.h" |
189 | 22 #include "texts.h" |
81
377535d6e366
structure boundaries fixed in many places. fixed quests, notes, awards, calendar.
zipi
parents:
74
diff
changeset
|
23 #include "Autonotes.h" |
949 | 24 #include "Awards.h" |
0 | 25 |
26 | |
27 #include "mm7_data.h" | |
28 | |
29 | |
30 | |
31 | |
32 int pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[1]; // idb | |
33 struct GUIWindow *pWindow_MainMenu; | |
34 struct GUIWindow pWindowList[20]; | |
35 | |
36 struct GUIMessageQueue *pMessageQueue_50CBD0 = new GUIMessageQueue; | |
37 | |
38 | |
783 | 39 // inlined |
40 //----- (mm6c::00420520) -------------------------------------------------- | |
41 void GUIMessageQueue::Flush() | |
42 { | |
43 if (uNumMessages) | |
44 uNumMessages = pMessages[0].field_8 != 0; | |
45 } | |
46 | |
47 | |
0 | 48 //----- (004356B9) -------------------------------------------------------- |
49 void GUIMessageQueue::PopMessage(enum UIMessageType *pType, int *pParam, int *a4) | |
50 { | |
51 signed int v4; // edx@1 | |
52 GUIMessage *v5; // eax@2 | |
53 | |
54 v4 = 0; | |
55 if ( this->uNumMessages ) | |
56 { | |
57 v5 = this->pMessages; | |
58 *pType = this->pMessages[0].eType; | |
59 *pParam = this->pMessages[0].param; | |
60 *a4 = this->pMessages[0].field_8; | |
61 if ( (signed int)(this->uNumMessages - 1) > 0 ) | |
62 { | |
63 do | |
64 { | |
65 v5->eType = v5[1].eType; | |
66 v5->param = v5[1].param; | |
67 v5->field_8 = v5[1].field_8; | |
68 ++v4; | |
69 ++v5; | |
70 } | |
71 while ( v4 < (signed int)(this->uNumMessages - 1) ); | |
72 } | |
73 --this->uNumMessages; | |
74 } | |
75 } | |
76 | |
77 | |
78 | |
994 | 79 |
80 | |
81 | |
82 //----- (0041B4E1) -------------------------------------------------------- | |
83 int __fastcall GUI_ReplaceHotkey(unsigned __int8 uOldHotkey, unsigned __int8 uNewHotkey, char bFirstCall) | |
84 { | |
85 unsigned __int8 v3; // bl@1 | |
86 int result; // eax@1 | |
87 int i; // edx@2 | |
88 GUIButton *j; // ecx@3 | |
89 int k; // edx@7 | |
90 GUIButton *l; // ecx@8 | |
91 unsigned __int8 v9; // [sp+4h] [bp-8h]@1 | |
92 char v10; // [sp+8h] [bp-4h]@1 | |
93 | |
94 v3 = uNewHotkey; | |
95 v10 = toupper(uOldHotkey); | |
96 result = toupper(v3); | |
97 v9 = result; | |
98 if ( bFirstCall ) | |
99 { | |
100 for ( i = uNumVisibleWindows; i >= 0; --i ) | |
101 { | |
102 result = 84 * pVisibleWindowsIdxs[i]; | |
103 //for ( j = *(GUIButton **)((char *)pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_ + result); j; j = j->pNext ) | |
104 for ( j = pWindowList[pVisibleWindowsIdxs[i] - 1].pControlsHead; j; j = j->pNext ) | |
105 j->field_28 = 0; | |
106 } | |
107 } | |
108 for ( k = uNumVisibleWindows; k >= 0; --k ) | |
109 { | |
110 result = 84 * pVisibleWindowsIdxs[k]; | |
111 //for ( l = *(GUIButton **)((char *)pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_ + result); l; l = l->pNext ) | |
112 for ( l = pWindowList[pVisibleWindowsIdxs[k] - 1].pControlsHead; l; l = l->pNext ) | |
113 { | |
114 LOBYTE(result) = v10; | |
115 if ( l->uHotkey == v10 ) | |
116 { | |
117 if ( !l->field_28 ) | |
118 { | |
119 LOBYTE(result) = v9; | |
120 l->field_28 = 1; | |
121 l->uHotkey = v9; | |
122 } | |
123 } | |
124 } | |
125 } | |
126 return result; | |
127 } | |
128 | |
129 | |
130 | |
131 | |
132 //----- (0041B438) -------------------------------------------------------- | |
133 GUIButton *__fastcall GUI_HandleHotkey(unsigned __int8 uHotkey) | |
134 { | |
135 char v1; // al@1 | |
136 int v2; // esi@1 | |
137 char v3; // dl@1 | |
138 GUIWindow *v4; // ecx@2 | |
139 GUIButton *result; // eax@2 | |
140 //int v6; // edx@12 | |
141 | |
142 v1 = toupper(uHotkey); | |
143 v2 = uNumVisibleWindows; | |
144 v3 = v1; | |
145 if ( uNumVisibleWindows >= 0 ) | |
146 { | |
147 while ( 2 ) | |
148 { | |
149 v4 = &pWindowList[pVisibleWindowsIdxs[v2] - 1]; | |
150 for ( result = v4->pControlsHead; result; result = result->pNext ) | |
151 { | |
152 if ( result->uHotkey == v3 ) | |
153 { | |
154 pMessageQueue_50CBD0->AddMessage(result->msg, result->msg_param, 0); | |
155 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) | |
156 { | |
157 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)result->uControlID; | |
158 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v6; | |
159 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
160 ++pMessageQueue_50CBD0->uNumMessages; | |
161 }*/ | |
162 return result; | |
163 } | |
164 } | |
165 if ( v4->uFrameX || v4->uFrameY || !(v4->uFrameWidth == 640 & v4->uFrameHeight == 480) ) | |
166 { | |
167 --v2; | |
168 if ( v2 >= 0 ) | |
169 continue; | |
170 } | |
171 break; | |
172 } | |
173 } | |
174 return 0; | |
175 } | |
176 // 5075E0: using guessed type int pVisibleWindowsIdxs[20]; | |
177 | |
0 | 178 //----- (0041D73D) -------------------------------------------------------- |
179 char GUIWindow::_41D73D_draw_buff_tooltip() | |
180 { | |
181 GUIFont *v1; // esi@1 | |
182 GUIWindow *v2; // edi@1 | |
183 SpellBuff *v3; // eax@1 | |
184 unsigned int v4; // eax@5 | |
185 int v5; // ecx@5 | |
186 unsigned int v6; // eax@5 | |
187 unsigned int v7; // ecx@5 | |
188 char *v8; // ebx@7 | |
189 unsigned int v9; // eax@8 | |
190 unsigned int v10; // ecx@8 | |
191 __int64 v11; // ST28_8@11 | |
192 int v12; // esi@11 | |
193 const char *v13; // ST0C_4@11 | |
194 unsigned int v14; // eax@11 | |
195 char **v16; // [sp+14h] [bp-10h]@7 | |
196 GUIFont *a2; // [sp+18h] [bp-Ch]@1 | |
197 SpellBuff *v18; // [sp+1Ch] [bp-8h]@7 | |
198 int v19; // [sp+20h] [bp-4h]@1 | |
199 int v20; // [sp+20h] [bp-4h]@7 | |
200 | |
201 v1 = pFontComic; | |
202 v2 = this; | |
203 a2 = pFontComic; | |
204 v19 = 0; | |
205 v3 = pParty->pPartyBuffs; | |
206 do | |
207 { | |
208 if ( (signed __int64)v3->uExpireTime > 0 ) | |
209 ++v19; | |
210 ++v3; | |
211 } | |
212 while ( (signed int)v3 < (signed int)pParty->pPlayers ); | |
213 v4 = LOBYTE(pFontArrus->uFontHeight) + 72; | |
214 this->uFrameHeight = v4; | |
215 v5 = v4 + (v19 - 1) * LOBYTE(pFontArrus->uFontHeight); | |
216 v6 = v2->uFrameWidth; | |
217 v2->uFrameHeight = v5; | |
218 v7 = v2->uFrameHeight; | |
219 v2->uFrameZ = v6 + v2->uFrameX - 1; | |
220 v2->uFrameW = v2->uFrameY + v7 - 1; | |
221 v2->DrawMessageBox(0); | |
222 v2->DrawTitleText(pFontArrus, 0, 0xCu, 0, pGlobalTXT_LocalizationStrings[451], 3u); | |
223 if ( !v19 ) | |
224 v2->DrawTitleText(v1, 0, 0x28u, 0, pGlobalTXT_LocalizationStrings[153], 3u); | |
225 v20 = 0; | |
226 GetTickCount(); | |
227 v8 = &_4E2B21_buff_spell_tooltip_colors[1]; | |
228 v16 = aSpellNames; | |
229 v18 = pParty->pPartyBuffs; | |
230 do | |
231 { | |
232 v9 = LODWORD(v18->uExpireTime); | |
233 v10 = HIDWORD(v18->uExpireTime); | |
17 | 234 if ( (v10 & 0x80000000u) == 0 && ((signed int)v10 > 0 || v9) )//!!! |
0 | 235 { |
17 | 236 v11 = __PAIR__(v10, v9) - pParty->uTimePlayed;//!!! |
0 | 237 v12 = v20 * LOBYTE(v1->uFontHeight) + 40; |
238 v13 = *v16; | |
239 ++v20; | |
949 | 240 v14 = TargetColor( |
0 | 241 (unsigned __int8)*(v8 - 1), |
242 (unsigned __int8)*v8, | |
243 (unsigned __int8)v8[1]); | |
244 v2->DrawText(a2, 52, v12, v14, v13, 0, 0, 0); | |
245 LOBYTE(v9) = sub_41D20D_buff_remaining_time_string(v12, v2, v11, a2); | |
246 v1 = a2; | |
247 } | |
248 ++v18; | |
249 ++v16; | |
250 v8 += 3; | |
251 } | |
252 while ( (signed int)v18 < (signed int)pParty->pPlayers ); | |
253 return v9; | |
254 } | |
255 | |
256 | |
257 //----- (0041D3B7) -------------------------------------------------------- | |
688 | 258 void GUIWindow::DrawQuickCharRecord() |
259 { | |
0 | 260 Player *pPlayer; // esi@1 |
261 int v6; // eax@5 | |
262 int v7; // ebx@5 | |
263 unsigned int v8; // ecx@5 | |
264 int v9; // ebx@5 | |
265 unsigned int v10; // eax@5 | |
266 int v11; // eax@5 | |
267 unsigned int v12; // ecx@5 | |
268 Texture *v13; // eax@6 | |
269 unsigned int v14; // eax@12 | |
270 PlayerFrame *v15; // eax@12 | |
271 unsigned int v16; // eax@15 | |
272 unsigned int v20; // eax@15 | |
273 unsigned int v24; // eax@15 | |
274 unsigned int v25; // eax@15 | |
275 unsigned __int8 v28; // al@15 | |
276 char *v29; // eax@16 | |
277 __int64 v35; // ST38_8@22 | |
278 int v36; // esi@22 | |
279 unsigned int v38; // eax@22 | |
280 char *v39; // eax@24 | |
281 signed int uFramesetID; // [sp+20h] [bp-8h]@9 | |
282 int uFramesetIDa; // [sp+20h] [bp-8h]@18 | |
283 | |
284 pPlayer = &pParty->pPlayers[(unsigned int)ptr_1C]; | |
285 | |
286 uint numActivePlayerBuffs = 0; | |
287 | |
288 for (uint i = 0; i < 24; ++i) | |
289 if (pPlayer->pPlayerBuffs[i].uExpireTime > 0) | |
290 ++numActivePlayerBuffs; | |
291 | |
292 v6 = pFontArrus->uFontHeight + 162; | |
293 uFrameHeight = v6; | |
294 v7 = (numActivePlayerBuffs - 1) * pFontArrus->uFontHeight; | |
295 v8 = uFrameX; | |
296 v9 = v6 + v7; | |
297 v10 = uFrameWidth; | |
298 uFrameHeight = v9; | |
299 v11 = v10 + v8 - 1; | |
300 v12 = uFrameY; | |
301 uFrameZ = v11; | |
302 uFrameW = v9 + v12 - 1; | |
303 DrawMessageBox(0); | |
304 if (pPlayer->Eradicated()) | |
305 v13 = pTexture_PlayerFaceEradicated; | |
306 else if (pPlayer->Dead()) | |
307 v13 = pTexture_PlayerFaceDead; | |
308 else | |
309 { | |
130 | 310 uFramesetID = pPlayerFrameTable->GetFrameIdByExpression(pPlayer->expression); |
0 | 311 if ( !uFramesetID ) |
312 uFramesetID = 1; | |
130 | 313 if ( pPlayer->expression == CHARACTER_EXPRESSION_21) |
0 | 314 { |
554
9caf59edb1ee
Cave and Temple load and even doesn't crash (for a while).
Nomad
parents:
526
diff
changeset
|
315 v15 = pPlayerFrameTable->GetFrameBy_y(&pPlayer->_expression21_frameset, &pPlayer->_expression21_animtime, pMiscTimer->uTimeElapsed); |
0 | 316 } |
317 else | |
318 { | |
319 v14 = pMiscTimer->Time(); | |
320 v15 = pPlayerFrameTable->GetFrameBy_x(uFramesetID, v14); | |
321 } | |
322 pPlayer->field_1AA2 = v15->uTextureID - 1; | |
312 | 323 v13 = pTextures_PlayerFaces[(unsigned int)ptr_1C][v15->uTextureID-1]; |
0 | 324 } |
325 | |
326 pRenderer->DrawTextureTransparent(uFrameX + 24, uFrameY + 24, v13); | |
949 | 327 v16 = TargetColor(0xFFu, 0xFFu, 0x9Bu); |
688 | 328 sprintf(pTmpBuf, "\f%05d", v16); |
264 | 329 sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[429], pPlayer->pName, pClassNames[pPlayer->classType]); |
0 | 330 strcat(pTmpBuf, pTmpBuf2); |
688 | 331 strcat(pTmpBuf, "\f00000\n"); |
0 | 332 v20 = UI_GetHealthManaStringColor(pPlayer->sHealth, pPlayer->GetMaxHealth()); |
688 | 333 sprintf(pTmpBuf2, "%s : \f%05u%d\f00000 / %d\n", pGlobalTXT_LocalizationStrings[108], |
0 | 334 v20, pPlayer->sHealth, pPlayer->GetMaxHealth()); |
335 strcat(pTmpBuf, pTmpBuf2); | |
336 v24 = UI_GetHealthManaStringColor(pPlayer->sMana, pPlayer->GetMaxMana()); | |
688 | 337 sprintf(pTmpBuf2, "%s : \f%05u%d\f00000 / %d\n", pGlobalTXT_LocalizationStrings[212], |
0 | 338 v24, pPlayer->sMana, pPlayer->GetMaxMana()); |
339 strcat(pTmpBuf, pTmpBuf2); | |
340 v25 = pPlayer->GetMajorConditionIdx(); | |
688 | 341 sprintf(pTmpBuf2, "%s: \f%05d%s\f00000\n", pGlobalTXT_LocalizationStrings[47], |
0 | 342 GetConditionDrawColor(v25), aCharacterConditionNames[v25]); |
343 strcat(pTmpBuf, pTmpBuf2); | |
344 v28 = pPlayer->uQuickSpell; | |
345 if ( v28 ) | |
346 v29 = pSpellStats->pInfos[v28].pShortName; | |
347 else | |
348 v29 = pGlobalTXT_LocalizationStrings[153]; | |
189 | 349 sprintf((char*)pTmpBuf2, "%s: %s", (char*)pGlobalTXT_LocalizationStrings[172], v29); |
350 strcat((char*)pTmpBuf, (char*)pTmpBuf2); | |
0 | 351 DrawText(pFontArrus, 120, 22, 0, pTmpBuf, 0, 0, 0); |
352 | |
353 uFramesetIDa = 0; | |
354 for (uint i = 0; i < 24; ++i) | |
355 { | |
356 auto buff = pPlayer->pPlayerBuffs + i; | |
357 if (buff->uExpireTime > 0) | |
358 { | |
359 v35 = buff->uExpireTime - pParty->uTimePlayed; | |
360 v36 = uFramesetIDa++ * pFontComic->uFontHeight + 134; | |
949 | 361 v38 = TargetColor( |
0 | 362 _4E2AD8_ui_colors[i * 3], |
363 _4E2AD8_ui_colors[i * 3 + 1], | |
364 _4E2AD8_ui_colors[i * 3 + 2]); | |
365 DrawText(pFontComic, 52, v36, v38, aSpellNames[20 + i], 0, 0, 0); | |
366 sub_41D20D_buff_remaining_time_string(v36, this, v35, pFontComic); | |
367 } | |
368 } | |
369 | |
370 v39 = ""; | |
371 if ( uFramesetIDa == 0 ) | |
372 v39 = pGlobalTXT_LocalizationStrings[153]; | |
373 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[450], v39); | |
688 | 374 DrawText(pFontArrus, 14, 114, 0, pTmpBuf, 0, 0, 0); |
0 | 375 } |
376 | |
377 //----- (0041D08F) -------------------------------------------------------- | |
972 | 378 void GUIWindow::_41D08F_set_keyboard_control_group(int a2, int a3, int a4, int a5) |
0 | 379 { |
380 if ( a2 ) | |
381 { | |
382 this->pNumPresenceButton = a2; | |
383 this->field_30 = a3; | |
384 this->field_34 = a4; | |
385 this->pCurrentPosActiveItem = a5; | |
386 this->pStartingPosActiveItem = a5; | |
972 | 387 this->receives_keyboard_input = true; |
0 | 388 } |
389 else | |
390 { | |
391 this->pNumPresenceButton = 0; | |
392 this->field_30 = a3; | |
393 this->field_34 = a4; | |
394 this->pCurrentPosActiveItem = 0; | |
395 this->pStartingPosActiveItem = 0; | |
972 | 396 this->receives_keyboard_input = false; |
0 | 397 } |
398 } | |
399 | |
400 | |
401 //----- (0041C26A) -------------------------------------------------------- | |
402 void GUIWindow::Release() | |
403 { | |
961 | 404 //GUIWindow *v1; // esi@1 |
0 | 405 int i; // edi@20 |
961 | 406 //GUIButton *v8; // eax@26 |
407 GUIButton *pNextBtn; // edi@27 | |
408 //int v10; // esi@28 | |
409 //int v11; // ecx@28 | |
0 | 410 int v12; // edx@29 |
411 | |
961 | 412 //v1 = this; |
0 | 413 if ( !this ) |
414 return; | |
696 | 415 |
416 switch( this->eWindowType ) | |
0 | 417 { |
696 | 418 case WINDOW_GreetingNPC: |
419 { | |
420 pIcons_LOD->_40F9C5(); | |
421 pCurrentScreen = pMainScreenNum; | |
422 pKeyActionMap->_459ED1(3); | |
423 break; | |
424 } | |
425 case WINDOW_HouseInterior: | |
426 { | |
427 for ( i = 0; i < uNumDialogueNPCPortraits; ++i ) | |
428 pDialogueNPCPortraits[i]->Release(); | |
429 uNumDialogueNPCPortraits = 0; | |
430 pTexture_Dialogue_Background->Release(); | |
0 | 431 |
696 | 432 pIcons_LOD->_40F9C5(); |
433 pIcons_LOD->_4114F2(); | |
434 dword_5C35D4 = 0; | |
435 if ( bFlipOnExit ) | |
436 { | |
437 pIndoorCamera->sRotationY = (stru_5C6E00->uIntegerDoublePi - 1) & (stru_5C6E00->uIntegerPi | |
438 + pIndoorCamera->sRotationY); | |
439 pParty->sRotationY = pIndoorCamera->sRotationY; | |
440 } | |
441 pParty->uFlags |= 2u; | |
442 break; | |
443 } | |
444 case WINDOW_Transition: | |
445 { | |
446 pVideoPlayer->Unload(); | |
447 pTexture_outside->Release(); | |
448 pTexture_Dialogue_Background->Release(); | |
449 pIcons_LOD->_40F9C5(); | |
450 pCurrentScreen = pMainScreenNum; | |
451 break; | |
452 } | |
453 case WINDOW_SpellBook: | |
454 { | |
455 sub_41140B(); | |
456 sub_411473(); | |
457 break; | |
458 } | |
459 case WINDOW_Book: | |
460 { | |
960 | 461 OnCloseSpellBook(); |
696 | 462 break; |
463 } | |
464 case WINDOW_ChangeLocation: | |
465 { | |
0 | 466 pTexture_outside->Release(); |
467 pTexture_Dialogue_Background->Release(); | |
468 pIcons_LOD->_40F9C5(); | |
11 | 469 pCurrentScreen = pMainScreenNum; |
696 | 470 break; |
471 } | |
472 case WINDOW_Dialogue: | |
473 { | |
474 if ( !dword_591084 ) | |
475 pDialogueNPCPortraits[0]->Release(); | |
476 uNumDialogueNPCPortraits = 0; | |
477 pTexture_Dialogue_Background->Release(); | |
478 | |
479 pIcons_LOD->_40F9C5(); | |
480 pCurrentScreen = pMainScreenNum; | |
481 } | |
482 default: | |
483 { | |
484 break; | |
485 } | |
0 | 486 } |
961 | 487 //v8 = this->pControlsHead; |
488 if ( this->pControlsHead ) | |
0 | 489 { |
490 do | |
491 { | |
961 | 492 pNextBtn = this->pControlsHead->pNext; |
493 pAllocator->FreeChunk(this->pControlsHead); | |
494 this->pControlsHead = pNextBtn; | |
0 | 495 } |
961 | 496 while ( pNextBtn ); |
0 | 497 } |
961 | 498 this->pControlsHead = 0; |
499 this->pControlsTail = 0; | |
500 this->uNumControls = 0; | |
501 this->eWindowType = WINDOW_null; | |
502 while ( this->numVisibleWindows < uNumVisibleWindows ) | |
0 | 503 { |
961 | 504 v12 = pVisibleWindowsIdxs[this->numVisibleWindows + 1]; |
505 pVisibleWindowsIdxs[this->numVisibleWindows] = v12; | |
962 | 506 --pWindowList[v12 - 1].numVisibleWindows; |
961 | 507 ++this->numVisibleWindows; |
0 | 508 } |
961 | 509 pVisibleWindowsIdxs[uNumVisibleWindows] = 0; |
510 uNumVisibleWindows = uNumVisibleWindows - 1; | |
0 | 511 } |
512 | |
513 | |
514 | |
515 | |
516 | |
517 | |
518 //----- (0041CD3B) -------------------------------------------------------- | |
519 GUIButton *GUIWindow::GetControl(unsigned int uID) | |
520 { | |
521 GUIButton *result; // eax@1 | |
522 unsigned int v3; // ecx@1 | |
523 | |
524 result = this->pControlsHead; | |
525 v3 = uID; | |
526 if ( (signed int)uID > 0 ) | |
527 { | |
528 do | |
529 { | |
530 result = result->pNext; | |
531 --v3; | |
532 } | |
533 while ( v3 ); | |
534 } | |
535 return result; | |
536 } | |
537 | |
538 //----- (00411BFC) -------------------------------------------------------- | |
539 void GUIWindow::InitializeBookView() | |
540 { | |
541 GUIWindow *v1; // ebp@1 | |
542 signed int v2; // ecx@8 | |
543 __int64 *v3; // ebp@9 | |
544 char *v4; // ecx@10 | |
545 char *v5; // eax@12 | |
546 int v6; // eax@12 | |
547 __int64 v7; // qax@12 | |
548 unsigned int v8; // esi@12 | |
549 GUIButton *v9; // eax@19 | |
550 signed int v10; // esi@19 | |
551 int v11; // eax@24 | |
552 int v12; // eax@27 | |
553 int i; // esi@28 | |
554 char *v14; // ebp@29 | |
555 int v15; // eax@31 | |
710 | 556 //unsigned int v16; // esi@35 |
0 | 557 Player *v17; // esi@38 |
558 unsigned __int16 v18; // ax@38 | |
559 unsigned int v19; // edi@43 | |
560 unsigned int v20; // edi@45 | |
561 void *v21; // esi@45 | |
562 signed int v23; // [sp+10h] [bp-5Ch]@38 | |
563 char *v25; // [sp+14h] [bp-58h]@21 | |
564 GUIWindow v26; // [sp+18h] [bp-54h]@8 | |
565 | |
566 v1 = this; | |
567 pAudioPlayer->StopChannels(-1, -1); | |
568 InitializeBookFonts(); | |
832 | 569 v1->CreateButton(0x1DBu, 0x1BDu, 0x9Eu, 0x22u, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[79], 0); // Close |
151 | 570 pCurrentScreen = SCREEN_BOOKS; |
949 | 571 num_achieved_awards_2 = 0; |
0 | 572 dword_506528 = 0; |
573 dword_50651C = 0; | |
949 | 574 num_achieved_awards = 0; |
688 | 575 switch (v1->par1C) |
576 { | |
961 | 577 case WINDOW_LloydsBeacon:{ |
688 | 578 byte_506360 = 0; |
948 | 579 pTexture_CurrentBook = pIcons_LOD->LoadTexturePtr("lb_bordr", TEXTURE_16BIT_PALETTE); |
580 pTexture_LloydBeacons[0] = pIcons_LOD->LoadTexturePtr("sbmap", TEXTURE_16BIT_PALETTE); | |
581 pTexture_50635C = pIcons_LOD->LoadTexturePtr("sbmap", TEXTURE_16BIT_PALETTE); | |
582 pTex_tab_an_6b__zoom_on = pIcons_LOD->LoadTexturePtr("tab-an-6b", TEXTURE_16BIT_PALETTE); | |
583 pTex_tab_an_6a__zoom_off = pIcons_LOD->LoadTexturePtr("tab-an-6a", TEXTURE_16BIT_PALETTE); | |
584 | |
961 | 585 pBtn_Book_1 = v1->CreateButton(415, 13, 39, 36, 1, 0, UIMSG_LloydsBeacon_FlippingBtn, 0, 0, pGlobalTXT_LocalizationStrings[375], 0); // Set Beacon |
586 pBtn_Book_2 = v1->CreateButton(415, 48, 39, 36, 1, 0, UIMSG_LloydsBeacon_FlippingBtn, 1, 0, pGlobalTXT_LocalizationStrings[523], 0); // Recall Beacon | |
948 | 587 |
688 | 588 v17 = &pParty->pPlayers[_506348_current_lloyd_playerid]; |
589 v23 = 1; | |
590 v18 = v17->pActiveSkills[14]; | |
591 if ( HIBYTE(v18) & 1 || (v18 & 0x80u) != 0 ) | |
592 { | |
593 v23 = 5; | |
594 } | |
595 else | |
596 { | |
597 if ( v18 & 0x40 ) | |
598 v23 = 3; | |
599 } | |
600 v19 = 0; | |
601 if ( v23 > 0 ) | |
602 { | |
603 do | |
604 { | |
961 | 605 v1->CreateButton(pLloydsBeaconsPreviewXs[v19], pLloydsBeaconsPreviewYs[v19], 0x5Cu, 0x44u, 1, 180, UIMSG_InstallBeacon, v19, 0, "", 0); |
688 | 606 ++v19; |
607 } | |
608 while ( (signed int)v19 < v23 ); | |
609 } | |
610 v20 = 0; | |
611 v21 = v17->pInstalledBeacons; | |
0 | 612 do |
688 | 613 { |
614 if ( *(_QWORD *)v21 >= (signed __int64)pParty->uTimePlayed ) | |
615 LoadThumbnailLloydTexture(v20, _506348_current_lloyd_playerid + 1); | |
616 else | |
617 memset(v21, 0, 0x1Cu); | |
618 ++v20; | |
619 v21 = (char *)v21 + 28; | |
620 } | |
621 while ( (signed int)v20 < 5 ); | |
0 | 622 } |
688 | 623 break; |
710 | 624 |
625 case WINDOW_TownPortal: | |
626 { | |
948 | 627 pTexture_CurrentBook = pIcons_LOD->LoadTexturePtr("townport", TEXTURE_16BIT_PALETTE); |
710 | 628 pTexture_TownPortalIcons[0] = pIcons_LOD->LoadTexturePtr("tpharmndy", TEXTURE_16BIT_PALETTE); |
629 pTexture_TownPortalIcons[1] = pIcons_LOD->LoadTexturePtr("tpelf", TEXTURE_16BIT_PALETTE); | |
630 pTexture_TownPortalIcons[2] = pIcons_LOD->LoadTexturePtr("tpwarlock", TEXTURE_16BIT_PALETTE); | |
631 pTexture_TownPortalIcons[3] = pIcons_LOD->LoadTexturePtr("tpisland", TEXTURE_16BIT_PALETTE); | |
632 pTexture_TownPortalIcons[4] = pIcons_LOD->LoadTexturePtr("tpheaven", TEXTURE_16BIT_PALETTE); | |
730 | 633 pTexture_TownPortalIcons[5] = pIcons_LOD->LoadTexturePtr("tphell", TEXTURE_16BIT_PALETTE); |
710 | 634 |
635 for (uint i = 0; i < 6; ++i) | |
961 | 636 v1->CreateButton(pTownPortalBook_xs[i], pTownPortalBook_ys[i], pTownPortalBook_ws[i], pTownPortalBook_hs[i], 1, 182, UIMSG_ClickTownInTP, i, 0, "", nullptr); |
710 | 637 /*v16 = 0; |
0 | 638 do |
688 | 639 { |
640 v1->CreateButton(pTownPortalBook_xs[v16], pTownPortalBook_ys[v16], pTownPortalBook_ws[v16], pTownPortalBook_hs[v16], 1, 182, 0xB7u, v16, 0, "", 0); | |
641 ++v16; | |
642 } | |
710 | 643 while ( (signed int)v16 < 6 );*/ |
644 } | |
645 break; | |
646 | |
647 case WINDOW_QuestBook: | |
948 | 648 { |
649 pTexture_CurrentBook = pIcons_LOD->LoadTexturePtr("sbquiknot", TEXTURE_16BIT_PALETTE); | |
650 pSpellBookPagesTextr_10 = pIcons_LOD->LoadTexturePtr( "divbar", TEXTURE_16BIT_PALETTE); | |
651 pTex_tab_an_6b__zoom_on = pIcons_LOD->LoadTexturePtr("tab-an-6b", TEXTURE_16BIT_PALETTE); | |
652 pTex_tab_an_7b__zoot_on = pIcons_LOD->LoadTexturePtr("tab-an-7b", TEXTURE_16BIT_PALETTE); | |
653 pTex_tab_an_6a__zoom_off = pIcons_LOD->LoadTexturePtr("tab-an-6a", TEXTURE_16BIT_PALETTE); | |
654 pTex_tab_an_7a__zoot_off = pIcons_LOD->LoadTexturePtr("tab-an-7a", TEXTURE_16BIT_PALETTE); | |
655 pBtn_Book_1 = v1->CreateButton(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 1, | |
656 pTex_tab_an_6b__zoom_on->uTextureWidth, pTex_tab_an_6b__zoom_on->uTextureHeight, | |
657 1, 0, UIMSG_AutonotesBook, 0xBu, 0, pGlobalTXT_LocalizationStrings[192],// "Scroll Up" | |
658 pTex_tab_an_6b__zoom_on, 0); | |
659 pBtn_Book_2 = v1->CreateButton(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 38, | |
660 pTex_tab_an_7b__zoot_on->uTextureHeight, pTex_tab_an_7b__zoot_on->uTextureHeight, | |
661 1, 0, UIMSG_AutonotesBook, 0xAu, 0, pGlobalTXT_LocalizationStrings[193],// "Scroll Down" | |
662 pTex_tab_an_7b__zoot_on, 0); | |
949 | 663 num_achieved_awards = 0; |
664 memset(achieved_awards, 0, 4000); | |
688 | 665 for ( i = dword_506528; i < 512; ++i ) |
666 { | |
81
377535d6e366
structure boundaries fixed in many places. fixed quests, notes, awards, calendar.
zipi
parents:
74
diff
changeset
|
667 v14 = (char *)pQuestTable[i-1];//(&dword_722F10)[4 * i]; |
521 | 668 if ( _449B57_test_bit(pParty->_quest_bits, i) && v14 ) |
0 | 669 { |
949 | 670 v15 = num_achieved_awards++; |
671 achieved_awards[v15] = (AwardType)i; | |
0 | 672 } |
673 } | |
949 | 674 v12 = num_achieved_awards; |
675 num_achieved_awards = 0; | |
676 num_achieved_awards_2 = v12; | |
688 | 677 } |
678 break; | |
981 | 679 |
680 | |
710 | 681 case WINDOW_AutonotesBook: |
688 | 682 { |
948 | 683 pTexture_AutonotesBook = pIcons_LOD->LoadTexturePtr("sbautnot", TEXTURE_16BIT_PALETTE); |
684 pSpellBookPagesTextr_10 = pIcons_LOD->LoadTexturePtr("divbar", TEXTURE_16BIT_PALETTE); | |
685 pTex_tab_an_6b__zoom_on = pIcons_LOD->LoadTexturePtr("tab-an-6b", TEXTURE_16BIT_PALETTE); | |
686 pTex_tab_an_7b__zoot_on = pIcons_LOD->LoadTexturePtr("tab-an-7b", TEXTURE_16BIT_PALETTE); | |
687 pTex_tab_an_6a__zoom_off = pIcons_LOD->LoadTexturePtr("tab-an-6a", TEXTURE_16BIT_PALETTE); | |
688 pTex_tab_an_7a__zoot_off = pIcons_LOD->LoadTexturePtr("tab-an-7a", TEXTURE_16BIT_PALETTE); | |
689 pTexture_506394 = pIcons_LOD->LoadTexturePtr("tab-an-1b", TEXTURE_16BIT_PALETTE); | |
690 pTexture_506390 = pIcons_LOD->LoadTexturePtr("tab-an-1a", TEXTURE_16BIT_PALETTE); | |
691 pTexture_50638C = pIcons_LOD->LoadTexturePtr("tab-an-2b", TEXTURE_16BIT_PALETTE); | |
692 pTexture_506388 = pIcons_LOD->LoadTexturePtr("tab-an-2a", TEXTURE_16BIT_PALETTE); | |
693 pTexture_506384 = pIcons_LOD->LoadTexturePtr("tab-an-3b", TEXTURE_16BIT_PALETTE); | |
694 pTexture_506380 = pIcons_LOD->LoadTexturePtr("tab-an-3a", TEXTURE_16BIT_PALETTE); | |
695 pTexture_50637C = pIcons_LOD->LoadTexturePtr("tab-an-5b", TEXTURE_16BIT_PALETTE); | |
696 pTexture_506378 = pIcons_LOD->LoadTexturePtr("tab-an-5a", TEXTURE_16BIT_PALETTE); | |
697 pTexture_506374 = pIcons_LOD->LoadTexturePtr("tab-an-4b", TEXTURE_16BIT_PALETTE); | |
698 pTexture_506370 = pIcons_LOD->LoadTexturePtr("tab-an-4a", TEXTURE_16BIT_PALETTE); | |
699 pTexture_50636C = pIcons_LOD->LoadTexturePtr("tab-an-8b", TEXTURE_16BIT_PALETTE); | |
700 pTexture_506368 = pIcons_LOD->LoadTexturePtr("tab-an-8a", TEXTURE_16BIT_PALETTE); | |
701 | |
702 pBtn_Book_1 = v1->CreateButton(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 1, 50, 34, 1, 0, UIMSG_AutonotesBook, 11, 0, pGlobalTXT_LocalizationStrings[193], pTex_tab_an_6b__zoom_on, 0); | |
703 pBtn_Book_2 = v1->CreateButton(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 38, 50, 34, 1, 0, UIMSG_AutonotesBook, 10, 0, pGlobalTXT_LocalizationStrings[192], pTex_tab_an_7b__zoot_on, 0); | |
704 pBtn_Book_3 = v1->CreateButton(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 113, 50, 34, 1, 0, UIMSG_AutonotesBook, 2, 0, pGlobalTXT_LocalizationStrings[85], pTexture_506394, 0); // "Potion Notes" | |
705 pBtn_Book_4 = v1->CreateButton(pViewport->uViewportTL_X + 399, pViewport->uViewportTL_Y + 150, 50, 34, 1, 0, UIMSG_AutonotesBook, 3, 0, pGlobalTXT_LocalizationStrings[137], pTexture_50638C, 0); // "Fountain Notes" | |
706 pBtn_Book_5 = v1->CreateButton(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 188, 50, 34, 1, 0, UIMSG_AutonotesBook, 4, 0, pGlobalTXT_LocalizationStrings[8], pTexture_506384, 0); // "Obelisk Notes" | |
707 pBtn_Book_6 = v1->CreateButton(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 226, 50, 34, 1, 0, UIMSG_AutonotesBook, 5, 0, pGlobalTXT_LocalizationStrings[141], pTexture_50637C, 0); // "Seer Notes" | |
708 pBtn_Autonotes_Misc = v1->CreateButton(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 264, 50, 34, 1, 0, UIMSG_AutonotesBook, 6, 0, pGlobalTXT_LocalizationStrings[123], pTexture_506374, 0); // "Miscellaneous Notes" | |
709 pBtn_Autonotes_Instructors = v1->CreateButton(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 302, 50, 34, 1, 0, UIMSG_AutonotesBook, 7, 0, pGlobalTXT_LocalizationStrings[662], pTexture_50636C, 0); // "Instructors" | |
710 | |
711 v9 = pBtn_Autonotes_Instructors; | |
688 | 712 v10 = dword_506528; |
949 | 713 num_achieved_awards = 0; |
688 | 714 while ( v10 < 196 ) |
715 { | |
981 | 716 if ( _506568_autonote_type == pAutonoteTxt[v10-1].eType)//dword_72371C[2 * v10] ) |
688 | 717 { |
718 //v25 = (&dword_723718_autonote_related)[8 * (signed __int16)v10]; | |
719 v25 = (char *)pAutonoteTxt[v10-1].pText; | |
720 if ( (short)v10 ) | |
721 { | |
722 if ( _449B57_test_bit(pParty->_autonote_bits, v10) && v25 ) | |
723 { | |
949 | 724 v11 = num_achieved_awards++; |
725 achieved_awards[v11] = (AwardType)v10; | |
688 | 726 } |
727 } | |
728 } | |
729 ++v10; | |
730 } | |
731 } | |
732 break; | |
948 | 733 |
710 | 734 case WINDOW_MapsBook: |
948 | 735 { |
688 | 736 dword_506364 = 1; |
948 | 737 pSpellBookPagesTextr_12 = pIcons_LOD->LoadTexturePtr("sbmap", TEXTURE_16BIT_PALETTE); |
738 pTex_tab_an_6b__zoom_on = pIcons_LOD->LoadTexturePtr("zoom-on", TEXTURE_16BIT_PALETTE); | |
739 pTex_tab_an_7b__zoot_on = pIcons_LOD->LoadTexturePtr("zoot-on", TEXTURE_16BIT_PALETTE); | |
740 pTex_tab_an_6a__zoom_off = pIcons_LOD->LoadTexturePtr("zoom-off", TEXTURE_16BIT_PALETTE); | |
741 pTex_tab_an_7a__zoot_off = pIcons_LOD->LoadTexturePtr("zoot-off", TEXTURE_16BIT_PALETTE); | |
742 pTexture_506394 = pIcons_LOD->LoadTexturePtr("tabNon", TEXTURE_16BIT_PALETTE); | |
743 pTexture_506390 = pIcons_LOD->LoadTexturePtr("tabNoff", TEXTURE_16BIT_PALETTE); | |
744 pTexture_50638C = pIcons_LOD->LoadTexturePtr("tabSon", TEXTURE_16BIT_PALETTE); | |
745 pTexture_506388 = pIcons_LOD->LoadTexturePtr("tabSoff", TEXTURE_16BIT_PALETTE); | |
746 pTexture_506384 = pIcons_LOD->LoadTexturePtr("tabEon", TEXTURE_16BIT_PALETTE); | |
747 pTexture_506380 = pIcons_LOD->LoadTexturePtr("tabEoff", TEXTURE_16BIT_PALETTE); | |
748 pTexture_50637C = pIcons_LOD->LoadTexturePtr("tabWon", TEXTURE_16BIT_PALETTE); | |
749 pTexture_506378 = pIcons_LOD->LoadTexturePtr("tabWoff", TEXTURE_16BIT_PALETTE); | |
750 | |
751 pBtn_Book_1 = v1->CreateButton(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 1, 50, 34, 1, 0, UIMSG_AutonotesBook, 0, 0, pGlobalTXT_LocalizationStrings[251], pTex_tab_an_6b__zoom_on, 0);// "Zoom In" | |
752 pBtn_Book_2 = v1->CreateButton(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 38, 50, 34, 1, 0, UIMSG_AutonotesBook, 1, 0, pGlobalTXT_LocalizationStrings[252], pTex_tab_an_7b__zoot_on, 0);// "Zoom Out" | |
753 pBtn_Book_3 = v1->CreateButton(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 113, 50, 34, 1, 0, UIMSG_AutonotesBook, 2, 0, pGlobalTXT_LocalizationStrings[192], (Texture *)"", 0);// Scroll Up | |
754 pBtn_Book_4 = v1->CreateButton(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 150, 50, 34, 1, 0, UIMSG_AutonotesBook, 3, 0, pGlobalTXT_LocalizationStrings[193], (Texture *)"", 0);// Scroll Down | |
755 pBtn_Book_5 = v1->CreateButton(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 188, 50, 34, 1, 0, UIMSG_AutonotesBook, 4, 0, pGlobalTXT_LocalizationStrings[573], (Texture *)"", 0);// "Scroll Right" | |
756 pBtn_Book_6 = v1->CreateButton(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 226, 50, 34, 1, 0, UIMSG_AutonotesBook, 5, 0, pGlobalTXT_LocalizationStrings[572], (Texture *)"", 0);// "Scroll Left" | |
688 | 757 } |
758 break; | |
948 | 759 |
760 case WINDOW_CalendarBook: | |
761 { | |
762 pSpellBookPagesTextr_13 = pIcons_LOD->LoadTexturePtr("sbdate-time", TEXTURE_16BIT_PALETTE); | |
763 pTex_moon_new = pIcons_LOD->LoadTexturePtr("moon_new", TEXTURE_16BIT_PALETTE); | |
764 pTex_moon_4 = pIcons_LOD->LoadTexturePtr("moon_4", TEXTURE_16BIT_PALETTE); | |
765 pTex_moon_2 = pIcons_LOD->LoadTexturePtr("moon_2", TEXTURE_16BIT_PALETTE); | |
766 pTex_moon_2_2 = pIcons_LOD->LoadTexturePtr("moon_2", TEXTURE_16BIT_PALETTE); | |
767 pTex_moon_ful = pIcons_LOD->LoadTexturePtr("moon_ful", TEXTURE_16BIT_PALETTE); | |
688 | 768 } |
769 break; | |
948 | 770 |
710 | 771 case WINDOW_HistoryBook: |
948 | 772 { |
773 pSpellBookPagesTextr_11 = pIcons_LOD->LoadTexturePtr("sbplayrnot", TEXTURE_16BIT_PALETTE); | |
774 pTex_tab_an_6b__zoom_on = pIcons_LOD->LoadTexturePtr("tab-an-6b", TEXTURE_16BIT_PALETTE); | |
775 pTex_tab_an_7b__zoot_on = pIcons_LOD->LoadTexturePtr("tab-an-7b", TEXTURE_16BIT_PALETTE); | |
776 pTex_tab_an_6a__zoom_off = pIcons_LOD->LoadTexturePtr("tab-an-6a", TEXTURE_16BIT_PALETTE); | |
777 pTex_tab_an_7a__zoot_off = pIcons_LOD->LoadTexturePtr("tab-an-7a", TEXTURE_16BIT_PALETTE); | |
778 | |
779 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_AutonotesBook, 11, 0, pGlobalTXT_LocalizationStrings[192], pTex_tab_an_6b__zoom_on, 0); | |
780 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_AutonotesBook, 10, 0, pGlobalTXT_LocalizationStrings[193], pTex_tab_an_7b__zoot_on, 0); | |
781 | |
949 | 782 num_achieved_awards = 0; |
688 | 783 v26.uFrameX = 48; |
784 v26.uFrameY = 70; | |
785 v26.uFrameWidth = 360; | |
786 v26.uFrameHeight = 264; | |
787 v2 = LOBYTE(pAutonoteFont->uFontHeight) - 3; | |
788 v26.uFrameZ = 407; | |
789 v26.uFrameHeight = v2 * 264 / v2; | |
790 v26.uFrameW = v26.uFrameHeight + 69; | |
949 | 791 memset(&achieved_awards, 0, 4000); |
688 | 792 memset(byte_5C6D50, 0, 0x64u); |
793 if ( dword_506528 < 29 ) | |
794 { | |
795 v3 = (__int64 *)&pParty->field_3C.field_4F0[2 * dword_506528]; | |
796 for(int i=dword_506528+1;i<dword_506528+31;i++) | |
797 { | |
798 v4 = pStorylineText->StoreLine[i].pText; | |
799 if ( *v3 ) | |
800 { | |
801 if ( v4 ) | |
802 { | |
803 v5 = BuilDialogueString(v4, uActiveCharacter - 1, 0, 0, 0, v3); | |
804 v6 = pAutonoteFont->CalcTextHeight(v5, &v26, 1, 0); | |
805 v7 = (v6 - 3) / (signed int)v26.uFrameHeight; | |
806 v8 = v7 + 1; | |
807 if ( (signed int)v7 + 1 > 0 ) | |
808 { | |
949 | 809 memset32((char *)&achieved_awards + 4 * num_achieved_awards , i, v8); |
688 | 810 do |
811 { | |
949 | 812 LODWORD(v7) = num_achieved_awards++; |
688 | 813 byte_5C6D50[(int)v7] = BYTE4(v7); |
814 ++HIDWORD(v7); | |
815 } | |
816 while ( SHIDWORD(v7) < (signed int)v8 ); | |
817 } | |
818 } | |
819 } | |
820 ++i; | |
821 ++v3; | |
822 } | |
823 } | |
824 | |
825 } | |
826 break; | |
827 } | |
828 | |
0 | 829 } |
830 | |
831 | |
832 | |
833 | |
834 //----- (00415551) -------------------------------------------------------- | |
835 void GUIWindow::DrawMessageBox(int arg0) | |
836 { | |
837 unsigned int v2; // edi@1 | |
838 GUIWindow *v3; // ebx@1 | |
839 signed int v4; // esi@2 | |
840 unsigned int v5; // eax@2 | |
841 unsigned int v6; // edx@4 | |
842 unsigned int v7; // ecx@6 | |
843 unsigned int v8; // eax@9 | |
844 __int32 v9; // eax@10 | |
845 unsigned int v10; // eax@18 | |
846 LONG v11; // ecx@18 | |
847 unsigned int v12; // edx@18 | |
848 unsigned int v13; // eax@18 | |
849 const char *v14; // ecx@18 | |
850 int v15; // eax@19 | |
851 unsigned int v16; // esi@19 | |
852 const char *v17; // ebx@25 | |
853 int v18; // eax@26 | |
854 GUIWindow v19; // [sp+Ch] [bp-60h]@18 | |
855 POINT a2; // [sp+60h] [bp-Ch]@8 | |
856 unsigned int v21; // [sp+68h] [bp-4h]@18 | |
857 unsigned int v22; // [sp+74h] [bp+8h]@2 | |
858 unsigned int v23; // [sp+74h] [bp+8h]@18 | |
859 | |
860 v2 = 0; | |
861 v3 = this; | |
862 if ( arg0 ) | |
863 { | |
693 | 864 v4 = pViewport->uViewportTL_X; |
865 v5 = pViewport->uViewportBR_X; | |
866 v2 = pViewport->uViewportTL_Y; | |
867 v22 = pViewport->uViewportBR_Y; | |
0 | 868 } |
869 else | |
870 { | |
871 v4 = 0; | |
872 v5 = 640; | |
873 v22 = 480; | |
874 } | |
875 v6 = this->uFrameX; | |
876 if ( (signed int)this->uFrameX >= v4 ) | |
877 { | |
878 v7 = this->uFrameWidth; | |
879 if ( (signed int)(v7 + v6) <= (signed int)v5 ) | |
880 goto LABEL_9; | |
881 v3->uFrameX = v5 - v7; | |
882 } | |
883 else | |
884 { | |
885 this->uFrameX = v4; | |
886 } | |
887 v3->uFrameY = pMouse->GetCursorPos(&a2)->y + 30; | |
888 LABEL_9: | |
889 v8 = v3->uFrameY; | |
890 if ( (signed int)v8 >= (signed int)v2 ) | |
891 { | |
892 if ( (signed int)(v8 + v3->uFrameHeight) <= (signed int)v22 ) | |
893 goto LABEL_14; | |
894 v9 = pMouse->GetCursorPos(&a2)->y - v3->uFrameHeight - 30; | |
895 } | |
896 else | |
897 { | |
898 v9 = pMouse->GetCursorPos(&a2)->y + 30; | |
899 } | |
900 v3->uFrameY = v9; | |
901 LABEL_14: | |
902 if ( (signed int)v3->uFrameY < (signed int)v2 ) | |
903 v3->uFrameY = v2; | |
904 if ( (signed int)v3->uFrameX < v4 ) | |
905 v3->uFrameX = v4; | |
906 v10 = v3->uFrameWidth; | |
907 v11 = v3->uFrameX; | |
908 v12 = v3->uFrameY; | |
909 v21 = v10; | |
910 a2.y = v11; | |
911 v3->uFrameZ = v10 + v11 - 1; | |
912 v13 = v3->uFrameHeight; | |
913 v3->uFrameW = v13 + v12 - 1; | |
914 memcpy(&v19, v3, sizeof(v19)); | |
915 v19.uFrameX += 12; | |
916 v19.uFrameWidth -= 24; | |
917 v19.uFrameY += 12; | |
918 v19.uFrameHeight -= 12; | |
919 v19.uFrameZ = v19.uFrameWidth + v19.uFrameX - 1; | |
920 v23 = v12; | |
921 v19.uFrameW = v19.uFrameHeight + v19.uFrameY - 1; | |
922 v14 = v3->Hint; | |
923 if ( v14 ) | |
924 { | |
925 v15 = pFontLucida->CalcTextHeight(v14, &v19, 0, 0); | |
926 v12 = v23; | |
927 v16 = v15 + 24; | |
928 } | |
929 else | |
930 { | |
931 v16 = v13; | |
932 } | |
933 if ( (signed int)v16 < 64 ) | |
934 v16 = 64; | |
935 if ( (signed int)(v16 + v12) > 479 ) | |
936 v16 = 479 - v12; | |
937 DrawPopupWindow(a2.y, v12, v21, v16); | |
938 v17 = v3->Hint; | |
939 if ( v17 ) | |
940 { | |
941 v18 = pFontLucida->CalcTextHeight(v17, &v19, 0, 0); | |
942 v19.DrawTitleText(pFontLucida, 0, (signed int)(v16 - v18) / 2 - 14, 0, v17, 3u); | |
943 } | |
944 } | |
945 | |
946 | |
947 //----- (0041192C) -------------------------------------------------------- | |
948 void __cdecl InitializeBookTextures() | |
949 { | |
950 //signed int v0; // ebp@3 | |
951 //Texture **v1; // ebx@3 | |
952 | |
953 pAudioPlayer->StopChannels(-1, -1); | |
954 ++pIcons_LOD->uTexturePacksCount; | |
955 if ( !pIcons_LOD->uNumPrevLoadedFiles ) | |
956 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; | |
957 pAudioPlayer->PlaySound((SoundID)230, 0, 0, -1, 0, 0, 0, 0); | |
948 | 958 pSpellBookPagesTextr_9 = pIcons_LOD->LoadTexturePtr("book", TEXTURE_16BIT_PALETTE); |
959 pTexture_pagemask = pIcons_LOD->LoadTexturePtr("pagemask", TEXTURE_16BIT_PALETTE); | |
960 pTexture_506448 = pIcons_LOD->LoadTexturePtr("ib-m5-u", TEXTURE_16BIT_PALETTE); | |
961 ptr_506440 = pIcons_LOD->LoadTexturePtr("ib-m5-d", TEXTURE_16BIT_PALETTE); | |
962 pTexture_50643C = pIcons_LOD->LoadTexturePtr("ib-m6-u",TEXTURE_16BIT_PALETTE); | |
0 | 963 //v0 = 1; |
964 | |
965 static const char *texNames[9] = | |
966 { | |
967 "SBFB00", "SBAB00", "SBWB00", "SBEB00", | |
968 "SBSB00", "SBMB00", "SBBB00", "SBLB00", | |
969 }; | |
970 | |
971 pTexture_506444 = pIcons_LOD->LoadTexturePtr("ib-m6-d",TEXTURE_16BIT_PALETTE); | |
972 for (uint i = 0; i < 8; ++i) | |
973 { | |
688 | 974 pSpellBookPagesTextr[i] = pIcons_LOD->LoadTexturePtr(texNames[i], TEXTURE_16BIT_PALETTE); |
0 | 975 |
99 | 976 sprintf(pTmpBuf, "tab%da", i+1); |
0 | 977 pTextures_tabs[i][0] = pIcons_LOD->LoadTexturePtr(pTmpBuf, TEXTURE_16BIT_PALETTE); |
99 | 978 sprintf(pTmpBuf, "tab%db", i+1); |
0 | 979 pTextures_tabs[i][1] = pIcons_LOD->LoadTexturePtr(pTmpBuf, TEXTURE_16BIT_PALETTE); |
980 } | |
981 } | |
982 | |
983 //----- (00411AAA) -------------------------------------------------------- | |
984 void __cdecl InitializeBookFonts() | |
985 { | |
986 pAudioPlayer->StopChannels(-1, -1); | |
987 ++pIcons_LOD->uTexturePacksCount; | |
988 if ( !pIcons_LOD->uNumPrevLoadedFiles ) | |
989 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; | |
990 pAudioPlayer->PlaySound((SoundID)230, 0, 0, -1, 0, 0, 0, 0); | |
948 | 991 pTexture_mapbordr = pIcons_LOD->LoadTexturePtr("mapbordr", TEXTURE_16BIT_PALETTE); |
180 | 992 pBookFont = LoadFont("book.fnt", "FONTPAL", NULL); |
993 pBook2Font = LoadFont("book2.fnt", "FONTPAL", NULL); | |
994 pAutonoteFont = LoadFont("autonote.fnt", "FONTPAL", NULL); | |
995 pSpellFont = LoadFont("spell.fnt", "FONTPAL", NULL); | |
0 | 996 } |
997 | |
998 //----- (00411B59) -------------------------------------------------------- | |
999 void __fastcall LoadThumbnailLloydTexture(unsigned int uSlot, unsigned int uPlayer) | |
1000 { | |
1001 unsigned int v2; // esi@1 | |
1002 unsigned int v3; // edi@1 | |
1003 FILE *v4; // ebx@1 | |
1004 FILE *v5; // eax@2 | |
1005 char pContainerName[64]; // [sp+Ch] [bp-44h]@1 | |
1006 unsigned int v7; // [sp+4Ch] [bp-4h]@1 | |
1007 | |
1008 v2 = uSlot; | |
1009 v7 = uPlayer; | |
1010 v3 = uSlot + 1; | |
1011 sprintf(pContainerName, "data\\lloyd%d%d.pcx", uPlayer, uSlot + 1); | |
1012 v4 = fopen(pContainerName, "rb"); | |
1013 if ( v4 ) | |
1014 { | |
1015 pSavegameThumbnails[v2].LoadFromFILE(v4, 0, 1u); | |
1016 fclose(v4); | |
1017 } | |
1018 else | |
1019 { | |
1020 sprintf(pContainerName, "lloyd%d%d.pcx", v7, v3); | |
1021 v5 = pNew_LOD->FindContainer(pContainerName, 1); | |
1022 if ( v5 ) | |
1023 pSavegameThumbnails[v2].LoadFromFILE(v5, 0, 0); | |
1024 else | |
1025 *((int *)&pSavegameThumbnails->pPixels + 10 * v2) = 0; | |
1026 } | |
1027 } | |
1028 | |
1029 | |
1030 //----- (00411621) -------------------------------------------------------- | |
198 | 1031 void GUIWindow::OpenSpellBook() |
0 | 1032 { |
11 | 1033 Player *pPlayer; // edi@1 |
198 | 1034 //GUIWindow *pWindow; // esi@1 |
1035 //unsigned int v3; // ebp@1 | |
0 | 1036 int v4; // eax@3 |
198 | 1037 ///GUIButton *result; // eax@25 |
0 | 1038 int a2; // [sp+10h] [bp-8h]@1 |
198 | 1039 //int v7; // [sp+14h] [bp-4h]@1 |
0 | 1040 |
11 | 1041 pPlayer = pPlayers[uActiveCharacter]; |
198 | 1042 //pWindow = this; |
1043 LoadSpellbook(pPlayer->lastOpenedSpellbookPage); | |
1044 //v3 = 0; | |
0 | 1045 a2 = 0; |
198 | 1046 |
1047 auto chapter = &pPlayer->spellbook.pChapters[pPlayer->lastOpenedSpellbookPage]; | |
1048 for (uint i = 0; i < 11; ++i) | |
0 | 1049 { |
198 | 1050 if (!chapter->bIsSpellAvailable[i]) |
1051 continue; | |
363 | 1052 v4= pPlayer->lastOpenedSpellbookPage; |
1053 //v4 = (12 * pPlayer->lastOpenedSpellbookPage + pSpellbookSpellIndices[pPlayer->lastOpenedSpellbookPage][i + 1]); | |
693 | 1054 CreateButton(pViewport->uViewportTL_X + pIconPos[v4][pSpellbookSpellIndices[v4][i+1]].Xpos, |
1055 pViewport->uViewportTL_Y + pIconPos[v4][pSpellbookSpellIndices[v4][i+1]].Ypos, //dword_4E20D0 | |
198 | 1056 dword_506408[i + 1]->uTextureWidth, |
1057 dword_506408[i + 1]->uTextureHeight, | |
832 | 1058 1, 79, UIMSG_SelectSpell, i, 0, "", 0); |
0 | 1059 ++a2; |
198 | 1060 //++v3; |
0 | 1061 } |
198 | 1062 //while ( (signed int)v3 < 11 ); |
1063 | |
948 | 1064 CreateButton(0, 0, 0, 0, 1, 0, UIMSG_33, 0, '\t', "", 0); |
0 | 1065 if ( a2 ) |
972 | 1066 _41D08F_set_keyboard_control_group(a2, 0, 0, 0); |
948 | 1067 |
1068 if (pPlayer->pActiveSkills[PLAYER_SKILL_FIRE]) CreateButton(399, 10, 50, 36, 1, 0, UIMSG_OpenSpellbookPage, 0, 0, aSpellSchoolNames[0], 0); | |
1069 if (pPlayer->pActiveSkills[PLAYER_SKILL_AIR]) CreateButton(399, 46, 50, 36, 1, 0, UIMSG_OpenSpellbookPage, 1, 0, aSpellSchoolNames[1], 0); | |
1070 if (pPlayer->pActiveSkills[PLAYER_SKILL_WATER]) CreateButton(399, 83, 50, 36, 1, 0, UIMSG_OpenSpellbookPage, 2, 0, aSpellSchoolNames[2], 0); | |
1071 if (pPlayer->pActiveSkills[PLAYER_SKILL_EARTH]) CreateButton(399, 121, 50, 36, 1, 0, UIMSG_OpenSpellbookPage, 3, 0, aSpellSchoolNames[3], 0); | |
1072 if (pPlayer->pActiveSkills[PLAYER_SKILL_SPIRIT]) CreateButton(399, 158, 50, 36, 1, 0, UIMSG_OpenSpellbookPage, 4, 0, aSpellSchoolNames[4], 0); | |
1073 if (pPlayer->pActiveSkills[PLAYER_SKILL_MIND]) CreateButton(400, 196, 50, 36, 1, 0, UIMSG_OpenSpellbookPage, 5, 0, aSpellSchoolNames[5], 0); | |
1074 if (pPlayer->pActiveSkills[PLAYER_SKILL_BODY]) CreateButton(400, 234, 50, 36, 1, 0, UIMSG_OpenSpellbookPage, 6, 0, aSpellSchoolNames[6], 0); | |
1075 if (pPlayer->pActiveSkills[PLAYER_SKILL_LIGHT]) CreateButton(400, 271, 50, 36, 1, 0, UIMSG_OpenSpellbookPage, 7, 0, aSpellSchoolNames[7], 0); | |
1076 if (pPlayer->pActiveSkills[PLAYER_SKILL_DARK]) CreateButton(400, 307, 50, 36, 1, 0, UIMSG_OpenSpellbookPage, 8, 0, aSpellSchoolNames[8], 0); | |
1077 | |
960 | 1078 CreateButton(476, 450, pTexture_506444->uTextureWidth, pTexture_506444->uTextureHeight, 1, 78, UIMSG_ClickInstallRemoveQuickSpellBtn, 0, 0, "", 0); |
1079 pBtn_InstallRemoveSpell = CreateButton(476, 450, 48, 32, 1, 78, UIMSG_ClickInstallRemoveQuickSpellBtn, 0, 0, "", pTexture_506444, 0); | |
948 | 1080 CreateButton(561, 450, ptr_506440->uTextureWidth, ptr_506440->uTextureHeight, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[79], 0); |
1081 pBtn_CloseBook = CreateButton(561, 450, 48, 32, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[79], ptr_506440, 0); | |
0 | 1082 } |
1083 // 50640C: using guessed type int dword_50640C[]; | |
1084 | |
1085 //----- (004B3157) -------------------------------------------------------- | |
405 | 1086 void GUIWindow::HouseDialogManager() |
0 | 1087 { |
854 | 1088 unsigned __int16 pWhiteColor; // di@2 |
1089 const char *pHouseName; // edx@4 | |
0 | 1090 signed int v3; // edx@5 |
1091 char *v4; // edi@9 | |
854 | 1092 int pTextHeight; // eax@45 |
0 | 1093 int v6; // edi@45 |
1094 char *v7; // eax@45 | |
1095 int v8; // edi@46 | |
1096 int v9; // eax@50 | |
1097 unsigned int v10; // [sp-10h] [bp-C8h]@53 | |
873 | 1098 char *pTitleText; // [sp-8h] [bp-C0h]@50 |
854 | 1099 GUIWindow pDialogWindow; // [sp+Ch] [bp-ACh]@4 |
1100 GUIWindow pWindow; // [sp+60h] [bp-58h]@2 | |
1101 int pColor2; // [sp+B4h] [bp-4h]@2 | |
0 | 1102 |
336 | 1103 if ( !window_SpeakInHouse ) |
0 | 1104 return; |
854 | 1105 memcpy(&pWindow, this, sizeof(pWindow)); |
1106 pWindow.uFrameWidth -= 18; | |
1107 pWindow.uFrameZ -= 18; | |
949 | 1108 pWhiteColor = TargetColor(0xFFu, 0xFFu, 0xFFu); |
1109 pColor2 = TargetColor(0x15u, 0x99u, 0xE9u); | |
0 | 1110 pRenderer->DrawTextureIndexed(0x1DDu, 0, pTexture_Dialogue_Background); |
910 | 1111 pRenderer->DrawTextureTransparent(0x1D4u, 0, &pIcons_LOD->pTextures[uTextureID_right_panel_loop]); |
457 | 1112 if ( pDialogueNPCCount != uNumDialogueNPCPortraits || !uHouse_ExitPic ) |
0 | 1113 { |
854 | 1114 pDialogWindow.uFrameWidth = 130; |
1115 pDialogWindow.uFrameHeight = 2 * LOBYTE(pFontCreate->uFontHeight); | |
1116 pHouseName = p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].pName; | |
1117 if ( pHouseName ) | |
0 | 1118 { |
854 | 1119 v3 = 2 * LOBYTE(pFontCreate->uFontHeight) - 6 - pFontCreate->CalcTextHeight(pHouseName, &pDialogWindow, 0, 0); |
0 | 1120 if ( v3 < 0 ) |
1121 v3 = 0; | |
854 | 1122 pWindow.DrawTitleText(pFontCreate, 0x1EAu, v3 / 2 + 4, pWhiteColor, |
0 | 1123 //(const char *)p2DEvents_minus1_::04[13 * (unsigned int)ptr_507BC0->ptr_1C], |
336 | 1124 p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].pName, 3); |
0 | 1125 } |
1126 } | |
854 | 1127 pWindow.uFrameWidth += 8; |
1128 pWindow.uFrameZ += 8; | |
457 | 1129 if ( !pDialogueNPCCount ) |
0 | 1130 { |
484 | 1131 if ( in_current_building_type == BildingType_Jail ) |
0 | 1132 { |
480 | 1133 JailDialog(); |
854 | 1134 if ( pDialogueNPCCount == uNumDialogueNPCPortraits && uHouse_ExitPic ) |
1135 { | |
1136 pRenderer->DrawTextureIndexed(556, 451, &pIcons_LOD->pTextures[uTextureID_x_x_u]); | |
1137 pRenderer->DrawTextureIndexed(476, 451, &pIcons_LOD->pTextures[uTextureID_x_ok_u]); | |
1138 } | |
1139 else | |
1140 { | |
1141 pRenderer->DrawTextureIndexed(471, 445, &pIcons_LOD->pTextures[uExitCancelTextureId]); | |
1142 } | |
1143 return; | |
0 | 1144 } |
827 | 1145 if ( current_npc_text ) |
0 | 1146 { |
854 | 1147 pDialogWindow.uFrameWidth = 458; |
1148 pDialogWindow.uFrameZ = 457; | |
1149 pTextHeight = pFontArrus->CalcTextHeight(current_npc_text, &pDialogWindow, 13, 0); | |
1150 v6 = pTextHeight + 7; | |
1151 pRenderer->_4A6A68(8, 352 - (pTextHeight + 7), &pIcons_LOD->pTextures[uTextureID_Leather], | |
1152 pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight - (pTextHeight + 7)); | |
1153 pRenderer->DrawTextureIndexed(8, 347 - v6, pTexture_591428); | |
1154 v7 = FitTextInAWindow(current_npc_text, pFontArrus, &pDialogWindow, 0xDu, 0); | |
336 | 1155 window_SpeakInHouse->DrawText(pFontArrus, 13, 354 - v6, 0, v7, 0, 0, 0); |
0 | 1156 } |
1157 if ( uNumDialogueNPCPortraits <= 0 ) | |
854 | 1158 { |
1159 if ( pDialogueNPCCount == uNumDialogueNPCPortraits && uHouse_ExitPic ) | |
1160 { | |
1161 pRenderer->DrawTextureIndexed(556, 451, &pIcons_LOD->pTextures[uTextureID_x_x_u]); | |
1162 pRenderer->DrawTextureIndexed(476, 451, &pIcons_LOD->pTextures[uTextureID_x_ok_u]); | |
1163 } | |
1164 else | |
1165 { | |
1166 pRenderer->DrawTextureIndexed(471, 445, &pIcons_LOD->pTextures[uExitCancelTextureId]); | |
1167 } | |
1168 return; | |
1169 } | |
873 | 1170 for ( v8 = 0; v8 < uNumDialogueNPCPortraits; ++v8 ) |
0 | 1171 { |
419 | 1172 pRenderer->DrawTextureIndexed(pNPCPortraits_x[uNumDialogueNPCPortraits - 1][v8] - 4, |
874 | 1173 pNPCPortraits_y[uNumDialogueNPCPortraits - 1][v8] - 4, &pIcons_LOD->pTextures[uTextureID_50795C]); |
419 | 1174 pRenderer->DrawTextureIndexed(pNPCPortraits_x[uNumDialogueNPCPortraits - 1][v8], |
1175 pNPCPortraits_y[uNumDialogueNPCPortraits - 1][v8], pDialogueNPCPortraits[v8]); | |
0 | 1176 if ( uNumDialogueNPCPortraits < 4 ) |
854 | 1177 { |
873 | 1178 if ( v8 + 1 == uNumDialogueNPCPortraits && uHouse_ExitPic ) |
854 | 1179 { |
873 | 1180 pTitleText = pMapStats->pInfos[uHouse_ExitPic].pName; |
1181 v9 = 94 * v8 + 113; | |
854 | 1182 } |
1183 else | |
1184 { | |
873 | 1185 if ( !v8 && dword_591080 ) |
1186 { | |
1187 pTitleText = (char *)p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].pProprieterTitle; | |
1188 pWindow.DrawTitleText(pFontCreate, 0x1E3u, 113, pColor2, pTitleText, 3); | |
1189 continue; | |
1190 } | |
1191 pTitleText = HouseNPCData[v8 - (dword_591080 != 0)]->pName; | |
1192 v9 = pNPCPortraits_x[6 + (uNumDialogueNPCPortraits - 1)][v8] + pDialogueNPCPortraits[v8]->uTextureHeight + 2; | |
854 | 1193 } |
873 | 1194 v10 = v9; |
1195 pWindow.DrawTitleText(pFontCreate, 0x1E3u, v10, pColor2, pTitleText, 3); | |
854 | 1196 } |
874 | 1197 } |
873 | 1198 if ( pDialogueNPCCount == uNumDialogueNPCPortraits && uHouse_ExitPic ) |
0 | 1199 { |
873 | 1200 pRenderer->DrawTextureIndexed(556, 451, &pIcons_LOD->pTextures[uTextureID_x_x_u]); |
1201 pRenderer->DrawTextureIndexed(476, 451, &pIcons_LOD->pTextures[uTextureID_x_ok_u]); | |
0 | 1202 } |
873 | 1203 else |
1204 { | |
1205 pRenderer->DrawTextureIndexed(471, 445, &pIcons_LOD->pTextures[uExitCancelTextureId]); | |
1206 } | |
1207 return; | |
0 | 1208 } |
457 | 1209 v4 = (char *)pDialogueNPCCount - 1; |
419 | 1210 pRenderer->DrawTextureIndexed(pNPCPortraits_x[0][0] - 4, pNPCPortraits_y[0][0] - 4, &pIcons_LOD->pTextures[uTextureID_50795C]); |
1211 pRenderer->DrawTextureIndexed(pNPCPortraits_x[0][0], pNPCPortraits_y[0][0], pDialogueNPCPortraits[(signed int)v4]); | |
151 | 1212 if ( pCurrentScreen == SCREEN_E ) |
0 | 1213 { |
984 | 1214 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); |
854 | 1215 if ( pDialogueNPCCount == uNumDialogueNPCPortraits && uHouse_ExitPic ) |
1216 { | |
1217 pRenderer->DrawTextureIndexed(556, 451, &pIcons_LOD->pTextures[uTextureID_x_x_u]); | |
1218 pRenderer->DrawTextureIndexed(476, 451, &pIcons_LOD->pTextures[uTextureID_x_ok_u]); | |
1219 } | |
1220 else | |
1221 { | |
1222 pRenderer->DrawTextureIndexed(471, 445, &pIcons_LOD->pTextures[uExitCancelTextureId]); | |
1223 } | |
1224 return; | |
0 | 1225 } |
1226 if ( v4 || !dword_591080 ) | |
1227 { | |
445 | 1228 SimpleHouseAndBoatsDialog(); |
0 | 1229 } |
1230 else | |
1231 { | |
264 | 1232 sprintfex( pTmpBuf, pGlobalTXT_LocalizationStrings[429], |
336 | 1233 p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].pProprieterName, |
1234 p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].pProprieterTitle); | |
854 | 1235 pWindow.DrawTitleText(pFontCreate, 0x1E3u, 0x71u, pColor2, pTmpBuf, 3); |
484 | 1236 switch ( in_current_building_type ) |
0 | 1237 { |
480 | 1238 case BildingType_WeaponShop: |
405 | 1239 WeaponShopDialog(); |
0 | 1240 break; |
480 | 1241 case BildingType_ArmorShop: |
405 | 1242 ArmorShopDialog(); |
0 | 1243 break; |
480 | 1244 case BildingType_MagicShop: |
405 | 1245 MagicShopDialog(); |
0 | 1246 break; |
480 | 1247 case BildingType_AlchemistShop: |
405 | 1248 AlchemistDialog(); |
0 | 1249 break; |
480 | 1250 case BildingType_FireGuild: |
1251 case BildingType_AirGuild: | |
1252 case BildingType_WaterGuild: | |
1253 case BildingType_EarthGuild: | |
1254 case BildingType_SpiritGuild: | |
1255 case BildingType_MindGuild: | |
1256 case BildingType_BodyGuild: | |
1257 case BildingType_LightGuild: | |
495 | 1258 case BildingType_DarkGuild: |
480 | 1259 GuildDialog(); |
1260 break; | |
1261 case BildingType_18: | |
987 | 1262 __debugbreak(); //What over the dialog? |
480 | 1263 sub_4B6478(); |
1264 break; | |
1265 case BildingType_TownHall: | |
1266 TownHallDialog(); | |
1267 break; | |
1268 case BildingType_Tavern: | |
1269 TavernDialog(); | |
1270 break; | |
1271 case BildingType_Bank: | |
1272 BankDialog(); | |
1273 break; | |
481 | 1274 case BildingType_Temple: |
495 | 1275 TempleDialog(); |
480 | 1276 break; |
1277 case BildingType_Stables: | |
1278 TravelByTransport(); | |
1279 break; | |
1280 case BildingType_Training: | |
1281 TrainingDialog(); | |
1282 break; | |
1283 case BildingType_Jail: | |
1284 JailDialog(); | |
1285 break; | |
0 | 1286 default: |
987 | 1287 __debugbreak();//New BildingType |
0 | 1288 break; |
1289 } | |
1290 } | |
457 | 1291 if ( pDialogueNPCCount == uNumDialogueNPCPortraits && uHouse_ExitPic ) |
0 | 1292 { |
370 | 1293 pRenderer->DrawTextureIndexed(556, 451, &pIcons_LOD->pTextures[uTextureID_x_x_u]); |
1294 pRenderer->DrawTextureIndexed(476, 451, &pIcons_LOD->pTextures[uTextureID_x_ok_u]); | |
0 | 1295 } |
1296 else | |
1297 { | |
526 | 1298 pRenderer->DrawTextureIndexed(471, 445, &pIcons_LOD->pTextures[uExitCancelTextureId]); |
0 | 1299 } |
1300 } | |
1301 | |
1302 //----- (004B1854) -------------------------------------------------------- | |
471
c43f156a95c9
ArmorShopDialog crash fixed. All shops show its items
Gloval
parents:
457
diff
changeset
|
1303 void GUIWindow::DrawCurrentTime( __int64 a2 ) |
c43f156a95c9
ArmorShopDialog crash fixed. All shops show its items
Gloval
parents:
457
diff
changeset
|
1304 { |
0 | 1305 unsigned int v2; // edi@1 |
1306 unsigned int v3; // esi@1 | |
1307 unsigned int v4; // ebp@1 | |
1308 unsigned int v5; // ebx@1 | |
1309 signed __int64 v6; // ST2C_8@1 | |
1310 signed __int64 v7; // kr00_8@1 | |
1311 char *v8; // eax@2 | |
1312 char *v9; // eax@7 | |
1313 char *v10; // eax@13 | |
1314 char *v11; // eax@19 | |
1315 unsigned __int16 v12; // ST0C_2@22 | |
1316 int v13; // eax@22 | |
1317 GUIWindow *v15; // [sp+0h] [bp-1Ch]@1 | |
1318 signed __int64 v16; // [sp+Ch] [bp-10h]@1 | |
1319 signed __int64 v17; // [sp+14h] [bp-8h]@1 | |
1320 unsigned int v18; // [sp+20h] [bp+4h]@1 | |
1321 | |
1322 v15 = this; | |
1323 v2 = (unsigned __int64)(signed __int64)((double)a2 * 0.234375) >> 32; | |
1324 v3 = (signed __int64)((double)a2 * 0.234375); | |
1325 v4 = (unsigned __int64)((signed __int64)((double)a2 * 0.234375) / 60) >> 32; | |
1326 v5 = (signed __int64)((double)a2 * 0.234375) / 60; | |
1327 v6 = (signed __int64)((double)a2 * 0.234375) / 60 / 60; | |
1328 v18 = (unsigned int)v6 / 0x18; | |
1329 v17 = (signed __int64)__PAIR__(v2, v3) % 60; | |
1330 v16 = (signed __int64)__PAIR__(v4, v5) % 60; | |
1331 v7 = v6 % 24; | |
1332 strcpy(pTmpBuf, pGlobalTXT_LocalizationStrings[532]); | |
471
c43f156a95c9
ArmorShopDialog crash fixed. All shops show its items
Gloval
parents:
457
diff
changeset
|
1333 if ( (unsigned int)v6 /24 ) |
0 | 1334 { |
1335 v8 = pGlobalTXT_LocalizationStrings[57]; | |
1336 if ( v18 <= 1 ) | |
1337 v8 = pGlobalTXT_LocalizationStrings[56]; | |
1338 sprintf(pTmpBuf2, "%d %s ", v18, v8); | |
1339 strcat(pTmpBuf, pTmpBuf2); | |
1340 } | |
1341 if ( v7 ) | |
1342 { | |
1343 if ( v7 <= 1 ) | |
1344 v9 = pGlobalTXT_LocalizationStrings[109]; | |
1345 else | |
1346 v9 = pGlobalTXT_LocalizationStrings[110]; | |
1347 sprintf(pTmpBuf2, "%d %s ", v7, v9); | |
1348 strcat(pTmpBuf, pTmpBuf2); | |
1349 } | |
1350 if ( v16 && !v18 ) | |
1351 { | |
1352 if ( v16 <= 1 ) | |
471
c43f156a95c9
ArmorShopDialog crash fixed. All shops show its items
Gloval
parents:
457
diff
changeset
|
1353 v10 = pGlobalTXT_LocalizationStrings[437];//"Minute" |
0 | 1354 else |
471
c43f156a95c9
ArmorShopDialog crash fixed. All shops show its items
Gloval
parents:
457
diff
changeset
|
1355 v10 = pGlobalTXT_LocalizationStrings[436]; //"Minutes" |
0 | 1356 sprintf(pTmpBuf2, "%d %s ", v16, v10); |
1357 strcat(pTmpBuf, pTmpBuf2); | |
1358 } | |
1359 if ( v17 && !v7 ) | |
1360 { | |
1361 if ( v17 <= 1 ) | |
471
c43f156a95c9
ArmorShopDialog crash fixed. All shops show its items
Gloval
parents:
457
diff
changeset
|
1362 v11 = pGlobalTXT_LocalizationStrings[439]; //"Second" |
0 | 1363 else |
471
c43f156a95c9
ArmorShopDialog crash fixed. All shops show its items
Gloval
parents:
457
diff
changeset
|
1364 v11 = pGlobalTXT_LocalizationStrings[438]; //"Seconds" |
0 | 1365 sprintf(pTmpBuf2, "%d %s ", v17, v11); |
1366 strcat(pTmpBuf, pTmpBuf2); | |
1367 } | |
949 | 1368 v12 = TargetColor(0xFFu, 0xFFu, 0x9Bu); |
0 | 1369 v13 = pFontArrus->CalcTextHeight(pTmpBuf, v15, 0, 0); |
471
c43f156a95c9
ArmorShopDialog crash fixed. All shops show its items
Gloval
parents:
457
diff
changeset
|
1370 v15->DrawTitleText(pFontArrus, 0, (212 - v13) / 2 + 101, v12, pTmpBuf, 3u); |
0 | 1371 } |
1372 | |
1373 | |
1374 | |
1375 //----- (0044D406) -------------------------------------------------------- | |
762 | 1376 void GUIWindow::DrawTitleText( GUIFont *a2, signed int uHorizontalMargin, unsigned int uVerticalMargin, unsigned __int16 uDefaultColor, const char *pInString, unsigned int uLineSpacing ) |
1377 { | |
0 | 1378 GUIWindow *pWindow; // esi@1 |
1379 unsigned int v8; // ebx@1 | |
1380 char *v9; // eax@1 | |
1381 unsigned int v11; // edi@1 | |
1382 signed int v12; // esi@1 | |
1383 int v13; // eax@2 | |
1384 GUIFont *pFont; // [sp+Ch] [bp-4h]@1 | |
1385 const char *Stra; // [sp+24h] [bp+14h]@5 | |
1386 | |
1387 pWindow = this; | |
1388 pFont = a2; | |
1389 v8 = this->uFrameWidth - uHorizontalMargin; | |
1390 ui_current_text_color = uDefaultColor; | |
1391 v9 = FitTextInAWindow(pInString, a2, this, uHorizontalMargin, 0); | |
762 | 1392 Stra = strtok(v9, "\n"); |
0 | 1393 v11 = uHorizontalMargin + pWindow->uFrameX; |
1394 v12 = uVerticalMargin + pWindow->uFrameY; | |
1395 while ( 1 ) | |
1396 { | |
762 | 1397 if ( !Stra ) |
0 | 1398 break; |
762 | 1399 v13 = (signed int)(v8 - pFont->GetLineWidth(Stra)) >> 1; |
0 | 1400 if ( v13 < 0 ) |
1401 v13 = 0; | |
1402 pFont->DrawTextLine(uDefaultColor, v11 + v13, v12, Stra, 640); | |
49 | 1403 v12 += pFont->uFontHeight - uLineSpacing; |
762 | 1404 Stra = strtok(0, "\n"); |
0 | 1405 } |
1406 } | |
1407 // 5C6DB4: using guessed type int ui_current_text_color; | |
1408 | |
1409 | |
1410 | |
1411 //----- (0044CE08) -------------------------------------------------------- | |
1412 char GUIWindow::DrawText(GUIFont *a2, signed int uX, int uY, unsigned int uFontColor, const char *Str, int a7, int a8, unsigned int uFontShadowColor) | |
1413 { | |
1414 GUIWindow *v9; // edi@1 | |
1415 GUIFont *v10; // ebx@1 | |
1416 int v11; // eax@2 | |
1417 signed int v12; // esi@9 | |
1418 signed int v13; // edi@9 | |
1419 int v14; // edx@9 | |
1420 int v15; // eax@25 | |
1421 unsigned int v16; // ecx@25 | |
1422 int v17; // eax@27 | |
1423 int v18; // edi@32 | |
1424 int v19; // esi@38 | |
1425 std::string v21; // [sp-18h] [bp-50h]@2 | |
1426 const char *v22; // [sp-8h] [bp-40h]@2 | |
1427 int v23; // [sp-4h] [bp-3Ch]@2 | |
1428 char Dest[6]; // [sp+Ch] [bp-2Ch]@32 | |
1429 //char v25; // [sp+Fh] [bp-29h]@32 | |
1430 //char v26; // [sp+11h] [bp-27h]@34 | |
1431 const char *v27; // [sp+20h] [bp-18h]@25 | |
1432 int v28; // [sp+24h] [bp-14h]@25 | |
1433 int v29; // [sp+28h] [bp-10h]@1 | |
1434 size_t v30; // [sp+2Ch] [bp-Ch]@4 | |
1435 GUIWindow *v31; // [sp+30h] [bp-8h]@1 | |
1436 const char *v32; // [sp+34h] [bp-4h]@7 | |
1437 size_t pInString; // [sp+4Ch] [bp+14h]@11 | |
1438 | |
1439 auto a1 = this; | |
1440 v29 = 0; | |
1441 v9 = a1; | |
1442 v10 = a2; | |
1443 v31 = a1; | |
1444 if ( !Str ) | |
1445 { | |
1446 MessageBoxW(nullptr, L"Invalid string passed!", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Font.cpp:859", 0); | |
1447 return v11; | |
1448 } | |
1449 v11 = strcmp(Str, "null"); | |
1450 if ( v11 ) | |
1451 { | |
1452 v30 = strlen(Str); | |
1453 LOBYTE(v11) = 0; | |
1454 if ( !uX ) | |
1455 uX = 12; | |
1456 if ( a8 ) | |
1457 { | |
1458 v32 = Str; | |
1459 } | |
1460 else | |
1461 { | |
1462 v11 = (int)FitTextInAWindow(Str, v10, v9, uX, 0); | |
1463 v32 = (const char *)v11; | |
1464 } | |
1465 v12 = uX + v9->uFrameX; | |
1466 v13 = uY + v9->uFrameY; | |
1467 v14 = 0; | |
1468 if ( !a8 || (v11 = v13 + LOBYTE(v10->uFontHeight), v11 <= a8) ) | |
1469 { | |
1470 pInString = 0; | |
1471 if ( (signed int)v30 > 0 ) | |
1472 { | |
1473 do | |
1474 { | |
1475 LOBYTE(v11) = v32[v14]; | |
1476 if ( (unsigned __int8)v11 >= v10->cFirstChar && (unsigned __int8)v11 <= v10->cLastChar | |
1477 || (char)v11 == 12 | |
1478 || (char)v11 == 13 | |
1479 || (char)v11 == 9 | |
1480 || (char)v11 == 10 ) | |
1481 { | |
1482 switch ( (unsigned __int8)v11 ) | |
1483 { | |
1484 case 9u: | |
1485 strncpy(Dest, &v32[v14 + 1], 3u); | |
1486 Dest[3] = 0; | |
1487 pInString += 3; | |
1488 v29 = atoi(Dest); | |
1489 v19 = atoi(Dest); | |
1490 LOBYTE(v11) = (char)v31; | |
1491 v12 = uX + v31->uFrameX + v19; | |
1492 break; | |
1493 case 0xAu: | |
1494 v11 = LOBYTE(v10->uFontHeight); | |
1495 uY = uY + v11 - 3; | |
1496 v13 = uY + v31->uFrameY; | |
1497 v12 = uX + v29 + v31->uFrameX; | |
1498 if ( a8 ) | |
1499 goto LABEL_36; | |
1500 break; | |
1501 case 0xCu: | |
1502 strncpy(Dest, &v32[v14 + 1], 5u); | |
1503 Dest[5] = 0; | |
1504 v11 = atoi(Dest); | |
1505 pInString += 5; | |
1506 uFontColor = v11; | |
1507 break; | |
1508 case 0xDu: | |
1509 strncpy(Dest, &v32[v14 + 1], 3u); | |
1510 Dest[3] = 0; | |
1511 pInString += 3; | |
1512 v18 = atoi(Dest); | |
1513 v11 = v10->GetLineWidth(&v32[pInString]); | |
1514 v12 = v31->uFrameZ - v11 - v18; | |
1515 v13 = uY + v31->uFrameY; | |
1516 if ( a8 ) | |
1517 { | |
1518 v11 = LOBYTE(v10->uFontHeight); | |
1519 LABEL_36: | |
1520 v11 = v11 + v13 - 3; | |
1521 if ( v11 > a8 ) | |
1522 return v11; | |
1523 break; | |
1524 } | |
1525 break; | |
1526 default: | |
1527 if ( (char)v11 == 34 && v32[v14 + 1] == 34 ) | |
1528 { | |
1529 ++v14; | |
1530 pInString = v14; | |
1531 } | |
1532 v27 = &v32[v14]; | |
1533 v15 = (unsigned __int8)v32[v14]; | |
1534 v16 = *((int *)&v10->cFirstChar + 3 * v15 + 9); | |
1535 v28 = *((int *)&v10->cFirstChar + 3 * v15 + 9); | |
1536 if ( v14 > 0 ) | |
1537 v12 += v10->pMetrics[v15].uLeftSpacing; | |
1538 v17 = (int)((char *)&v10[1] + v10->field_C20[v15]); | |
1539 if ( (short)uFontColor ) | |
1540 pRenderer->DrawText( | |
1541 v12, | |
1542 v13, | |
1543 (unsigned __int8 *)v17, | |
1544 v16, | |
1545 LOBYTE(v10->uFontHeight), | |
1546 v10->pFontPalettes[0], | |
1547 uFontColor, | |
1548 uFontShadowColor); | |
1549 else | |
1550 pRenderer->DrawTextPalette( | |
1551 v12, | |
1552 v13, | |
1553 v17, | |
1554 v16, | |
1555 LOBYTE(v10->uFontHeight), | |
1556 v10->pFontPalettes[0], | |
1557 a7); | |
1558 LOBYTE(v11) = v30; | |
1559 v12 += v28; | |
1560 if ( (signed int)pInString < (signed int)v30 ) | |
1561 { | |
1562 LOBYTE(v11) = 3 * *v27; | |
1563 v12 += v10->pMetrics[(unsigned __int8)*v27].uRightSpacing; | |
1564 } | |
1565 break; | |
1566 } | |
1567 } | |
1568 v14 = pInString++ + 1; | |
1569 } | |
1570 while ( (signed int)pInString < (signed int)v30 ); | |
1571 } | |
1572 } | |
1573 } | |
1574 return v11; | |
1575 } | |
1576 | |
1577 | |
1578 //----- (0044CB4F) -------------------------------------------------------- | |
1579 int GUIWindow::DrawTextInRect(GUIFont *a2, unsigned int uX, unsigned int uY, unsigned int uColor, const char *Str1, int Source, int a8) | |
1580 { | |
24 | 1581 GUIFont *pFont; // edi@1 |
1582 int pLineWidth; // ebx@1 | |
0 | 1583 int v11; // esi@3 |
1584 unsigned __int8 v12; // cl@7 | |
1585 signed int v13; // esi@19 | |
1586 signed int v14; // ebx@19 | |
1587 unsigned __int8 v15; // cl@21 | |
1588 int v16; // eax@22 | |
1589 int v17; // ecx@22 | |
1590 int v18; // ecx@23 | |
1591 int v19; // ecx@24 | |
1592 unsigned int v20; // ecx@26 | |
1593 int v21; // eax@28 | |
1594 int v22; // ebx@34 | |
1595 int v23; // eax@34 | |
1596 int v24; // ebx@36 | |
1597 char Str; // [sp+Ch] [bp-20h]@34 | |
1598 char v26; // [sp+Fh] [bp-1Dh]@34 | |
1599 char v27; // [sp+11h] [bp-1Bh]@35 | |
1600 int v28; // [sp+20h] [bp-Ch]@17 | |
1601 GUIWindow *pWindow; // [sp+24h] [bp-8h]@1 | |
24 | 1602 size_t pNumLen; // [sp+28h] [bp-4h]@1 |
0 | 1603 size_t Str1a; // [sp+40h] [bp+14h]@5 |
1604 size_t Str1b; // [sp+40h] [bp+14h]@19 | |
1605 const char *Sourcea; // [sp+44h] [bp+18h]@20 | |
1606 int v34; // [sp+48h] [bp+1Ch]@26 | |
1607 | |
24 | 1608 pFont = a2; |
0 | 1609 pWindow = this; |
24 | 1610 pNumLen = strlen(Str1); |
1611 pLineWidth = pFont->GetLineWidth(Str1); | |
1612 if ( pLineWidth < Source ) | |
0 | 1613 { |
24 | 1614 pWindow->DrawText(pFont, uX, uY, uColor, Str1, 0, 0, 0); |
1615 return pLineWidth; | |
0 | 1616 } |
1617 strcpy(pTmpBuf2, Str1); | |
1618 v11 = 0; | |
1619 if ( a8 ) | |
1620 _strrev(pTmpBuf2); | |
1621 Str1a = 0; | |
24 | 1622 if ( (signed int)pNumLen > 0 ) |
0 | 1623 { |
1624 do | |
1625 { | |
1626 if ( v11 >= Source ) | |
1627 break; | |
24 | 1628 if ( pFont->IsCharValid(v12 = pTmpBuf2[Str1a]) ) |
0 | 1629 { |
1630 if ( v12 < 9u ) | |
24 | 1631 { |
1632 if ( (signed int)Str1a > 0 ) | |
1633 v11 += pFont->pMetrics[v12].uLeftSpacing; | |
1634 v11 += *((int *)&pFont->cFirstChar + 3 * v12 + 9); | |
1635 if ( (signed int)Str1a < (signed int)pNumLen ) | |
1636 v11 += pFont->pMetrics[v12].uRightSpacing; | |
1637 goto LABEL_16; | |
1638 } | |
1639 if ( v12 > 0xAu )//10 | |
0 | 1640 { |
1641 if ( v12 == 12 ) | |
1642 { | |
1643 Str1a += 5; | |
1644 } | |
1645 else | |
1646 { | |
1647 if ( v12 != 13 ) | |
1648 { | |
1649 if ( (signed int)Str1a > 0 ) | |
24 | 1650 v11 += pFont->pMetrics[v12].uLeftSpacing; |
1651 v11 += *((int *)&pFont->cFirstChar + 3 * v12 + 9); | |
1652 if ( (signed int)Str1a < (signed int)pNumLen ) | |
1653 v11 += pFont->pMetrics[v12].uRightSpacing; | |
0 | 1654 } |
1655 } | |
1656 } | |
1657 } | |
1658 LABEL_16: | |
1659 ++Str1a; | |
1660 } | |
24 | 1661 while ( (signed int)Str1a < (signed int)pNumLen ); |
0 | 1662 } |
566 | 1663 pTmpBuf2[Str1a - 1] = 0; |
24 | 1664 pNumLen = strlen(pTmpBuf2); |
1665 v28 = pFont->GetLineWidth(pTmpBuf2); | |
0 | 1666 if ( a8 ) |
1667 _strrev(pTmpBuf2); | |
1668 Str1b = 0; | |
1669 v13 = uX + pWindow->uFrameX; | |
1670 v14 = uY + pWindow->uFrameY; | |
24 | 1671 if ( (signed int)pNumLen > 0 ) |
0 | 1672 { |
1673 Sourcea = &pTmpBuf2[1]; | |
1674 do | |
1675 { | |
24 | 1676 if ( pFont->IsCharValid(v15 = pTmpBuf2[Str1b]) ) |
0 | 1677 { |
1678 v16 = v15; | |
1679 v17 = v15 - 9; | |
24 | 1680 if ( v17 )//>0 |
0 | 1681 { |
1682 v18 = v17 - 1; | |
24 | 1683 if ( v18 )//>0 |
0 | 1684 { |
1685 v19 = v18 - 2; | |
24 | 1686 if ( v19 )//>0 |
0 | 1687 { |
24 | 1688 if ( v19 == 1 )//v15 == 13 |
0 | 1689 { |
1690 strncpy(&Str, Sourcea, 3u); | |
1691 v26 = 0; | |
1692 Str1b += 3; | |
1693 Sourcea += 3; | |
1694 v22 = atoi(&Str); | |
24 | 1695 v23 = pFont->GetLineWidth(&pTmpBuf2[Str1b]); |
0 | 1696 v13 = pWindow->uFrameZ - v23 - v22; |
1697 v14 = uY; | |
1698 } | |
24 | 1699 else//v15 > 13 |
0 | 1700 { |
24 | 1701 v20 = *((int *)&pFont->cFirstChar + 3 * v16 + 9); |
1702 v34 = *((int *)&pFont->cFirstChar + 3 * v16 + 9); | |
0 | 1703 if ( (signed int)Str1b > 0 ) |
24 | 1704 v13 += pFont->pMetrics[v16].uLeftSpacing; |
1705 v21 = (int)((char *)&pFont[1] + pFont->field_C20[v16]); | |
0 | 1706 if ( (short)uColor ) |
24 | 1707 pRenderer->DrawText(v13, v14, (unsigned __int8 *)v21, v20, LOBYTE(pFont->uFontHeight), pFont->pFontPalettes[0], uColor, 0); |
0 | 1708 else |
24 | 1709 pRenderer->DrawTextPalette(v13, v14, v21, v20, LOBYTE(pFont->uFontHeight), pFont->pFontPalettes[0], 0); |
0 | 1710 v13 += v34; |
24 | 1711 if ( (signed int)Str1b < (signed int)pNumLen ) |
1712 v13 += pFont->pMetrics[(unsigned __int8)pTmpBuf2[Str1b]].uRightSpacing; | |
0 | 1713 } |
1714 } | |
24 | 1715 else//v15 == 12 |
0 | 1716 { |
1717 strncpy(&Str, Sourcea, 5u); | |
1718 v27 = 0; | |
1719 Str1b += 5; | |
1720 Sourcea += 5; | |
1721 uColor = atoi(&Str); | |
1722 } | |
1723 } | |
24 | 1724 else//v15 == 10 |
0 | 1725 { |
24 | 1726 v24 = LOBYTE(pFont->uFontHeight); |
0 | 1727 v13 = uX; |
1728 uY = uY + v24 - 3; | |
1729 v14 = v24 + uY - 3; | |
1730 } | |
1731 } | |
24 | 1732 else//v15 == 9 |
0 | 1733 { |
1734 strncpy(&Str, Sourcea, 3u); | |
1735 v26 = 0; | |
1736 atoi(&Str); | |
1737 Str1b += 3; | |
1738 Sourcea += 3; | |
1739 } | |
1740 } | |
1741 ++Str1b; | |
1742 ++Sourcea; | |
1743 } | |
24 | 1744 while ( (signed int)Str1b < (signed int)pNumLen ); |
0 | 1745 } |
1746 return v28; | |
1747 } | |
1748 | |
1749 //----- (0041D12F) -------------------------------------------------------- | |
189 | 1750 GUIButton *GUIWindow::CreateButton(unsigned int uX, unsigned int uY, unsigned int uWidth, unsigned int uHeight, |
832 | 1751 int a6, int a7, UIMessageType msg, unsigned int msg_param, unsigned __int8 uHotkey, const char *pName, Texture *pTextures, ...) |
0 | 1752 { |
17 | 1753 GUIButton *pButton; // esi@1 |
0 | 1754 unsigned int v13; // eax@1 |
1755 unsigned int v14; // ebx@4 | |
1756 unsigned int v15; // eax@4 | |
189 | 1757 unsigned int TextureNum=0; // ebx@4 |
0 | 1758 unsigned int v17; // eax@4 |
1759 Texture *v18; // eax@4 | |
1760 Texture **v19; // ecx@5 | |
1761 Texture **v20; // edx@5 | |
1762 GUIButton *v21; // eax@7 | |
189 | 1763 va_list texturs_ptr; |
0 | 1764 |
17 | 1765 pButton = (GUIButton *)pAllocator->AllocNamedChunk(0, 0xBCu, "BUTTON"); |
1766 pButton->pParent = this; | |
1767 pButton->uX = uX + this->uFrameX; | |
0 | 1768 v13 = uY + this->uFrameY; |
17 | 1769 pButton->uHeight = uHeight; |
1770 pButton->uY = v13; | |
1771 pButton->uWidth = uWidth; | |
0 | 1772 if ( a6 == 2 && !uHeight ) |
17 | 1773 pButton->uHeight = uWidth; |
1774 v14 = pButton->uX; | |
1775 pButton->uButtonType = a6; | |
0 | 1776 v15 = v14 + uWidth - 1; |
17 | 1777 pButton->uZ = v15; |
1778 v17 = pButton->uY; | |
271 | 1779 pButton->field_2C_is_pushed = 0; |
17 | 1780 pButton->uW = v17 + uHeight - 1; |
1781 pButton->field_1C = a7; | |
832 | 1782 pButton->msg = msg; |
1783 pButton->msg_param = msg_param; | |
17 | 1784 pButton->uHotkey = uHotkey; |
0 | 1785 strlen(pName); |
17 | 1786 strcpy(pButton->pButtonName, pName); |
189 | 1787 va_start(texturs_ptr, pName); |
1788 while (NULL!=(pTextures=va_arg(texturs_ptr, Texture *))) | |
0 | 1789 { |
189 | 1790 pButton->pTextures[TextureNum]=pTextures; |
1791 ++TextureNum; | |
0 | 1792 } |
189 | 1793 va_end(texturs_ptr); |
1794 pButton->uNumTextures = TextureNum; | |
1795 if ( this->pControlsTail ) | |
1796 this->pControlsTail->pNext = pButton; | |
0 | 1797 else |
17 | 1798 this->pControlsHead = pButton; |
1799 pButton->pPrev = this->pControlsTail; | |
1800 this->pControlsTail = pButton; | |
1801 pButton->pNext = 0; | |
0 | 1802 ++this->uNumControls; |
17 | 1803 return pButton; |
0 | 1804 } |
1805 | |
1806 //----- (00459C2B) -------------------------------------------------------- | |
1807 void GUIWindow::DrawFlashingInputCursor(signed int a3, int a4, GUIFont *a2) | |
1808 { | |
1809 signed int v4; // esi@1 | |
1810 GUIWindow *v5; // edi@1 | |
1811 | |
1812 v4 = a3; | |
1813 v5 = this; | |
1814 if ( GetTickCount() % 1000 > 500 ) | |
1815 DrawText(a2, v4, a4, 0, "_", 0, 0, 0); | |
1816 } | |
1817 | |
1818 //----- (0041C432) -------------------------------------------------------- | |
11 | 1819 GUIWindow *GUIWindow::Create(unsigned int uX, unsigned int uY, unsigned int uWidth, unsigned int uHeight, WindowType eWindowType, int pButton, int a5) |
0 | 1820 { |
1821 unsigned int uNextFreeWindowID; // ebp@1 | |
1822 //int *v8; // eax@1 | |
1823 //GUIWindow *pWindow; // esi@4 | |
962 | 1824 //int v10; // eax@4 |
0 | 1825 unsigned int v11; // ebx@15 |
423 | 1826 NPCData *speakingNPC; // ebp@15 |
1827 int v14; // eax@20 | |
1828 int v16; // eax@25 | |
1829 int v18; // eax@30 | |
1830 int v20; // eax@35 | |
1831 int v22; // eax@40 | |
1832 int v24; // eax@45 | |
0 | 1833 int v25; // eax@65 |
1834 unsigned int v26; // ebx@65 | |
1835 char *v27; // eax@71 | |
1836 const char *v29; // [sp-8h] [bp-18h]@68 | |
1837 char *v30; // [sp-4h] [bp-14h]@68 | |
1838 int uWidtha; // [sp+14h] [bp+4h]@66 | |
423 | 1839 int num_menu_buttons; // [sp+20h] [bp+10h]@15 |
0 | 1840 |
1841 for (uNextFreeWindowID = 0; uNextFreeWindowID < 20; ++uNextFreeWindowID) | |
1842 { | |
1843 if (pWindowList[uNextFreeWindowID].eWindowType == WINDOW_null) | |
1844 break; | |
1845 } | |
1846 | |
1847 auto pWindow = &pWindowList[uNextFreeWindowID]; | |
1848 pWindow->uFrameWidth = uWidth; | |
1849 pWindow->uFrameZ = uX + uWidth - 1; | |
1850 pWindow->uFrameW = uY + uHeight - 1; | |
11 | 1851 pWindow->ptr_1C = (void *)pButton; |
0 | 1852 pWindow->Hint = (char *)a5; |
962 | 1853 //v10 = uNumVisibleWindows; |
0 | 1854 pWindow->uFrameX = uX; |
962 | 1855 //++v10; |
0 | 1856 pWindow->uFrameY = uY; |
1857 pWindow->uFrameHeight = uHeight; | |
1858 pWindow->eWindowType = eWindowType; | |
972 | 1859 pWindow->receives_keyboard_input = false; |
496 | 1860 ++uNumVisibleWindows; |
1861 pWindow->numVisibleWindows = uNumVisibleWindows; | |
1862 pVisibleWindowsIdxs[uNumVisibleWindows] = uNextFreeWindowID + 1; | |
0 | 1863 if ( (signed int)eWindowType <= 20 ) |
1864 { | |
1865 if (eWindowType != WINDOW_Chest) | |
1866 { | |
1867 switch (eWindowType) | |
1868 { | |
1869 case WINDOW_Book: | |
1870 pWindow->InitializeBookView(); | |
1871 break; | |
165 | 1872 case WINDOW_Dialogue: |
11 | 1873 pMainScreenNum = pCurrentScreen; |
151 | 1874 pCurrentScreen = SCREEN_NPC_DIALOGUE; |
832 | 1875 pBtn_ExitCancel = pWindow->CreateButton(0x1D7u, 0x1BDu, 0xA9u, 0x23u, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[79], //"Exit" |
735 | 1876 pIcons_LOD->GetTexture(uExitCancelTextureId), 0); |
496 | 1877 if ( pWindow->par1C != 1 ) |
0 | 1878 { |
423 | 1879 num_menu_buttons = 0; |
0 | 1880 v11 = LOBYTE(pFontArrus->uFontHeight) - 3; |
602 | 1881 speakingNPC = GetNPCData(sDialogue_SpeakingActorNPC_ID); |
827 | 1882 if ( GetGreetType(sDialogue_SpeakingActorNPC_ID) == 1 )//QuestsNPC_greet |
0 | 1883 { |
423 | 1884 if ( speakingNPC->joins ) |
0 | 1885 { |
832 | 1886 pWindow->CreateButton(480, 130, 140, v11, 1, 0, UIMSG_SelectNPCDialogueOption, 0xDu, 0, "", 0); |
423 | 1887 num_menu_buttons = 1; |
0 | 1888 } |
423 | 1889 if ( speakingNPC->evt_A ) |
0 | 1890 { |
423 | 1891 if ( num_menu_buttons < 4 ) |
0 | 1892 { |
423 | 1893 v14 = NPC_EventProcessor(speakingNPC->evt_A); |
0 | 1894 if ( v14 == 1 || v14 == 2 ) |
832 | 1895 pWindow->CreateButton(0x1E0u, num_menu_buttons++ * v11 + 130, 0x8Cu, v11, 1, 0, UIMSG_SelectNPCDialogueOption, 0x13u, 0, "", 0); |
0 | 1896 } |
1897 } | |
423 | 1898 if ( speakingNPC->evt_B ) |
0 | 1899 { |
423 | 1900 if ( num_menu_buttons < 4 ) |
0 | 1901 { |
423 | 1902 v16 = NPC_EventProcessor(speakingNPC->evt_B); |
0 | 1903 if ( v16 == 1 || v16 == 2 ) |
832 | 1904 pWindow->CreateButton(0x1E0u, num_menu_buttons++ * v11 + 130, 0x8Cu, v11, 1, 0, UIMSG_SelectNPCDialogueOption, 0x14u, 0, "", 0); |
0 | 1905 } |
1906 } | |
423 | 1907 if ( speakingNPC->evt_C ) |
0 | 1908 { |
423 | 1909 if ( num_menu_buttons < 4 ) |
0 | 1910 { |
423 | 1911 v18 = NPC_EventProcessor(speakingNPC->evt_C); |
0 | 1912 if ( v18 == 1 || v18 == 2 ) |
832 | 1913 pWindow->CreateButton( 0x1E0u, num_menu_buttons++ * v11 + 130, 0x8Cu, v11, 1, 0, UIMSG_SelectNPCDialogueOption, 0x15u, 0, "", 0); |
0 | 1914 } |
1915 } | |
423 | 1916 if ( speakingNPC->evt_D ) |
0 | 1917 { |
423 | 1918 if ( num_menu_buttons < 4 ) |
0 | 1919 { |
423 | 1920 v20 = NPC_EventProcessor(speakingNPC->evt_D); |
0 | 1921 if ( v20 == 1 || v20 == 2 ) |
832 | 1922 pWindow->CreateButton(0x1E0u, num_menu_buttons++ * v11 + 130, 0x8Cu, v11, 1, 0, UIMSG_SelectNPCDialogueOption, 0x16u, 0, "", 0); |
0 | 1923 } |
1924 } | |
423 | 1925 if ( speakingNPC->evt_E ) |
0 | 1926 { |
423 | 1927 if ( num_menu_buttons < 4 ) |
0 | 1928 { |
423 | 1929 v22 = NPC_EventProcessor(speakingNPC->evt_E); |
0 | 1930 if ( v22 == 1 || v22 == 2 ) |
832 | 1931 pWindow->CreateButton(0x1E0u, num_menu_buttons++ * v11 + 130, 0x8Cu, v11, 1, 0, UIMSG_SelectNPCDialogueOption, 0x17u, 0, "", 0); |
0 | 1932 } |
1933 } | |
423 | 1934 if (speakingNPC->evt_F ) |
0 | 1935 { |
423 | 1936 if ( num_menu_buttons < 4 ) |
0 | 1937 { |
423 | 1938 v24 = NPC_EventProcessor(speakingNPC->evt_F); |
0 | 1939 if ( v24 == 1 || v24 == 2 ) |
832 | 1940 pWindow->CreateButton(0x1E0u, num_menu_buttons++ * v11 + 130, 0x8Cu, v11, 1, 0, UIMSG_SelectNPCDialogueOption, 0x18u, 0, "", 0); |
0 | 1941 } |
1942 } | |
1943 } | |
1944 else | |
1945 { | |
423 | 1946 if ( speakingNPC->joins ) |
0 | 1947 { |
832 | 1948 pWindow->CreateButton(0x1E0u, 0x82u, 0x8Cu, v11, 1, 0, UIMSG_SelectNPCDialogueOption, 0x4Du, 0, pGlobalTXT_LocalizationStrings[407], 0);//Подробнее |
423 | 1949 if (speakingNPC->Hired()) |
0 | 1950 { |
423 | 1951 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[408], speakingNPC->pName); //Отпустить |
832 | 1952 pWindow->CreateButton(0x1E0u, v11 + 130, 0x8Cu, v11, 1, 0, UIMSG_SelectNPCDialogueOption, 0x4Cu, 0, pTmpBuf, 0); |
0 | 1953 } |
1954 else | |
1955 { | |
832 | 1956 pWindow->CreateButton(0x1E0u, v11 + 130, 0x8Cu, v11, 1, 0, UIMSG_SelectNPCDialogueOption, 0x4Cu, 0, pGlobalTXT_LocalizationStrings[406], 0);//Нанять |
0 | 1957 } |
423 | 1958 num_menu_buttons = 2; |
0 | 1959 } |
1960 } | |
972 | 1961 pWindow->_41D08F_set_keyboard_control_group(num_menu_buttons, 1, 0, 1); |
0 | 1962 } |
1963 break; | |
948 | 1964 |
11 | 1965 case WINDOW_ChangeLocation: |
1966 pMainScreenNum = pCurrentScreen; | |
151 | 1967 pCurrentScreen = SCREEN_CHANGE_LOCATION; |
987 | 1968 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 | 1969 pBtn_YES = pWindow->CreateButton( 486, 445, 75, 33, 1, 0, UIMSG_OnTravelByFoot, 0, 'Y', pWindow->Hint, pIcons_LOD->GetTexture(uTextureID_BUTTYES2), 0); |
1970 pWindow->CreateButton(pNPCPortraits_x[0][0], pNPCPortraits_y[0][0], 63, 73, 1, 0, UIMSG_OnTravelByFoot, 1, ' ', pWindow->Hint, 0, 0, 0); | |
1971 pWindow->CreateButton( 8, 8, 460, 344, 1, 0, UIMSG_OnTravelByFoot, 1, 0, pWindow->Hint, 0); | |
0 | 1972 break; |
948 | 1973 |
11 | 1974 case WINDOW_SpellBook: // окно книги заклов |
0 | 1975 InitializeBookTextures(); |
11 | 1976 pWindow->OpenSpellBook(); |
0 | 1977 break; |
11 | 1978 case WINDOW_GreetingNPC: // окно приветствия НПС |
1979 pMainScreenNum = pCurrentScreen; | |
3 | 1980 pKeyActionMap->EnterText(0, 15, pWindow); |
151 | 1981 pCurrentScreen = SCREEN_BRANCHLESS_NPC_DIALOG; |
0 | 1982 break; |
1983 } | |
1984 return pWindow; | |
1985 } | |
11 | 1986 //LABEL_62: |
948 | 1987 pWindow->CreateButton(0x3Du, 0x1A8u, 0x1Fu, 0, 2, 94, UIMSG_SelectCharacter, 1u, '1', "", 0); |
1988 pWindow->CreateButton(0xB1u, 0x1A8u, 0x1Fu, 0, 2, 94, UIMSG_SelectCharacter, 2u, '2', "", 0); | |
1989 pWindow->CreateButton(0x124u, 0x1A8u, 0x1Fu, 0, 2, 94, UIMSG_SelectCharacter, 3u, '3', "", 0); | |
1990 pWindow->CreateButton(0x197u, 0x1A8u, 0x1Fu, 0, 2, 94, UIMSG_SelectCharacter, 4u, '4', "", 0); | |
832 | 1991 pWindow->CreateButton(0, 0, 0, 0, 1, 0, UIMSG_CycleCharacters, 0, 9u, "", 0); |
0 | 1992 return pWindow; |
1993 } | |
1994 if (eWindowType == WINDOW_HouseInterior) | |
1995 { | |
151 | 1996 pCurrentScreen = SCREEN_HOUSE; |
832 | 1997 pBtn_ExitCancel = pWindow->CreateButton(0x1D7u, 0x1BDu, 0xA9u, 0x23u, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[80],//Выйти из здания |
735 | 1998 pIcons_LOD->GetTexture(uExitCancelTextureId), 0); |
0 | 1999 v25 = uNumDialogueNPCPortraits; |
2000 v26 = 0; | |
2001 if ( uNumDialogueNPCPortraits > 0 ) | |
2002 { | |
873 | 2003 for ( v26 = 0; v26 < uNumDialogueNPCPortraits; ++v26 ) |
0 | 2004 { |
2005 if ( v26 + 1 == v25 && uHouse_ExitPic ) | |
2006 { | |
2007 v30 = pMapStats->pInfos[uHouse_ExitPic].pName; | |
874 | 2008 v29 = (char*)pGlobalTXT_LocalizationStrings[LOCSTR_ENTER_S]; |
0 | 2009 } |
2010 else | |
2011 { | |
2012 if ( v26 || !dword_591080 ) | |
874 | 2013 v27 = HouseNPCData[v26 - (dword_591080 != 0)]->pName; |
0 | 2014 else |
2015 //v27 = (char *)p2DEvents_minus1_::08[13 * a4]; | |
11 | 2016 v27 = (char *)p2DEvents[pButton - 1].pProprieterName; |
0 | 2017 v30 = v27; |
874 | 2018 v29 = (char*)pGlobalTXT_LocalizationStrings[435]; |
0 | 2019 } |
735 | 2020 sprintfex(byte_591180[v26], v29, v30); |
457 | 2021 HouseNPCData[v26 + 7] = (NPCData *)pWindow->CreateButton(pNPCPortraits_x[uNumDialogueNPCPortraits - 1][v26], |
419 | 2022 pNPCPortraits_y[uNumDialogueNPCPortraits - 1][v26], |
961 | 2023 0x3Fu, 0x49u, 1, 0, UIMSG_ClickHouseNPCPortrait, v26, 0, byte_591180[v26], 0, 0, 0); |
0 | 2024 v25 = uNumDialogueNPCPortraits; |
2025 } | |
2026 } | |
2027 if ( v25 == 1 ) | |
2028 { | |
336 | 2029 window_SpeakInHouse = &pWindowList[uNextFreeWindowID]; |
0 | 2030 _4B4224_UpdateNPCTopics(0); |
2031 } | |
2032 } | |
2033 else | |
2034 { | |
158 | 2035 if (eWindowType == WINDOW_Transition) |
0 | 2036 { |
11 | 2037 pMainScreenNum = pCurrentScreen; |
151 | 2038 pCurrentScreen = SCREEN_INPUT_BLV; |
960 | 2039 pBtn_ExitCancel = pWindow->CreateButton(0x236u, 0x1BDu, 0x4Bu, 0x21u, 1, 0, UIMSG_TransitionWindowCloseBtn, 0, 'N', pGlobalTXT_LocalizationStrings[34], pIcons_LOD->GetTexture(uTextureID_BUTTDESC2), 0);//Отмена |
948 | 2040 pBtn_YES = pWindow->CreateButton(0x1E6u, 0x1BDu, 0x4Bu, 0x21u, 1, 0, UIMSG_TransitionUI_Confirm, 0, 'Y', pWindow->Hint, pIcons_LOD->GetTexture(uTextureID_BUTTYES2), 0); |
2041 pWindow->CreateButton(pNPCPortraits_x[0][0], pNPCPortraits_y[0][0], 0x3Fu, 0x49u, 1, 0, UIMSG_TransitionUI_Confirm, 1, 0x20u, pWindow->Hint, 0); | |
2042 pWindow->CreateButton(8, 8, 0x1CCu, 0x158u, 1, 0, UIMSG_TransitionUI_Confirm, 1u, 0, pWindow->Hint, 0); | |
0 | 2043 return pWindow; |
2044 } | |
961 | 2045 if (eWindowType == WINDOW_CastSpell) |
0 | 2046 { |
2047 pEventTimer->Pause(); | |
2048 pAudioPlayer->StopChannels(-1, -1); | |
2049 pMouse->SetCursorBitmap("MICON2"); | |
11 | 2050 ShowStatusBarString(pGlobalTXT_LocalizationStrings[39], 2u);//Выберите цель |
0 | 2051 return pWindow; |
2052 } | |
158 | 2053 if (eWindowType == WINDOW_Scroll) |
11 | 2054 //goto LABEL_62; |
2055 { | |
948 | 2056 pWindow->CreateButton(0x3Du, 0x1A8u, 0x1Fu, 0, 2, 94, UIMSG_SelectCharacter, 1u, '1', "", 0); |
2057 pWindow->CreateButton(0xB1u, 0x1A8u, 0x1Fu, 0, 2, 94, UIMSG_SelectCharacter, 2u, '2', "", 0); | |
2058 pWindow->CreateButton(0x124u, 0x1A8u, 0x1Fu, 0, 2, 94, UIMSG_SelectCharacter, 3u, '3', "", 0); | |
2059 pWindow->CreateButton(0x197u, 0x1A8u, 0x1Fu, 0, 2, 94, UIMSG_SelectCharacter, 4u, '4', "", 0); | |
2060 pWindow->CreateButton(0, 0, 0, 0, 1, 0, UIMSG_CycleCharacters, 0, '\t', "", 0); | |
11 | 2061 return pWindow; |
2062 } | |
898 | 2063 if (eWindowType == WINDOW_CastSpell_InInventory) |
0 | 2064 { |
2065 pMouse->SetCursorBitmap("MICON2"); | |
832 | 2066 pBtn_ExitCancel = pWindow->CreateButton(0x188u, 0x13Eu, 0x4Bu, 0x21u, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[34],//Отмена |
945 | 2067 pIcons_LOD->GetTexture(uTextureID_BUTTDESC2), 0); |
11 | 2068 ShowStatusBarString(pGlobalTXT_LocalizationStrings[39], 2);//Выбрать цель |
0 | 2069 ++pIcons_LOD->uTexturePacksCount; |
2070 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 103; | |
151 | 2071 pCurrentScreen = SCREEN_CASTING; |
0 | 2072 if ( !pIcons_LOD->uNumPrevLoadedFiles ) |
2073 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; | |
2074 } | |
2075 } | |
2076 return pWindow; | |
2077 } |