0
|
1 #include "GUIWindow.h"
|
|
2 #include "GUIButton.h"
|
|
3 #include "GUIFont.h"
|
|
4 #include "Party.h"
|
|
5 #include "LOD.h"
|
|
6 #include "Keyboard.h"
|
|
7 #include "IndoorCamera.h"
|
|
8 #include "Math.h"
|
|
9 #include "VideoPlayer.h"
|
|
10 #include "Allocator.h"
|
|
11 #include "MapInfo.h"
|
|
12 #include "Time.h"
|
|
13 #include "AudioPlayer.h"
|
|
14 #include "Mouse.h"
|
|
15 #include "Viewport.h"
|
|
16 #include "Render.h"
|
|
17 #include "PlayerFrameTable.h"
|
|
18 #include "stru179.h"
|
|
19 #include "SaveLoad.h"
|
|
20 #include "FactionTable.h"
|
|
21 #include "StorylineTextTable.h"
|
|
22 #include "Events2D.h"
|
|
23
|
|
24
|
|
25 #include "mm7_data.h"
|
|
26
|
|
27
|
|
28
|
|
29
|
|
30 int pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[1]; // idb
|
3
|
31 struct GUIWindow *pWindow_MainMenu;
|
0
|
32 struct GUIWindow pWindowList[20];
|
|
33
|
|
34 struct GUIMessageQueue *pMessageQueue_50CBD0 = new GUIMessageQueue;
|
|
35
|
|
36
|
|
37 //----- (004356B9) --------------------------------------------------------
|
|
38 void GUIMessageQueue::PopMessage(enum UIMessageType *pType, int *pParam, int *a4)
|
|
39 {
|
|
40 signed int v4; // edx@1
|
|
41 GUIMessage *v5; // eax@2
|
|
42
|
|
43 v4 = 0;
|
|
44 if ( this->uNumMessages )
|
|
45 {
|
|
46 v5 = this->pMessages;
|
|
47 *pType = this->pMessages[0].eType;
|
|
48 *pParam = this->pMessages[0].param;
|
|
49 *a4 = this->pMessages[0].field_8;
|
|
50 if ( (signed int)(this->uNumMessages - 1) > 0 )
|
|
51 {
|
|
52 do
|
|
53 {
|
|
54 v5->eType = v5[1].eType;
|
|
55 v5->param = v5[1].param;
|
|
56 v5->field_8 = v5[1].field_8;
|
|
57 ++v4;
|
|
58 ++v5;
|
|
59 }
|
|
60 while ( v4 < (signed int)(this->uNumMessages - 1) );
|
|
61 }
|
|
62 --this->uNumMessages;
|
|
63 }
|
|
64 }
|
|
65
|
|
66
|
|
67
|
|
68 //----- (0041D73D) --------------------------------------------------------
|
|
69 char GUIWindow::_41D73D_draw_buff_tooltip()
|
|
70 {
|
|
71 GUIFont *v1; // esi@1
|
|
72 GUIWindow *v2; // edi@1
|
|
73 SpellBuff *v3; // eax@1
|
|
74 unsigned int v4; // eax@5
|
|
75 int v5; // ecx@5
|
|
76 unsigned int v6; // eax@5
|
|
77 unsigned int v7; // ecx@5
|
|
78 char *v8; // ebx@7
|
|
79 unsigned int v9; // eax@8
|
|
80 unsigned int v10; // ecx@8
|
|
81 __int64 v11; // ST28_8@11
|
|
82 int v12; // esi@11
|
|
83 const char *v13; // ST0C_4@11
|
|
84 unsigned int v14; // eax@11
|
|
85 char **v16; // [sp+14h] [bp-10h]@7
|
|
86 GUIFont *a2; // [sp+18h] [bp-Ch]@1
|
|
87 SpellBuff *v18; // [sp+1Ch] [bp-8h]@7
|
|
88 int v19; // [sp+20h] [bp-4h]@1
|
|
89 int v20; // [sp+20h] [bp-4h]@7
|
|
90
|
|
91 v1 = pFontComic;
|
|
92 v2 = this;
|
|
93 a2 = pFontComic;
|
|
94 v19 = 0;
|
|
95 v3 = pParty->pPartyBuffs;
|
|
96 do
|
|
97 {
|
|
98 if ( (signed __int64)v3->uExpireTime > 0 )
|
|
99 ++v19;
|
|
100 ++v3;
|
|
101 }
|
|
102 while ( (signed int)v3 < (signed int)pParty->pPlayers );
|
|
103 v4 = LOBYTE(pFontArrus->uFontHeight) + 72;
|
|
104 this->uFrameHeight = v4;
|
|
105 v5 = v4 + (v19 - 1) * LOBYTE(pFontArrus->uFontHeight);
|
|
106 v6 = v2->uFrameWidth;
|
|
107 v2->uFrameHeight = v5;
|
|
108 v7 = v2->uFrameHeight;
|
|
109 v2->uFrameZ = v6 + v2->uFrameX - 1;
|
|
110 v2->uFrameW = v2->uFrameY + v7 - 1;
|
44
|
111 v2->DrawMessageBox(0);
|
0
|
112 v2->DrawText2(pFontArrus, 0, 0xCu, 0, pGlobalTXT_LocalizationStrings[451], 3u);
|
|
113 if ( !v19 )
|
|
114 v2->DrawText2(v1, 0, 0x28u, 0, pGlobalTXT_LocalizationStrings[153], 3u);
|
|
115 v20 = 0;
|
|
116 GetTickCount();
|
|
117 v8 = &_4E2B21_buff_spell_tooltip_colors[1];
|
|
118 v16 = aSpellNames;
|
|
119 v18 = pParty->pPartyBuffs;
|
|
120 do
|
|
121 {
|
|
122 v9 = LODWORD(v18->uExpireTime);
|
|
123 v10 = HIDWORD(v18->uExpireTime);
|
|
124 if ( (v10 & 0x80000000u) == 0 && ((signed int)v10 > 0 || v9) )
|
|
125 {
|
|
126 v11 = __PAIR__(v10, v9) - pParty->uTimePlayed;
|
|
127 v12 = v20 * LOBYTE(v1->uFontHeight) + 40;
|
|
128 v13 = *v16;
|
|
129 ++v20;
|
|
130 v14 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(
|
|
131 (unsigned __int8)*(v8 - 1),
|
|
132 (unsigned __int8)*v8,
|
|
133 (unsigned __int8)v8[1]);
|
|
134 v2->DrawText(a2, 52, v12, v14, v13, 0, 0, 0);
|
|
135 LOBYTE(v9) = sub_41D20D_buff_remaining_time_string(v12, v2, v11, a2);
|
|
136 v1 = a2;
|
|
137 }
|
|
138 ++v18;
|
|
139 ++v16;
|
|
140 v8 += 3;
|
|
141 }
|
|
142 while ( (signed int)v18 < (signed int)pParty->pPlayers );
|
|
143 return v9;
|
|
144 }
|
|
145
|
|
146
|
|
147 //----- (0041D3B7) --------------------------------------------------------
|
82
|
148 char GUIWindow::DrawQuickCharRecord()
|
0
|
149 {
|
|
150 Player *pPlayer; // esi@1
|
|
151 int v6; // eax@5
|
|
152 int v7; // ebx@5
|
|
153 unsigned int v8; // ecx@5
|
|
154 int v9; // ebx@5
|
|
155 unsigned int v10; // eax@5
|
|
156 int v11; // eax@5
|
|
157 unsigned int v12; // ecx@5
|
|
158 Texture *v13; // eax@6
|
|
159 unsigned int v14; // eax@12
|
|
160 PlayerFrame *v15; // eax@12
|
|
161 unsigned int v16; // eax@15
|
|
162 unsigned int v20; // eax@15
|
|
163 unsigned int v24; // eax@15
|
|
164 unsigned int v25; // eax@15
|
|
165 unsigned __int8 v28; // al@15
|
|
166 char *v29; // eax@16
|
|
167 __int64 v35; // ST38_8@22
|
|
168 int v36; // esi@22
|
|
169 unsigned int v38; // eax@22
|
|
170 char *v39; // eax@24
|
|
171 signed int uFramesetID; // [sp+20h] [bp-8h]@9
|
|
172 int uFramesetIDa; // [sp+20h] [bp-8h]@18
|
82
|
173
|
|
174 pPlayer = &pParty->pPlayers[(unsigned int)ptr_1C];
|
|
175
|
|
176 uint numActivePlayerBuffs = 0;
|
|
177
|
|
178 for (uint i = 0; i < 24; ++i)
|
|
179 if (pPlayer->pPlayerBuffs[i].uExpireTime > 0)
|
|
180 ++numActivePlayerBuffs;
|
0
|
181
|
82
|
182 v6 = pFontArrus->uFontHeight + 162;
|
|
183 uFrameHeight = v6;
|
|
184 v7 = (numActivePlayerBuffs - 1) * pFontArrus->uFontHeight;
|
|
185 v8 = uFrameX;
|
0
|
186 v9 = v6 + v7;
|
82
|
187 v10 = uFrameWidth;
|
|
188 uFrameHeight = v9;
|
0
|
189 v11 = v10 + v8 - 1;
|
82
|
190 v12 = uFrameY;
|
|
191 uFrameZ = v11;
|
|
192 uFrameW = v9 + v12 - 1;
|
|
193 DrawMessageBox(0);
|
|
194 if (pPlayer->Eradicated())
|
0
|
195 v13 = pTexture_PlayerFaceEradicated;
|
82
|
196 else if (pPlayer->Dead())
|
|
197 v13 = pTexture_PlayerFaceDead;
|
0
|
198 else
|
|
199 {
|
|
200 uFramesetID = pPlayerFrameTable->GetFrameIdBy_field0(pPlayer->uExpressionID);
|
|
201 if ( !uFramesetID )
|
|
202 uFramesetID = 1;
|
|
203 if ( pPlayer->uExpressionID == 21 )
|
|
204 {
|
|
205 v15 = pPlayerFrameTable->GetFrameBy_y(
|
|
206 &pPlayer->field_1AA8,
|
|
207 &pPlayer->field_1AA4,
|
|
208 pMiscTimer->uTimeElapsed);
|
|
209 }
|
|
210 else
|
|
211 {
|
|
212 v14 = pMiscTimer->Time();
|
|
213 v15 = pPlayerFrameTable->GetFrameBy_x(uFramesetID, v14);
|
|
214 }
|
|
215 pPlayer->field_1AA2 = v15->uTextureID - 1;
|
82
|
216 v13 = pTextures_PlayerFaces[(unsigned int)ptr_1C][v15->uTextureID];
|
0
|
217 }
|
82
|
218
|
|
219 pRenderer->DrawTextureTransparent(uFrameX + 24, uFrameY + 24, v13);
|
0
|
220 v16 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu);
|
82
|
221 sprintf(pTmpBuf, "\xC%05d", v16);
|
80
|
222 sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[429], pPlayer->pName, pClassNames[pPlayer->uClass]);
|
0
|
223 strcat(pTmpBuf, pTmpBuf2);
|
45
|
224 strcat(pTmpBuf, "\xC" "00000\n");
|
82
|
225 v20 = UI_GetHealthManaStringColor(pPlayer->sHealth, pPlayer->GetMaxHealth());
|
|
226 sprintf(pTmpBuf2, "%s : \x0C" "%05u%d\x0C" "00000 / %d\n", pGlobalTXT_LocalizationStrings[108],
|
|
227 v20, pPlayer->sHealth, pPlayer->GetMaxHealth());
|
0
|
228 strcat(pTmpBuf, pTmpBuf2);
|
82
|
229 v24 = UI_GetHealthManaStringColor(pPlayer->sMana, pPlayer->GetMaxMana());
|
|
230 sprintf(pTmpBuf2, "%s : \x0C" "%05u%d\x0C" "00000 / %d\n", pGlobalTXT_LocalizationStrings[212],
|
|
231 v24, pPlayer->sMana, pPlayer->GetMaxMana());
|
0
|
232 strcat(pTmpBuf, pTmpBuf2);
|
23
|
233 v25 = pPlayer->GetMajorConditionIdx();
|
82
|
234 sprintf(pTmpBuf2, "%s: \x0C" "%05d%s\x0C" "00000\n", pGlobalTXT_LocalizationStrings[47],
|
|
235 GetConditionDrawColor(v25), aCharacterConditionNames[v25]);
|
0
|
236 strcat(pTmpBuf, pTmpBuf2);
|
|
237 v28 = pPlayer->uQuickSpell;
|
|
238 if ( v28 )
|
|
239 v29 = pSpellStats->pInfos[v28].pShortName;
|
|
240 else
|
|
241 v29 = pGlobalTXT_LocalizationStrings[153];
|
80
|
242 sprintf(pTmpBuf2, "%s: %s", pGlobalTXT_LocalizationStrings[172], v29);
|
0
|
243 strcat(pTmpBuf, pTmpBuf2);
|
82
|
244 DrawText(pFontArrus, 120, 22, 0, pTmpBuf, 0, 0, 0);
|
|
245
|
0
|
246 uFramesetIDa = 0;
|
82
|
247 for (uint i = 0; i < 24; ++i)
|
0
|
248 {
|
82
|
249 auto buff = pPlayer->pPlayerBuffs + i;
|
|
250 if (buff->uExpireTime > 0)
|
0
|
251 {
|
82
|
252 v35 = buff->uExpireTime - pParty->uTimePlayed;
|
|
253 v36 = uFramesetIDa++ * pFontComic->uFontHeight + 134;
|
0
|
254 v38 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(
|
82
|
255 _4E2AD8_ui_colors[i * 3],
|
|
256 _4E2AD8_ui_colors[i * 3 + 1],
|
|
257 _4E2AD8_ui_colors[i * 3 + 2]);
|
|
258 DrawText(pFontComic, 52, v36, v38, aSpellNames[20 + i], 0, 0, 0);
|
|
259 sub_41D20D_buff_remaining_time_string(v36, this, v35, pFontComic);
|
0
|
260 }
|
|
261 }
|
82
|
262
|
59
|
263 v39 = "";
|
82
|
264 if ( uFramesetIDa == 0 )
|
0
|
265 v39 = pGlobalTXT_LocalizationStrings[153];
|
80
|
266 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[450], v39);
|
82
|
267 return DrawText(pFontArrus, 14, 114, 0, pTmpBuf, 0, 0, 0);
|
0
|
268 }
|
|
269
|
|
270 //----- (0041D08F) --------------------------------------------------------
|
|
271 void GUIWindow::_41D08F(int a2, int a3, int a4, int a5)
|
|
272 {
|
|
273 if ( a2 )
|
|
274 {
|
48
|
275 this->pNumPresenceButton = a2;
|
0
|
276 this->field_30 = a3;
|
|
277 this->field_34 = a4;
|
48
|
278 this->pCurrentPosActiveItem = a5;
|
|
279 this->pStartingPosActiveItem = a5;
|
0
|
280 this->field_44 = 1;
|
|
281 }
|
|
282 else
|
|
283 {
|
48
|
284 this->pNumPresenceButton = 0;
|
0
|
285 this->field_30 = a3;
|
|
286 this->field_34 = a4;
|
48
|
287 this->pCurrentPosActiveItem = 0;
|
|
288 this->pStartingPosActiveItem = 0;
|
0
|
289 this->field_44 = 0;
|
|
290 }
|
|
291 }
|
|
292
|
|
293
|
|
294 //----- (0041C26A) --------------------------------------------------------
|
|
295 void GUIWindow::Release()
|
|
296 {
|
|
297 GUIWindow *v1; // esi@1
|
|
298 unsigned int v2; // eax@2
|
|
299 int v3; // eax@5
|
|
300 int v4; // eax@6
|
|
301 int v5; // eax@14
|
|
302 int v6; // eax@15
|
|
303 int i; // edi@20
|
|
304 GUIButton *v8; // eax@26
|
|
305 GUIButton *v9; // edi@27
|
|
306 int v10; // esi@28
|
|
307 int v11; // ecx@28
|
|
308 int v12; // edx@29
|
|
309
|
|
310 v1 = this;
|
|
311 if ( !this )
|
|
312 return;
|
2
|
313 v2 = this->eWindowType;
|
0
|
314 if ( (signed int)v2 > 18 )
|
|
315 {
|
|
316 v5 = v2 - 19;
|
|
317 if ( !v5 )
|
|
318 {
|
|
319 pIcons_LOD->_40F9C5();
|
44
|
320 pCurrentScreen = dword_506978;
|
0
|
321 pKeyActionMap->_459ED1(3);
|
|
322 goto LABEL_26;
|
|
323 }
|
|
324 v6 = v5 - 6;
|
|
325 if ( !v6 )
|
|
326 {
|
|
327 for ( i = 0; i < uNumDialogueNPCPortraits; ++i )
|
|
328 pDialogueNPCPortraits[i]->Release();
|
|
329 uNumDialogueNPCPortraits = 0;
|
|
330 pTexture_Dialogue_Background->Release();
|
|
331
|
|
332 pIcons_LOD->_40F9C5();
|
|
333 pIcons_LOD->_4114F2();
|
|
334 dword_5C35D4 = 0;
|
|
335 if ( bFlipOnExit )
|
|
336 {
|
|
337 pIndoorCamera->sRotationY = (stru_5C6E00->uIntegerDoublePi - 1) & (stru_5C6E00->uIntegerPi
|
|
338 + pIndoorCamera->sRotationY);
|
|
339 pParty->sRotationY = pIndoorCamera->sRotationY;
|
|
340 }
|
|
341 pParty->uFlags |= 2u;
|
|
342 goto LABEL_26;
|
|
343 }
|
|
344 if ( v6 == 1 )
|
|
345 {
|
|
346 pVideoPlayer->Unload();
|
|
347 goto LABEL_18;
|
|
348 }
|
|
349 }
|
|
350 else
|
|
351 {
|
|
352 if ( v2 == 18 )
|
|
353 {
|
|
354 sub_41140B();
|
|
355 sub_411473();
|
|
356 }
|
|
357 else
|
|
358 {
|
|
359 if ( !v2 )
|
|
360 return;
|
|
361 v3 = v2 - 9;
|
|
362 if ( v3 )
|
|
363 {
|
|
364 v4 = v3 - 1;
|
|
365 if ( !v4 )
|
|
366 {
|
|
367 if ( !dword_591084 )
|
|
368 pDialogueNPCPortraits[0]->Release();
|
|
369 uNumDialogueNPCPortraits = 0;
|
|
370 pTexture_Dialogue_Background->Release();
|
|
371
|
|
372 pIcons_LOD->_40F9C5();
|
|
373 goto LABEL_19;
|
|
374 }
|
|
375 if ( v4 != 7 )
|
|
376 goto LABEL_26;
|
|
377 LABEL_18:
|
|
378 pTexture_outside->Release();
|
|
379 pTexture_Dialogue_Background->Release();
|
|
380 pIcons_LOD->_40F9C5();
|
|
381 LABEL_19:
|
44
|
382 pCurrentScreen = dword_506978;
|
0
|
383 goto LABEL_26;
|
|
384 }
|
|
385 OnCloseSpellook();
|
|
386 }
|
|
387 }
|
|
388 LABEL_26:
|
|
389 v8 = v1->pControlsHead;
|
|
390 if ( v8 )
|
|
391 {
|
|
392 do
|
|
393 {
|
|
394 v9 = v8->pNext;
|
|
395 pAllocator->FreeChunk(v8);
|
|
396 v8 = v9;
|
|
397 }
|
|
398 while ( v9 );
|
|
399 }
|
|
400 v1->pControlsHead = 0;
|
|
401 v1->pControlsTail = 0;
|
|
402 v1->uNumControls = 0;
|
2
|
403 v1->eWindowType = WINDOW_null;
|
0
|
404 v10 = v1->field_3C;
|
|
405 v11 = uNumVisibleWindows;
|
|
406 while ( v10 < v11 )
|
|
407 {
|
|
408 v12 = pVisibleWindowsIdxs[v10 + 1];
|
|
409 pVisibleWindowsIdxs[v10] = v12;
|
44
|
410 --*((int *)&pTexture_PCX.field_18 + 21 * v12);
|
0
|
411 ++v10;
|
|
412 }
|
|
413 pVisibleWindowsIdxs[v11] = 0;
|
|
414 uNumVisibleWindows = v11 - 1;
|
|
415 }
|
|
416
|
|
417
|
|
418
|
|
419
|
|
420
|
|
421
|
|
422 //----- (0041CD3B) --------------------------------------------------------
|
|
423 GUIButton *GUIWindow::GetControl(unsigned int uID)
|
|
424 {
|
|
425 GUIButton *result; // eax@1
|
|
426 unsigned int v3; // ecx@1
|
|
427
|
|
428 result = this->pControlsHead;
|
|
429 v3 = uID;
|
|
430 if ( (signed int)uID > 0 )
|
|
431 {
|
|
432 do
|
|
433 {
|
|
434 result = result->pNext;
|
|
435 --v3;
|
|
436 }
|
|
437 while ( v3 );
|
|
438 }
|
|
439 return result;
|
|
440 }
|
|
441
|
|
442 //----- (00411BFC) --------------------------------------------------------
|
|
443 void GUIWindow::InitializeBookView()
|
|
444 {
|
|
445 GUIWindow *v1; // ebp@1
|
|
446 signed int v2; // ecx@8
|
|
447 __int64 *v3; // ebp@9
|
|
448 char *v4; // ecx@10
|
|
449 char *v5; // eax@12
|
|
450 int v6; // eax@12
|
|
451 __int64 v7; // qax@12
|
|
452 unsigned int v8; // esi@12
|
|
453 GUIButton *v9; // eax@19
|
|
454 signed int v10; // esi@19
|
|
455 int v11; // eax@24
|
|
456 int v12; // eax@27
|
|
457 int i; // esi@28
|
|
458 char *v14; // ebp@29
|
|
459 int v15; // eax@31
|
|
460 unsigned int v16; // esi@35
|
|
461 Player *v17; // esi@38
|
|
462 unsigned __int16 v18; // ax@38
|
|
463 unsigned int v19; // edi@43
|
|
464 unsigned int v20; // edi@45
|
|
465 void *v21; // esi@45
|
|
466 char *v22; // [sp+10h] [bp-5Ch]@9
|
|
467 signed int v23; // [sp+10h] [bp-5Ch]@38
|
|
468 int v24; // [sp+14h] [bp-58h]@9
|
|
469 char *v25; // [sp+14h] [bp-58h]@21
|
|
470 GUIWindow v26; // [sp+18h] [bp-54h]@8
|
|
471
|
|
472 v1 = this;
|
|
473 pAudioPlayer->StopChannels(-1, -1);
|
|
474 InitializeBookFonts();
|
|
475 v1->CreateButton(0x1DBu, 0x1BDu, 0x9Eu, 0x22u, 1, 0, 0x71u, 0, 0, pGlobalTXT_LocalizationStrings[79], 0);
|
44
|
476 pCurrentScreen = 3;
|
0
|
477 dword_506524 = 0;
|
|
478 dword_506528 = 0;
|
|
479 dword_50651C = 0;
|
|
480 dword_506520 = 0;
|
|
481 if ( v1->ptr_1C == (void *)177 )
|
|
482 {
|
|
483 byte_506360 = 0;
|
|
484 pTexture_CurrentBook = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("lb_bordr", TEXTURE_16BIT_PALETTE)];
|
|
485 pTexture_LloydBeacons[0] = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("sbmap", TEXTURE_16BIT_PALETTE)];
|
|
486 pTexture_50635C = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("sbmap", TEXTURE_16BIT_PALETTE)];
|
|
487 pTex_tab_an_6b__zoom_on = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("tab-an-6b", TEXTURE_16BIT_PALETTE)];
|
|
488 pTex_tab_an_6a__zoom_off = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("tab-an-6a", TEXTURE_16BIT_PALETTE)];
|
|
489 pBtn_Book_1 = v1->CreateButton(
|
|
490 415u,
|
|
491 13u,
|
|
492 39u,
|
|
493 36u,
|
|
494 1,
|
|
495 0,
|
|
496 0xB2u,
|
|
497 0,
|
|
498 0,
|
|
499 pGlobalTXT_LocalizationStrings[375],
|
|
500 0);
|
|
501 pBtn_Book_2 = v1->CreateButton(
|
|
502 415u,
|
|
503 48u,
|
|
504 39u,
|
|
505 36u,
|
|
506 1,
|
|
507 0,
|
|
508 0xB2u,
|
|
509 1u,
|
|
510 0,
|
|
511 pGlobalTXT_LocalizationStrings[523],
|
|
512 0);
|
|
513 v17 = &pParty->pPlayers[_506348_current_lloyd_playerid];
|
|
514 v23 = 1;
|
|
515 v18 = v17->pActiveSkills[14];
|
|
516 if ( HIBYTE(v18) & 1 || (v18 & 0x80u) != 0 )
|
|
517 {
|
|
518 v23 = 5;
|
|
519 }
|
|
520 else
|
|
521 {
|
|
522 if ( v18 & 0x40 )
|
|
523 v23 = 3;
|
|
524 }
|
|
525 v19 = 0;
|
|
526 if ( v23 > 0 )
|
|
527 {
|
|
528 do
|
|
529 {
|
|
530 v1->CreateButton(
|
|
531 pLloydsBeaconsPreviewXs[v19],
|
|
532 pLloydsBeaconsPreviewYs[v19],
|
|
533 0x5Cu,
|
|
534 0x44u,
|
|
535 1,
|
|
536 180,
|
|
537 0xB3u,
|
|
538 v19,
|
|
539 0,
|
59
|
540 "",
|
0
|
541 0);
|
|
542 ++v19;
|
|
543 }
|
|
544 while ( (signed int)v19 < v23 );
|
|
545 }
|
|
546 v20 = 0;
|
|
547 v21 = v17->pInstalledBeacons;
|
|
548 do
|
|
549 {
|
|
550 if ( *(_QWORD *)v21 >= (signed __int64)pParty->uTimePlayed )
|
|
551 LoadThumbnailLloydTexture(v20, _506348_current_lloyd_playerid + 1);
|
|
552 else
|
|
553 memset(v21, 0, 0x1Cu);
|
|
554 ++v20;
|
|
555 v21 = (char *)v21 + 28;
|
|
556 }
|
|
557 while ( (signed int)v20 < 5 );
|
|
558 }
|
|
559 else
|
|
560 {
|
|
561 if ( v1->ptr_1C == (void *)195 )
|
|
562 {
|
|
563 pTexture_CurrentBook = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("townport", TEXTURE_16BIT_PALETTE)];
|
|
564 pTexture_TownPortalHarmn = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("tpharmndy", TEXTURE_16BIT_PALETTE)];
|
|
565 pTexture_TownPortalElf = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("tpelf", TEXTURE_16BIT_PALETTE)];
|
|
566 pTexture_TownPortalWarlock = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("tpwarlock", TEXTURE_16BIT_PALETTE)];
|
|
567 pTexture_TownPortalIsland = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("tpisland", TEXTURE_16BIT_PALETTE)];
|
|
568 pTexture_TownPortalHeaven = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("tpheaven", TEXTURE_16BIT_PALETTE)];
|
|
569 v16 = 0;
|
|
570 pTexture_TownPortalHell = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture( "tphell", TEXTURE_16BIT_PALETTE)];
|
|
571 do
|
|
572 {
|
|
573 v1->CreateButton(
|
|
574 pTownPortalBook_xs[v16],
|
|
575 pTownPortalBook_ys[v16],
|
|
576 pTownPortalBook_ws[v16],
|
|
577 pTownPortalBook_hs[v16],
|
|
578 1,
|
|
579 182,
|
|
580 0xB7u,
|
|
581 v16,
|
|
582 0,
|
59
|
583 "",
|
0
|
584 0);
|
|
585 ++v16;
|
|
586 }
|
|
587 while ( (signed int)v16 < 6 );
|
|
588 }
|
|
589 else
|
|
590 {
|
|
591 if ( v1->ptr_1C == (void *)200 )
|
|
592 {
|
|
593 pTexture_CurrentBook = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture( "sbquiknot", TEXTURE_16BIT_PALETTE)];
|
|
594 pTextures_5064A0[10] = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture( "divbar", TEXTURE_16BIT_PALETTE)];
|
|
595 pTex_tab_an_6b__zoom_on = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("tab-an-6b", TEXTURE_16BIT_PALETTE)];
|
|
596 pTex_tab_an_7b__zoot_on = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("tab-an-7b", TEXTURE_16BIT_PALETTE)];
|
|
597 pTex_tab_an_6a__zoom_off = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("tab-an-6a", TEXTURE_16BIT_PALETTE)];
|
|
598 pTex_tab_an_7a__zoot_off = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("tab-an-7a", TEXTURE_16BIT_PALETTE)];
|
|
599 pBtn_Book_1 = v1->CreateButton(
|
|
600 pViewport->uViewportX + 398,
|
|
601 pViewport->uViewportY + 1,
|
|
602 pTex_tab_an_6b__zoom_on->uTextureWidth,
|
|
603 pTex_tab_an_6b__zoom_on->uTextureHeight,
|
|
604 1,
|
|
605 0,
|
|
606 0x47u,
|
|
607 0xBu,
|
|
608 0,
|
|
609 pGlobalTXT_LocalizationStrings[192],// "Scroll Up"
|
|
610 pTex_tab_an_6b__zoom_on,
|
|
611 0);
|
|
612 pBtn_Book_2 = v1->CreateButton(
|
|
613 pViewport->uViewportX + 398,
|
|
614 pViewport->uViewportY + 38,
|
|
615 pTex_tab_an_7b__zoot_on->uTextureHeight,
|
|
616 pTex_tab_an_7b__zoot_on->uTextureHeight,
|
|
617 1,
|
|
618 0,
|
|
619 0x47u,
|
|
620 0xAu,
|
|
621 0,
|
|
622 pGlobalTXT_LocalizationStrings[193],// "Scroll Down"
|
|
623 pTex_tab_an_7b__zoot_on,
|
|
624 0);
|
|
625 dword_506520 = 0;
|
|
626 memset(&pStru179, 0, 0xFA0u);
|
|
627 for ( i = dword_506528; i < 512; ++i )
|
|
628 {
|
|
629 v14 = (&dword_722F10)[4 * i];
|
|
630 if ( (unsigned __int16)_449B57_test_bit(pParty->_award_bits, i) && v14 )
|
|
631 {
|
|
632 v15 = dword_506520++;
|
|
633 pStru179->field_0[v15] = i;
|
|
634 }
|
|
635 }
|
|
636 }
|
|
637 else
|
|
638 {
|
|
639 if ( v1->ptr_1C == (void *)201 )
|
|
640 {
|
|
641 pTexture_AutonotesBook = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("sbautnot", TEXTURE_16BIT_PALETTE)];
|
|
642 pTextures_5064A0[10] = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("divbar", TEXTURE_16BIT_PALETTE)];
|
|
643 pTex_tab_an_6b__zoom_on = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("tab-an-6b", TEXTURE_16BIT_PALETTE)];
|
|
644 pTex_tab_an_7b__zoot_on = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("tab-an-7b", TEXTURE_16BIT_PALETTE)];
|
|
645 pTex_tab_an_6a__zoom_off = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("tab-an-6a", TEXTURE_16BIT_PALETTE)];
|
|
646 pTex_tab_an_7a__zoot_off = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("tab-an-7a", TEXTURE_16BIT_PALETTE)];
|
|
647 pTexture_506394 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("tab-an-1b", TEXTURE_16BIT_PALETTE)];
|
|
648 pTexture_506390 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("tab-an-1a", TEXTURE_16BIT_PALETTE)];
|
|
649 pTexture_50638C = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("tab-an-2b", TEXTURE_16BIT_PALETTE)];
|
|
650 pTexture_506388 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("tab-an-2a", TEXTURE_16BIT_PALETTE)];
|
|
651 pTexture_506384 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("tab-an-3b", TEXTURE_16BIT_PALETTE)];
|
|
652 pTexture_506380 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("tab-an-3a", TEXTURE_16BIT_PALETTE)];
|
|
653 pTexture_50637C = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("tab-an-5b", TEXTURE_16BIT_PALETTE)];
|
|
654 pTexture_506378 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("tab-an-5a", TEXTURE_16BIT_PALETTE)];
|
|
655 pTexture_506374 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("tab-an-4b", TEXTURE_16BIT_PALETTE)];
|
|
656 pTexture_506370 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("tab-an-4a", TEXTURE_16BIT_PALETTE)];
|
|
657 pTexture_50636C = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("tab-an-8b", TEXTURE_16BIT_PALETTE)];
|
|
658 pTexture_506368 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("tab-an-8a", TEXTURE_16BIT_PALETTE)];
|
|
659 pBtn_Book_1 = v1->CreateButton(
|
|
660 pViewport->uViewportX + 398,
|
|
661 pViewport->uViewportY + 1,
|
|
662 0x32u,
|
|
663 0x22u,
|
|
664 1,
|
|
665 0,
|
|
666 0x47u,
|
|
667 0xBu,
|
|
668 0,
|
|
669 pGlobalTXT_LocalizationStrings[193],
|
|
670 pTex_tab_an_6b__zoom_on,
|
|
671 0);
|
|
672 pBtn_Book_2 = v1->CreateButton(
|
|
673 pViewport->uViewportX + 398,
|
|
674 pViewport->uViewportY + 38,
|
|
675 0x32u,
|
|
676 0x22u,
|
|
677 1,
|
|
678 0,
|
|
679 0x47u,
|
|
680 0xAu,
|
|
681 0,
|
|
682 pGlobalTXT_LocalizationStrings[192],
|
|
683 pTex_tab_an_7b__zoot_on,
|
|
684 0);
|
|
685 pBtn_Book_3 = v1->CreateButton(
|
|
686 pViewport->uViewportX + 398,
|
|
687 pViewport->uViewportY + 113,
|
|
688 0x32u,
|
|
689 0x22u,
|
|
690 1,
|
|
691 0,
|
|
692 0x47u,
|
|
693 2u,
|
|
694 0,
|
|
695 pGlobalTXT_LocalizationStrings[85],// "Potion Notes"
|
|
696 pTexture_506394,
|
|
697 0);
|
|
698 pBtn_Book_4 = v1->CreateButton(
|
|
699 pViewport->uViewportX + 399,
|
|
700 pViewport->uViewportY + 150,
|
|
701 0x32u,
|
|
702 0x22u,
|
|
703 1,
|
|
704 0,
|
|
705 0x47u,
|
|
706 3u,
|
|
707 0,
|
|
708 pGlobalTXT_LocalizationStrings[137],// "Fountain Notes"
|
|
709 pTexture_50638C,
|
|
710 0);
|
|
711 pBtn_Book_5 = v1->CreateButton(
|
|
712 pViewport->uViewportX + 397,
|
|
713 pViewport->uViewportY + 188,
|
|
714 0x32u,
|
|
715 0x22u,
|
|
716 1,
|
|
717 0,
|
|
718 0x47u,
|
|
719 4u,
|
|
720 0,
|
|
721 pGlobalTXT_LocalizationStrings[8],// "Obelisk Notes"
|
|
722 pTexture_506384,
|
|
723 0);
|
|
724 pBtn_Book_6 = v1->CreateButton(
|
|
725 pViewport->uViewportX + 397,
|
|
726 pViewport->uViewportY + 226,
|
|
727 0x32u,
|
|
728 0x22u,
|
|
729 1,
|
|
730 0,
|
|
731 0x47u,
|
|
732 5u,
|
|
733 0,
|
|
734 pGlobalTXT_LocalizationStrings[141],// "Seer Notes"
|
|
735 pTexture_50637C,
|
|
736 0);
|
|
737 pBtn_Autonotes_Misc = v1->CreateButton(
|
|
738 pViewport->uViewportX + 397,
|
|
739 pViewport->uViewportY + 264,
|
|
740 0x32u,
|
|
741 0x22u,
|
|
742 1,
|
|
743 0,
|
|
744 0x47u,
|
|
745 6u,
|
|
746 0,
|
|
747 pGlobalTXT_LocalizationStrings[123],// "Miscellaneous Notes"
|
|
748 pTexture_506374,
|
|
749 0);
|
|
750 v9 = v1->CreateButton(
|
|
751 pViewport->uViewportX + 397,
|
|
752 pViewport->uViewportY + 302,
|
|
753 0x32u,
|
|
754 0x22u,
|
|
755 1,
|
|
756 0,
|
|
757 0x47u,
|
|
758 7u,
|
|
759 0,
|
|
760 pGlobalTXT_LocalizationStrings[662],// "Instructors"
|
|
761 pTexture_50636C,
|
|
762 0);
|
|
763 v10 = dword_506528;
|
|
764 pBtn_Autonotes_Instructors = v9;
|
|
765 dword_506520 = 0;
|
|
766 while ( v10 < 196 )
|
|
767 {
|
|
768 if ( dword_506568 == dword_72371C[2 * v10] )
|
|
769 {
|
|
770 v25 = (&dword_723718_autonote_related)[8 * (signed __int16)v10];
|
|
771 if ( (short)v10 )
|
|
772 {
|
26
|
773 if ( (unsigned __int16)_449B57_test_bit(pParty->_autonote_bits, v10) && v25 )
|
0
|
774 {
|
|
775 v11 = dword_506520++;
|
|
776 pStru179->field_0[v11] = (signed __int16)v10;
|
|
777 }
|
|
778 }
|
|
779 }
|
|
780 ++v10;
|
|
781 }
|
|
782 }
|
|
783 else
|
|
784 {
|
|
785 if ( v1->ptr_1C == (void *)202 )
|
|
786 {
|
|
787 dword_506364 = 1;
|
|
788 pTextures_5064A0[12] = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("sbmap", TEXTURE_16BIT_PALETTE)];
|
|
789 pTex_tab_an_6b__zoom_on = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("zoom-on", TEXTURE_16BIT_PALETTE)];
|
|
790 pTex_tab_an_7b__zoot_on = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("zoot-on", TEXTURE_16BIT_PALETTE)];
|
|
791 pTex_tab_an_6a__zoom_off = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("zoom-off", TEXTURE_16BIT_PALETTE)];
|
|
792 pTex_tab_an_7a__zoot_off = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("zoot-off", TEXTURE_16BIT_PALETTE)];
|
|
793 pTexture_506394 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("tabNon", TEXTURE_16BIT_PALETTE)];
|
|
794 pTexture_506390 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("tabNoff", TEXTURE_16BIT_PALETTE)];
|
|
795 pTexture_50638C = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("tabSon", TEXTURE_16BIT_PALETTE)];
|
|
796 pTexture_506388 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("tabSoff", TEXTURE_16BIT_PALETTE)];
|
|
797 pTexture_506384 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("tabEon", TEXTURE_16BIT_PALETTE)];
|
|
798 pTexture_506380 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("tabEoff", TEXTURE_16BIT_PALETTE)];
|
|
799 pTexture_50637C = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("tabWon", TEXTURE_16BIT_PALETTE)];
|
|
800 pTexture_506378 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("tabWoff", TEXTURE_16BIT_PALETTE)];
|
|
801 pBtn_Book_1 = v1->CreateButton(
|
|
802 pViewport->uViewportX + 398,
|
|
803 pViewport->uViewportY + 1,
|
|
804 0x32u,
|
|
805 0x22u,
|
|
806 1,
|
|
807 0,
|
|
808 0x47u,
|
|
809 0,
|
|
810 0,
|
|
811 pGlobalTXT_LocalizationStrings[251],// "Zoom In"
|
|
812 pTex_tab_an_6b__zoom_on,
|
|
813 0);
|
|
814 pBtn_Book_2 = v1->CreateButton(
|
|
815 pViewport->uViewportX + 398,
|
|
816 pViewport->uViewportY + 38,
|
|
817 0x32u,
|
|
818 0x22u,
|
|
819 1,
|
|
820 0,
|
|
821 0x47u,
|
|
822 1u,
|
|
823 0,
|
|
824 pGlobalTXT_LocalizationStrings[252],// "Zoom Out"
|
|
825 pTex_tab_an_7b__zoot_on,
|
|
826 0);
|
|
827 pBtn_Book_3 = v1->CreateButton(
|
|
828 pViewport->uViewportX + 397,
|
|
829 pViewport->uViewportY + 113,
|
|
830 0x32u,
|
|
831 0x22u,
|
|
832 1,
|
|
833 0,
|
|
834 0x47u,
|
|
835 2u,
|
|
836 0,
|
|
837 pGlobalTXT_LocalizationStrings[192],// Scroll Up
|
59
|
838 (Texture *)"",
|
0
|
839 0);
|
|
840 pBtn_Book_4 = v1->CreateButton(
|
|
841 pViewport->uViewportX + 397,
|
|
842 pViewport->uViewportY + 150,
|
|
843 0x32u,
|
|
844 0x22u,
|
|
845 1,
|
|
846 0,
|
|
847 0x47u,
|
|
848 3u,
|
|
849 0,
|
|
850 pGlobalTXT_LocalizationStrings[193],// Scroll Down
|
59
|
851 (Texture *)"",
|
0
|
852 0);
|
|
853 pBtn_Book_5 = v1->CreateButton(
|
|
854 pViewport->uViewportX + 397,
|
|
855 pViewport->uViewportY + 188,
|
|
856 0x32u,
|
|
857 0x22u,
|
|
858 1,
|
|
859 0,
|
|
860 0x47u,
|
|
861 4u,
|
|
862 0,
|
|
863 pGlobalTXT_LocalizationStrings[573],// "Scroll Right"
|
59
|
864 (Texture *)"",
|
0
|
865 0);
|
|
866 pBtn_Book_6 = v1->CreateButton(
|
|
867 pViewport->uViewportX + 397,
|
|
868 pViewport->uViewportY + 226,
|
|
869 0x32u,
|
|
870 0x22u,
|
|
871 1,
|
|
872 0,
|
|
873 0x47u,
|
|
874 5u,
|
|
875 0,
|
|
876 pGlobalTXT_LocalizationStrings[572],// "Scroll Left"
|
59
|
877 (Texture *)"",
|
0
|
878 0);
|
|
879 return;
|
|
880 }
|
|
881 if ( v1->ptr_1C == (void *)203 )
|
|
882 {
|
|
883 pTextures_5064A0[13] = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("sbdate-time", TEXTURE_16BIT_PALETTE)];
|
|
884 pTex_moon_new = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("moon_new", TEXTURE_16BIT_PALETTE)];
|
|
885 pTex_moon_4 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("moon_4", TEXTURE_16BIT_PALETTE)];
|
|
886 pTex_moon_2 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("moon_2", TEXTURE_16BIT_PALETTE)];
|
|
887 pTex_moon_2_2 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("moon_2", TEXTURE_16BIT_PALETTE)];
|
|
888 pTex_moon_ful = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("moon_ful", TEXTURE_16BIT_PALETTE)];
|
|
889 return;
|
|
890 }
|
|
891 if ( v1->ptr_1C != (void *)224 )
|
|
892 return;
|
|
893 pTextures_5064A0[11] = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("sbplayrnot", TEXTURE_16BIT_PALETTE)];
|
|
894 pTex_tab_an_6b__zoom_on = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("tab-an-6b", TEXTURE_16BIT_PALETTE)];
|
|
895 pTex_tab_an_7b__zoot_on = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("tab-an-7b", TEXTURE_16BIT_PALETTE)];
|
|
896 pTex_tab_an_6a__zoom_off = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("tab-an-6a", TEXTURE_16BIT_PALETTE)];
|
|
897 pTex_tab_an_7a__zoot_off = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("tab-an-7a", TEXTURE_16BIT_PALETTE)];
|
|
898 pBtn_Book_1 = v1->CreateButton(
|
|
899 pViewport->uViewportX + 398,
|
|
900 pViewport->uViewportY + 1,
|
|
901 pTex_tab_an_6b__zoom_on->uTextureWidth,
|
|
902 pTex_tab_an_6b__zoom_on->uTextureHeight,
|
|
903 1,
|
|
904 0,
|
|
905 0x47u,
|
|
906 0xBu,
|
|
907 0,
|
|
908 pGlobalTXT_LocalizationStrings[192],
|
|
909 pTex_tab_an_6b__zoom_on,
|
|
910 0);
|
|
911 pBtn_Book_2 = v1->CreateButton(
|
|
912 pViewport->uViewportX + 398,
|
|
913 pViewport->uViewportY + 38,
|
|
914 pTex_tab_an_7b__zoot_on->uTextureHeight,
|
|
915 pTex_tab_an_7b__zoot_on->uTextureHeight,
|
|
916 1,
|
|
917 0,
|
|
918 0x47u,
|
|
919 0xAu,
|
|
920 0,
|
|
921 pGlobalTXT_LocalizationStrings[193],
|
|
922 pTex_tab_an_7b__zoot_on,
|
|
923 0);
|
|
924 dword_506520 = 0;
|
|
925 v26.uFrameX = 48;
|
|
926 v26.uFrameY = 70;
|
|
927 v26.uFrameWidth = 360;
|
|
928 v26.uFrameHeight = 264;
|
|
929 v2 = LOBYTE(pAutonoteFont->uFontHeight) - 3;
|
|
930 v26.uFrameZ = 407;
|
|
931 v26.uFrameHeight = v2 * 264 / v2;
|
|
932 v26.uFrameW = v26.uFrameHeight + 69;
|
|
933 memset(&pStru179, 0, 0xFA0u);
|
|
934 memset(byte_5C6D50, 0, 0x64u);
|
|
935 if ( dword_506528 < 29 )
|
|
936 {
|
|
937 v3 = (__int64 *)&pParty->field_3C.field_4F0[2 * dword_506528];
|
|
938 v24 = dword_506528 + 1;
|
|
939 v22 = (char *)&pStorylineText->field_4[3 * dword_506528 + 2];
|
|
940 do
|
|
941 {
|
|
942 v4 = *(char **)v22;
|
|
943 if ( *v3 )
|
|
944 {
|
|
945 if ( v4 )
|
|
946 {
|
|
947 v5 = sub_495461(v4, uActiveCharacter - 1, 0, 0, 0, v3);
|
|
948 v6 = pAutonoteFont->CalcTextHeight(v5, &v26, 1, 0);
|
|
949 v7 = (v6 - 3) / (signed int)v26.uFrameHeight;
|
|
950 v8 = v7 + 1;
|
|
951 if ( (signed int)v7 + 1 > 0 )
|
|
952 {
|
|
953 memset32((void *)(4 * dword_506520 + 6043152), v24, v8);
|
|
954 do
|
|
955 {
|
|
956 LODWORD(v7) = dword_506520++;
|
|
957 byte_5C6D50[(int)v7] = BYTE4(v7);
|
|
958 ++HIDWORD(v7);
|
|
959 }
|
|
960 while ( SHIDWORD(v7) < (signed int)v8 );
|
|
961 }
|
|
962 }
|
|
963 }
|
|
964 v22 += 12;
|
|
965 ++v3;
|
|
966 ++v24;
|
|
967 __debugbreak(); // fix condition
|
|
968 }
|
|
969 while ( (signed int)v22 < (signed int)&pFactionTable->relations + 8 );
|
|
970 }
|
|
971 }
|
|
972 }
|
|
973 v12 = dword_506520;
|
|
974 dword_506520 = 0;
|
|
975 dword_506524 = v12;
|
|
976 }
|
|
977 }
|
|
978 }
|
|
979
|
|
980
|
|
981
|
|
982
|
|
983 //----- (00415551) --------------------------------------------------------
|
44
|
984 void GUIWindow::DrawMessageBox(int arg0)
|
0
|
985 {
|
|
986 unsigned int v2; // edi@1
|
|
987 GUIWindow *v3; // ebx@1
|
|
988 signed int v4; // esi@2
|
|
989 unsigned int v5; // eax@2
|
|
990 unsigned int v6; // edx@4
|
|
991 unsigned int v7; // ecx@6
|
|
992 unsigned int v8; // eax@9
|
|
993 __int32 v9; // eax@10
|
|
994 unsigned int v10; // eax@18
|
|
995 LONG v11; // ecx@18
|
|
996 unsigned int v12; // edx@18
|
|
997 unsigned int v13; // eax@18
|
|
998 const char *v14; // ecx@18
|
|
999 int v15; // eax@19
|
|
1000 unsigned int v16; // esi@19
|
|
1001 const char *v17; // ebx@25
|
|
1002 int v18; // eax@26
|
|
1003 GUIWindow v19; // [sp+Ch] [bp-60h]@18
|
|
1004 POINT a2; // [sp+60h] [bp-Ch]@8
|
|
1005 unsigned int v21; // [sp+68h] [bp-4h]@18
|
|
1006 unsigned int v22; // [sp+74h] [bp+8h]@2
|
|
1007 unsigned int v23; // [sp+74h] [bp+8h]@18
|
|
1008
|
|
1009 v2 = 0;
|
|
1010 v3 = this;
|
|
1011 if ( arg0 )
|
|
1012 {
|
|
1013 v4 = pViewport->uViewportX;
|
|
1014 v5 = pViewport->uViewportZ;
|
|
1015 v2 = pViewport->uViewportY;
|
|
1016 v22 = pViewport->uViewportW;
|
|
1017 }
|
|
1018 else
|
|
1019 {
|
|
1020 v4 = 0;
|
|
1021 v5 = 640;
|
|
1022 v22 = 480;
|
|
1023 }
|
|
1024 v6 = this->uFrameX;
|
|
1025 if ( (signed int)this->uFrameX >= v4 )
|
|
1026 {
|
|
1027 v7 = this->uFrameWidth;
|
|
1028 if ( (signed int)(v7 + v6) <= (signed int)v5 )
|
|
1029 goto LABEL_9;
|
|
1030 v3->uFrameX = v5 - v7;
|
|
1031 }
|
|
1032 else
|
|
1033 {
|
|
1034 this->uFrameX = v4;
|
|
1035 }
|
|
1036 v3->uFrameY = pMouse->GetCursorPos(&a2)->y + 30;
|
|
1037 LABEL_9:
|
|
1038 v8 = v3->uFrameY;
|
|
1039 if ( (signed int)v8 >= (signed int)v2 )
|
|
1040 {
|
|
1041 if ( (signed int)(v8 + v3->uFrameHeight) <= (signed int)v22 )
|
|
1042 goto LABEL_14;
|
|
1043 v9 = pMouse->GetCursorPos(&a2)->y - v3->uFrameHeight - 30;
|
|
1044 }
|
|
1045 else
|
|
1046 {
|
|
1047 v9 = pMouse->GetCursorPos(&a2)->y + 30;
|
|
1048 }
|
|
1049 v3->uFrameY = v9;
|
|
1050 LABEL_14:
|
|
1051 if ( (signed int)v3->uFrameY < (signed int)v2 )
|
|
1052 v3->uFrameY = v2;
|
|
1053 if ( (signed int)v3->uFrameX < v4 )
|
|
1054 v3->uFrameX = v4;
|
|
1055 v10 = v3->uFrameWidth;
|
|
1056 v11 = v3->uFrameX;
|
|
1057 v12 = v3->uFrameY;
|
|
1058 v21 = v10;
|
|
1059 a2.y = v11;
|
|
1060 v3->uFrameZ = v10 + v11 - 1;
|
|
1061 v13 = v3->uFrameHeight;
|
|
1062 v3->uFrameW = v13 + v12 - 1;
|
|
1063 memcpy(&v19, v3, sizeof(v19));
|
|
1064 v19.uFrameX += 12;
|
|
1065 v19.uFrameWidth -= 24;
|
|
1066 v19.uFrameY += 12;
|
|
1067 v19.uFrameHeight -= 12;
|
|
1068 v19.uFrameZ = v19.uFrameWidth + v19.uFrameX - 1;
|
|
1069 v23 = v12;
|
|
1070 v19.uFrameW = v19.uFrameHeight + v19.uFrameY - 1;
|
44
|
1071 v14 = v3->Hint;
|
0
|
1072 if ( v14 )
|
|
1073 {
|
|
1074 v15 = pFontLucida->CalcTextHeight(v14, &v19, 0, 0);
|
|
1075 v12 = v23;
|
|
1076 v16 = v15 + 24;
|
|
1077 }
|
|
1078 else
|
|
1079 {
|
|
1080 v16 = v13;
|
|
1081 }
|
|
1082 if ( (signed int)v16 < 64 )
|
|
1083 v16 = 64;
|
|
1084 if ( (signed int)(v16 + v12) > 479 )
|
|
1085 v16 = 479 - v12;
|
|
1086 DrawPopupWindow(a2.y, v12, v21, v16);
|
44
|
1087 v17 = v3->Hint;
|
0
|
1088 if ( v17 )
|
|
1089 {
|
|
1090 v18 = pFontLucida->CalcTextHeight(v17, &v19, 0, 0);
|
|
1091 v19.DrawText2(pFontLucida, 0, (signed int)(v16 - v18) / 2 - 14, 0, v17, 3u);
|
|
1092 }
|
|
1093 }
|
|
1094
|
|
1095
|
|
1096 //----- (0041192C) --------------------------------------------------------
|
|
1097 void __cdecl InitializeBookTextures()
|
|
1098 {
|
|
1099 signed int v0; // ebp@3
|
|
1100 Texture **v1; // ebx@3
|
|
1101
|
|
1102 pAudioPlayer->StopChannels(-1, -1);
|
|
1103 ++pIcons_LOD->uTexturePacksCount;
|
|
1104 if ( !pIcons_LOD->uNumPrevLoadedFiles )
|
|
1105 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles;
|
|
1106 pAudioPlayer->PlaySound((SoundID)230, 0, 0, -1, 0, 0, 0, 0);
|
|
1107 pTextures_5064A0[9] = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("book", TEXTURE_16BIT_PALETTE)];
|
|
1108 pTexture_pagemask = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("pagemask", TEXTURE_16BIT_PALETTE)];
|
|
1109 pTexture_506448 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("ib-m5-u", TEXTURE_16BIT_PALETTE)];
|
|
1110 ptr_506440 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("ib-m5-d", TEXTURE_16BIT_PALETTE)];
|
|
1111 pTexture_50643C = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("ib-m6-u",TEXTURE_16BIT_PALETTE)];
|
|
1112 v0 = 1;
|
|
1113 v1 = (Texture **)&pTextures_tabs[0][0].pName[4];
|
|
1114 pTexture_506444 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("ib-m6-d",TEXTURE_16BIT_PALETTE)];
|
|
1115 do
|
|
1116 {
|
|
1117 *(&pTexture_pagemask + v0) = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(
|
|
1118 (const char *)pLloydsBeacons_SomeYs[v0 + 4],
|
|
1119 TEXTURE_16BIT_PALETTE)];
|
80
|
1120 sprintf(pTmpBuf, "tab%da", v0);
|
0
|
1121 *(v1 - 1) = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(pTmpBuf, TEXTURE_16BIT_PALETTE)];
|
80
|
1122 sprintf(pTmpBuf, "tab%db", v0++);
|
0
|
1123 *v1 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(pTmpBuf, TEXTURE_16BIT_PALETTE)];
|
|
1124 v1 += 2;
|
|
1125 }
|
|
1126 while ( (signed int)v1 <= (signed int)&unk_506494 );
|
|
1127 }
|
|
1128
|
|
1129 //----- (00411AAA) --------------------------------------------------------
|
|
1130 void __cdecl InitializeBookFonts()
|
|
1131 {
|
|
1132 pAudioPlayer->StopChannels(-1, -1);
|
|
1133 ++pIcons_LOD->uTexturePacksCount;
|
|
1134 if ( !pIcons_LOD->uNumPrevLoadedFiles )
|
|
1135 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles;
|
|
1136 pAudioPlayer->PlaySound((SoundID)230, 0, 0, -1, 0, 0, 0, 0);
|
|
1137 pTexture_mapbordr = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("mapbordr", TEXTURE_16BIT_PALETTE)];
|
|
1138 pBookFont = LoadFont("book.fnt", "FONTPAL", 0);
|
|
1139 pBook2Font = LoadFont("book2.fnt", "FONTPAL", 0);
|
|
1140 pAutonoteFont = LoadFont("autonote.fnt", "FONTPAL", 0);
|
|
1141 pSpellFont = LoadFont("spell.fnt", "FONTPAL", 0);
|
|
1142 }
|
|
1143
|
|
1144 //----- (00411B59) --------------------------------------------------------
|
|
1145 void __fastcall LoadThumbnailLloydTexture(unsigned int uSlot, unsigned int uPlayer)
|
|
1146 {
|
|
1147 unsigned int v2; // esi@1
|
|
1148 unsigned int v3; // edi@1
|
|
1149 FILE *v4; // ebx@1
|
|
1150 FILE *v5; // eax@2
|
|
1151 char pContainerName[64]; // [sp+Ch] [bp-44h]@1
|
|
1152 unsigned int v7; // [sp+4Ch] [bp-4h]@1
|
|
1153
|
|
1154 v2 = uSlot;
|
|
1155 v7 = uPlayer;
|
|
1156 v3 = uSlot + 1;
|
80
|
1157 sprintf(pContainerName, "data\\lloyd%d%d.pcx", uPlayer, uSlot + 1);
|
0
|
1158 v4 = fopen(pContainerName, "rb");
|
|
1159 if ( v4 )
|
|
1160 {
|
|
1161 pSavegameThumbnails[v2].LoadFromFILE(v4, 0, 1u);
|
|
1162 fclose(v4);
|
|
1163 }
|
|
1164 else
|
|
1165 {
|
80
|
1166 sprintf(pContainerName, "lloyd%d%d.pcx", v7, v3);
|
0
|
1167 v5 = pNew_LOD->FindContainer(pContainerName, 1);
|
|
1168 if ( v5 )
|
|
1169 pSavegameThumbnails[v2].LoadFromFILE(v5, 0, 0);
|
|
1170 else
|
|
1171 *((int *)&pSavegameThumbnails->pPixels + 10 * v2) = 0;
|
|
1172 }
|
|
1173 }
|
|
1174
|
|
1175
|
|
1176 //----- (00411621) --------------------------------------------------------
|
|
1177 GUIButton *GUIWindow::_411621()
|
|
1178 {
|
|
1179 Player *v1; // edi@1
|
|
1180 GUIWindow *v2; // esi@1
|
|
1181 unsigned int v3; // ebp@1
|
|
1182 int v4; // eax@3
|
|
1183 GUIButton *result; // eax@25
|
|
1184 int a2; // [sp+10h] [bp-8h]@1
|
|
1185 int v7; // [sp+14h] [bp-4h]@1
|
|
1186
|
|
1187 v1 = pPlayers[uActiveCharacter];
|
|
1188 v2 = this;
|
54
|
1189 LoadSpellbook(v1->pNumSpellBookPage);
|
0
|
1190 v3 = 0;
|
|
1191 a2 = 0;
|
54
|
1192 v7 = (int)(&v1->spellbook.pFireSpellbook + v1->pNumSpellBookPage);
|
0
|
1193 do
|
|
1194 {
|
|
1195 if ( *(char *)(v7 + v3) )
|
|
1196 {
|
54
|
1197 v4 = 2 * (12 * v1->pNumSpellBookPage + (unsigned __int8)*(&byte_4E2431[12 * v1->pNumSpellBookPage] + v3));
|
0
|
1198 v2->CreateButton(
|
|
1199 pViewport->uViewportX + dword_4E20D0[v4],
|
|
1200 pViewport->uViewportY + dword_4E20D0[v4 + 1],
|
|
1201 *(short *)(dword_50640C[v3] + 24),
|
|
1202 *(short *)(dword_50640C[v3] + 26),
|
|
1203 1,
|
|
1204 79,
|
|
1205 0x56u,
|
|
1206 v3,
|
|
1207 0,
|
59
|
1208 "",
|
0
|
1209 0);
|
|
1210 ++a2;
|
|
1211 }
|
|
1212 ++v3;
|
|
1213 }
|
|
1214 while ( (signed int)v3 < 11 );
|
59
|
1215 v2->CreateButton(0, 0, 0, 0, 1, 0, 0x33u, 0, 9u, "", 0);
|
0
|
1216 if ( a2 )
|
|
1217 v2->_41D08F(a2, 0, 0, 0);
|
|
1218 if ( v1->pActiveSkills[12] )
|
|
1219 v2->CreateButton(0x18Fu, 0xAu, 0x32u, 0x24u, 1, 0, 0x57u, 0, 0, aSpellSchoolNames[0], 0);
|
|
1220 if ( v1->pActiveSkills[13] )
|
|
1221 v2->CreateButton(0x18Fu, 0x2Eu, 0x32u, 0x24u, 1, 0, 0x57u, 1u, 0, aSpellSchoolNames[1], 0);
|
|
1222 if ( v1->pActiveSkills[14] )
|
|
1223 v2->CreateButton(0x18Fu, 0x53u, 0x32u, 0x24u, 1, 0, 0x57u, 2u, 0, aSpellSchoolNames[2], 0);
|
|
1224 if ( v1->pActiveSkills[15] )
|
|
1225 v2->CreateButton(0x18Fu, 0x79u, 0x32u, 0x24u, 1, 0, 0x57u, 3u, 0, aSpellSchoolNames[3], 0);
|
|
1226 if ( v1->pActiveSkills[16] )
|
|
1227 v2->CreateButton(0x18Fu, 0x9Eu, 0x32u, 0x24u, 1, 0, 0x57u, 4u, 0, aSpellSchoolNames[4], 0);
|
|
1228 if ( v1->pActiveSkills[17] )
|
|
1229 v2->CreateButton(0x190u, 0xC4u, 0x32u, 0x24u, 1, 0, 0x57u, 5u, 0, aSpellSchoolNames[5], 0);
|
|
1230 if ( v1->pActiveSkills[18] )
|
|
1231 v2->CreateButton(0x190u, 0xEAu, 0x32u, 0x24u, 1, 0, 0x57u, 6u, 0, aSpellSchoolNames[6], 0);
|
|
1232 if ( v1->pActiveSkills[19] )
|
|
1233 v2->CreateButton(0x190u, 0x10Fu, 0x32u, 0x24u, 1, 0, 0x57u, 7u, 0, aSpellSchoolNames[7], 0);
|
|
1234 if ( v1->pActiveSkills[20] )
|
|
1235 v2->CreateButton(0x190u, 0x133u, 0x32u, 0x24u, 1, 0, 0x57u, 8u, 0, aSpellSchoolNames[8], 0);
|
|
1236 v2->CreateButton(
|
|
1237 0x1DCu,
|
|
1238 0x1C2u,
|
|
1239 pTexture_506444->uTextureWidth,
|
|
1240 pTexture_506444->uTextureHeight,
|
|
1241 1,
|
|
1242 78,
|
|
1243 0x58u,
|
|
1244 0,
|
|
1245 0,
|
59
|
1246 "",
|
0
|
1247 0);
|
|
1248 ptr_5064F8 = v2->CreateButton(
|
|
1249 0x1DCu,
|
|
1250 0x1C2u,
|
|
1251 0x30u,
|
|
1252 0x20u,
|
|
1253 1,
|
|
1254 78,
|
|
1255 0x58u,
|
|
1256 0,
|
|
1257 0,
|
59
|
1258 "",
|
0
|
1259 pTexture_506444,
|
|
1260 0);
|
|
1261 v2->CreateButton(
|
|
1262 0x231u,
|
|
1263 0x1C2u,
|
|
1264 ptr_506440->uTextureWidth,
|
|
1265 ptr_506440->uTextureHeight,
|
|
1266 1,
|
|
1267 0,
|
|
1268 0x71u,
|
|
1269 0,
|
|
1270 0,
|
|
1271 pGlobalTXT_LocalizationStrings[79],
|
|
1272 0);
|
|
1273 result = v2->CreateButton(
|
|
1274 0x231u,
|
|
1275 0x1C2u,
|
|
1276 0x30u,
|
|
1277 0x20u,
|
|
1278 1,
|
|
1279 0,
|
|
1280 0x71u,
|
|
1281 0,
|
|
1282 0,
|
|
1283 pGlobalTXT_LocalizationStrings[79],
|
|
1284 ptr_506440,
|
|
1285 0);
|
|
1286 ptr_5064F4 = result;
|
|
1287 return result;
|
|
1288 }
|
|
1289 // 50640C: using guessed type int dword_50640C[];
|
|
1290
|
|
1291
|
|
1292 //----- (004B3157) --------------------------------------------------------
|
|
1293 void GUIWindow::_4B3157()
|
|
1294 {
|
|
1295 unsigned __int16 v1; // di@2
|
|
1296 const char *v2; // edx@4
|
|
1297 signed int v3; // edx@5
|
|
1298 char *v4; // edi@9
|
|
1299 int v5; // eax@45
|
|
1300 int v6; // edi@45
|
|
1301 char *v7; // eax@45
|
|
1302 int v8; // edi@46
|
|
1303 int v9; // eax@50
|
|
1304 unsigned int v10; // [sp-10h] [bp-C8h]@53
|
|
1305 unsigned __int16 v11; // [sp-Ch] [bp-C4h]@53
|
|
1306 unsigned int v12; // [sp-Ch] [bp-C4h]@60
|
|
1307 char *v13; // [sp-8h] [bp-C0h]@50
|
|
1308 unsigned int v14; // [sp-8h] [bp-C0h]@60
|
|
1309 unsigned int v15; // [sp-4h] [bp-BCh]@50
|
|
1310 Texture *v16; // [sp-4h] [bp-BCh]@60
|
|
1311 GUIWindow w; // [sp+Ch] [bp-ACh]@4
|
|
1312 GUIWindow v18; // [sp+60h] [bp-58h]@2
|
|
1313 int v19; // [sp+B4h] [bp-4h]@2
|
|
1314
|
|
1315 if ( !ptr_507BC0 )
|
|
1316 return;
|
|
1317 memcpy(&v18, this, sizeof(v18));
|
|
1318 v18.uFrameWidth -= 18;
|
|
1319 v18.uFrameZ -= 18;
|
|
1320 v1 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
|
|
1321 v19 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0x15u, 0x99u, 0xE9u);
|
|
1322 pRenderer->DrawTextureIndexed(0x1DDu, 0, pTexture_Dialogue_Background);
|
|
1323 pRenderer->DrawTextureTransparent(
|
|
1324 0x1D4u,
|
|
1325 0,
|
|
1326 (Texture *)(uTextureID_507B04 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_507B04] : 0));
|
|
1327 if ( array_5913D8[6] != (NPCData *)uNumDialogueNPCPortraits || !uHouse_ExitPic )
|
|
1328 {
|
|
1329 w.uFrameWidth = 130;
|
|
1330 w.uFrameHeight = 2 * LOBYTE(pFontCreate->uFontHeight);
|
|
1331
|
|
1332 //v2 = (const char *)p2DEvents_minus1_::04[13 * (unsigned int)ptr_507BC0->ptr_1C];
|
|
1333 v2 = p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].pName;
|
|
1334
|
|
1335 if ( v2 )
|
|
1336 {
|
|
1337 v3 = 2 * LOBYTE(pFontCreate->uFontHeight) - 6 - pFontCreate->CalcTextHeight(v2, &w, 0, 0);
|
|
1338 if ( v3 < 0 )
|
|
1339 v3 = 0;
|
|
1340 v18.DrawText2(
|
|
1341 pFontCreate,
|
|
1342 0x1EAu,
|
|
1343 v3 / 2 + 4,
|
|
1344 v1,
|
|
1345 //(const char *)p2DEvents_minus1_::04[13 * (unsigned int)ptr_507BC0->ptr_1C],
|
|
1346 p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].pName,
|
|
1347 3u);
|
|
1348 }
|
|
1349 }
|
|
1350 v18.uFrameWidth += 8;
|
|
1351 v18.uFrameZ += 8;
|
|
1352 if ( !array_5913D8[6] )
|
|
1353 {
|
|
1354 if ( dword_F8B198 == 31 )
|
|
1355 {
|
|
1356 LABEL_36:
|
|
1357 sub_4B4F4F();
|
|
1358 goto LABEL_58;
|
|
1359 }
|
|
1360 if ( ptr_F8B1E8 )
|
|
1361 {
|
|
1362 w.uFrameWidth = 458;
|
|
1363 w.uFrameZ = 457;
|
|
1364 v5 = pFontArrus->CalcTextHeight(ptr_F8B1E8, &w, 13, 0);
|
|
1365 v6 = v5 + 7;
|
|
1366 pRenderer->_4A6A68(
|
|
1367 8u,
|
|
1368 352 - (v5 + 7),
|
|
1369 (Texture *)(uTextureID_Leather != -1 ? &pIcons_LOD->pTextures[uTextureID_Leather] : 0),
|
|
1370 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - (v5 + 7));
|
|
1371 pRenderer->DrawTextureIndexed(8u, 347 - v6, pTexture_591428);
|
|
1372 v7 = FitTextInAWindow(ptr_F8B1E8, pFontArrus, &w, 0xDu, 0);
|
|
1373 ptr_507BC0->DrawText(pFontArrus, 13, 354 - v6, 0, v7, 0, 0, 0);
|
|
1374 }
|
|
1375 v8 = 0;
|
|
1376 if ( uNumDialogueNPCPortraits <= 0 )
|
|
1377 goto LABEL_58;
|
|
1378 while ( 1 )
|
|
1379 {
|
|
1380 pRenderer->DrawTextureIndexed(
|
|
1381 *(&_4E5E50_transui_x + v8 + 6 * uNumDialogueNPCPortraits - 6) - 4,
|
|
1382 *(&_4E5EE0_transui_y + v8 + 6 * uNumDialogueNPCPortraits - 6) - 4,
|
|
1383 (Texture *)(uTextureID_50795C != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_50795C] : 0));
|
|
1384 pRenderer->DrawTextureIndexed(
|
|
1385 *(&_4E5E50_transui_x + v8 + 6 * uNumDialogueNPCPortraits - 6),
|
|
1386 *(&_4E5EE0_transui_y + v8 + 6 * uNumDialogueNPCPortraits - 6),
|
|
1387 pDialogueNPCPortraits[v8]);
|
|
1388 if ( uNumDialogueNPCPortraits < 4 )
|
|
1389 break;
|
|
1390 LABEL_57:
|
|
1391 ++v8;
|
|
1392 if ( v8 >= uNumDialogueNPCPortraits )
|
|
1393 goto LABEL_58;
|
|
1394 }
|
|
1395 if ( v8 + 1 == uNumDialogueNPCPortraits && uHouse_ExitPic )
|
|
1396 {
|
|
1397 v15 = 3;
|
|
1398 v13 = pMapStats->pInfos[uHouse_ExitPic].pName;
|
|
1399 v9 = 94 * v8 + 113;
|
|
1400 }
|
|
1401 else
|
|
1402 {
|
|
1403 if ( !v8 && dword_591080 )
|
|
1404 {
|
|
1405 v15 = 3;
|
|
1406 //v13 = (char *)p2DEvents_minus1__10[13 * (unsigned int)ptr_507BC0->ptr_1C];
|
|
1407 v13 = (char *)p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].pProprieterTitle;
|
|
1408 v11 = v19;
|
|
1409 v10 = 113;
|
|
1410 LABEL_56:
|
|
1411 v18.DrawText2(pFontCreate, 0x1E3u, v10, v11, v13, v15);
|
|
1412 goto LABEL_57;
|
|
1413 }
|
|
1414 v15 = 3;
|
|
1415 v13 = array_5913D8[v8 - (dword_591080 != 0)]->pName;
|
|
1416 v9 = dword_4E5EC8[v8 + 6 * uNumDialogueNPCPortraits] + pDialogueNPCPortraits[v8]->uTextureHeight + 2;
|
|
1417 }
|
|
1418 v11 = v19;
|
|
1419 v10 = v9;
|
|
1420 goto LABEL_56;
|
|
1421 }
|
|
1422 v4 = (char *)array_5913D8[6] - 1;
|
|
1423 pRenderer->DrawTextureIndexed(
|
|
1424 _4E5E50_transui_x - 4,
|
|
1425 _4E5EE0_transui_y - 4,
|
|
1426 (Texture *)(uTextureID_50795C != -1 ? &pIcons_LOD->pTextures[uTextureID_50795C] : 0));
|
|
1427 pRenderer->DrawTextureIndexed(_4E5E50_transui_x, _4E5EE0_transui_y, pDialogueNPCPortraits[(signed int)v4]);
|
44
|
1428 if ( pCurrentScreen == 14 )
|
0
|
1429 {
|
|
1430 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
|
|
1431 goto LABEL_58;
|
|
1432 }
|
|
1433 if ( v4 || !dword_591080 )
|
|
1434 {
|
|
1435 sub_4B2A74();
|
|
1436 }
|
|
1437 else
|
|
1438 {
|
80
|
1439 sprintf(
|
0
|
1440 pTmpBuf,
|
|
1441 pGlobalTXT_LocalizationStrings[429],
|
|
1442 //p2DEvents_minus1_::08[13 * (unsigned int)ptr_507BC0->ptr_1C],
|
|
1443 p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].pProprieterName,
|
|
1444 //p2DEvents_minus1__10[13 * (unsigned int)ptr_507BC0->ptr_1C]);
|
|
1445 p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].pProprieterTitle);
|
|
1446 v18.DrawText2(pFontCreate, 0x1E3u, 0x71u, v19, pTmpBuf, 3u);
|
|
1447 if ( dword_F8B198 <= 18 )
|
|
1448 {
|
|
1449 switch ( dword_F8B198 )
|
|
1450 {
|
|
1451 case 18:
|
|
1452 sub_4B6478();
|
|
1453 break;
|
|
1454 case 1:
|
|
1455 sub_4B910F();
|
|
1456 break;
|
|
1457 case 2:
|
|
1458 sub_4BA928();
|
|
1459 break;
|
|
1460 case 3:
|
|
1461 ui_shop_teachers();
|
|
1462 break;
|
|
1463 case 4:
|
|
1464 sub_4B9CC6();
|
|
1465 break;
|
|
1466 default:
|
|
1467 if ( dword_F8B198 > 4 )
|
|
1468 {
|
|
1469 if ( dword_F8B198 <= 16 )
|
|
1470 {
|
|
1471 sub_4B5D7C();
|
|
1472 }
|
|
1473 else
|
|
1474 {
|
|
1475 if ( dword_F8B198 == 17 )
|
|
1476 sub_4B7911();
|
|
1477 }
|
|
1478 }
|
|
1479 break;
|
|
1480 }
|
|
1481 goto LABEL_58;
|
|
1482 }
|
|
1483 switch ( dword_F8B198 )
|
|
1484 {
|
|
1485 case 21:
|
|
1486 sub_4B8285_prolly_draw_arcomage_result();
|
|
1487 break;
|
|
1488 case 22:
|
|
1489 _4B7D7E_bank();
|
|
1490 break;
|
|
1491 case 23:
|
|
1492 sub_4B705E();
|
|
1493 break;
|
|
1494 default:
|
|
1495 if ( dword_F8B198 <= 26 )
|
|
1496 break;
|
|
1497 if ( dword_F8B198 <= 28 )
|
|
1498 {
|
|
1499 TravelByTransport();
|
|
1500 }
|
|
1501 else
|
|
1502 {
|
|
1503 if ( dword_F8B198 != 30 )
|
|
1504 {
|
|
1505 if ( dword_F8B198 != 31 )
|
|
1506 break;
|
|
1507 goto LABEL_36;
|
|
1508 }
|
|
1509 ui_training();
|
|
1510 }
|
|
1511 break;
|
|
1512 }
|
|
1513 }
|
|
1514 LABEL_58:
|
|
1515 if ( array_5913D8[6] == (NPCData *)uNumDialogueNPCPortraits && uHouse_ExitPic )
|
|
1516 {
|
|
1517 pRenderer->DrawTextureIndexed(
|
|
1518 0x22Cu,
|
|
1519 0x1C3u,
|
|
1520 (Texture *)(uTextureID_x_x_u != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_x_x_u] : 0));
|
|
1521 v16 = (Texture *)(uTextureID_x_ok_u != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_x_ok_u] : 0);
|
|
1522 v14 = 451;
|
|
1523 v12 = 476;
|
|
1524 }
|
|
1525 else
|
|
1526 {
|
|
1527 v16 = (Texture *)(uTextureID_506438 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_506438] : 0);
|
|
1528 v14 = 445;
|
|
1529 v12 = 471;
|
|
1530 }
|
|
1531 pRenderer->DrawTextureIndexed(v12, v14, v16);
|
|
1532 }
|
|
1533
|
|
1534
|
|
1535 //----- (004B1854) --------------------------------------------------------
|
|
1536 char *GUIWindow::_4B1854(__int64 a2)
|
|
1537 {
|
|
1538 unsigned int v2; // edi@1
|
|
1539 unsigned int v3; // esi@1
|
|
1540 unsigned int v4; // ebp@1
|
|
1541 unsigned int v5; // ebx@1
|
|
1542 signed __int64 v6; // ST2C_8@1
|
|
1543 signed __int64 v7; // kr00_8@1
|
|
1544 char *v8; // eax@2
|
|
1545 char *v9; // eax@7
|
|
1546 char *v10; // eax@13
|
|
1547 char *v11; // eax@19
|
|
1548 unsigned __int16 v12; // ST0C_2@22
|
|
1549 int v13; // eax@22
|
|
1550 GUIWindow *v15; // [sp+0h] [bp-1Ch]@1
|
|
1551 signed __int64 v16; // [sp+Ch] [bp-10h]@1
|
|
1552 signed __int64 v17; // [sp+14h] [bp-8h]@1
|
|
1553 unsigned int v18; // [sp+20h] [bp+4h]@1
|
|
1554
|
|
1555 v15 = this;
|
|
1556 v2 = (unsigned __int64)(signed __int64)((double)a2 * 0.234375) >> 32;
|
|
1557 v3 = (signed __int64)((double)a2 * 0.234375);
|
|
1558 v4 = (unsigned __int64)((signed __int64)((double)a2 * 0.234375) / 60) >> 32;
|
|
1559 v5 = (signed __int64)((double)a2 * 0.234375) / 60;
|
|
1560 v6 = (signed __int64)((double)a2 * 0.234375) / 60 / 60;
|
|
1561 v18 = (unsigned int)v6 / 0x18;
|
|
1562 v17 = (signed __int64)__PAIR__(v2, v3) % 60;
|
|
1563 v16 = (signed __int64)__PAIR__(v4, v5) % 60;
|
|
1564 v7 = v6 % 24;
|
|
1565 strcpy(pTmpBuf, pGlobalTXT_LocalizationStrings[532]);
|
|
1566 if ( (unsigned int)v6 / 0x18 )
|
|
1567 {
|
|
1568 v8 = pGlobalTXT_LocalizationStrings[57];
|
|
1569 if ( v18 <= 1 )
|
|
1570 v8 = pGlobalTXT_LocalizationStrings[56];
|
80
|
1571 sprintf(pTmpBuf2, "%d %s ", v18, v8);
|
0
|
1572 strcat(pTmpBuf, pTmpBuf2);
|
|
1573 }
|
|
1574 if ( v7 )
|
|
1575 {
|
|
1576 if ( v7 <= 1 )
|
|
1577 v9 = pGlobalTXT_LocalizationStrings[109];
|
|
1578 else
|
|
1579 v9 = pGlobalTXT_LocalizationStrings[110];
|
80
|
1580 sprintf(pTmpBuf2, "%d %s ", v7, v9);
|
0
|
1581 strcat(pTmpBuf, pTmpBuf2);
|
|
1582 }
|
|
1583 if ( v16 && !v18 )
|
|
1584 {
|
|
1585 if ( v16 <= 1 )
|
|
1586 v10 = pGlobalTXT_LocalizationStrings[437];
|
|
1587 else
|
|
1588 v10 = pGlobalTXT_LocalizationStrings[436];
|
80
|
1589 sprintf(pTmpBuf2, "%d %s ", v16, v10);
|
0
|
1590 strcat(pTmpBuf, pTmpBuf2);
|
|
1591 }
|
|
1592 if ( v17 && !v7 )
|
|
1593 {
|
|
1594 if ( v17 <= 1 )
|
|
1595 v11 = pGlobalTXT_LocalizationStrings[439];
|
|
1596 else
|
|
1597 v11 = pGlobalTXT_LocalizationStrings[438];
|
80
|
1598 sprintf(pTmpBuf2, "%d %s ", v17, v11);
|
0
|
1599 strcat(pTmpBuf, pTmpBuf2);
|
|
1600 }
|
|
1601 v12 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu);
|
|
1602 v13 = pFontArrus->CalcTextHeight(pTmpBuf, v15, 0, 0);
|
|
1603 return v15->DrawText2(pFontArrus, 0, (212 - v13) / 2 + 101, v12, pTmpBuf, 3u);
|
|
1604 }
|
|
1605
|
|
1606
|
|
1607
|
|
1608 //----- (0044D406) --------------------------------------------------------
|
|
1609 char *GUIWindow::DrawText2(GUIFont *a2, unsigned int uHorizontalMargin, unsigned int uVerticalMargin, unsigned __int16 uDefaultColor, const char *pInString, unsigned int uLineSpacing)
|
|
1610 {
|
|
1611 GUIWindow *v7; // esi@1
|
|
1612 unsigned int v8; // ebx@1
|
|
1613 char *v9; // eax@1
|
|
1614 char *result; // eax@1
|
|
1615 unsigned int v11; // edi@1
|
|
1616 signed int v12; // esi@1
|
|
1617 int v13; // eax@2
|
|
1618 GUIFont *v14; // [sp+Ch] [bp-4h]@1
|
|
1619 const char *Stra; // [sp+24h] [bp+14h]@5
|
|
1620
|
|
1621 v7 = this;
|
|
1622 v14 = a2;
|
|
1623 v8 = this->uFrameWidth - uHorizontalMargin;
|
|
1624 ui_current_text_color = uDefaultColor;
|
|
1625 v9 = FitTextInAWindow(pInString, a2, this, uHorizontalMargin, 0);
|
|
1626 result = strtok(v9, "\n");
|
|
1627 v11 = uHorizontalMargin + v7->uFrameX;
|
|
1628 v12 = uVerticalMargin + v7->uFrameY;
|
|
1629 while ( 1 )
|
|
1630 {
|
|
1631 Stra = result;
|
|
1632 if ( !result )
|
|
1633 break;
|
|
1634 v13 = (signed int)(v8 - v14->GetLineWidth(result)) >> 1;
|
|
1635 if ( v13 < 0 )
|
|
1636 v13 = 0;
|
|
1637 v14->DrawTextLine(uDefaultColor, v11 + v13, v12, Stra, 640);
|
|
1638 v12 += LOBYTE(v14->uFontHeight) - uLineSpacing;
|
|
1639 result = strtok(0, "\n");
|
|
1640 }
|
|
1641 return result;
|
|
1642 }
|
|
1643 // 5C6DB4: using guessed type int ui_current_text_color;
|
|
1644
|
|
1645
|
|
1646
|
|
1647 //----- (0044CE08) --------------------------------------------------------
|
|
1648 char GUIWindow::DrawText(GUIFont *a2, signed int uX, int uY, unsigned int uFontColor, const char *Str, int a7, int a8, unsigned int uFontShadowColor)
|
|
1649 {
|
|
1650 GUIWindow *v9; // edi@1
|
|
1651 GUIFont *v10; // ebx@1
|
|
1652 int v11; // eax@2
|
|
1653 signed int v12; // esi@9
|
|
1654 signed int v13; // edi@9
|
|
1655 int v14; // edx@9
|
|
1656 int v15; // eax@25
|
|
1657 unsigned int v16; // ecx@25
|
|
1658 int v17; // eax@27
|
|
1659 int v18; // edi@32
|
|
1660 int v19; // esi@38
|
|
1661 std::string v21; // [sp-18h] [bp-50h]@2
|
|
1662 const char *v22; // [sp-8h] [bp-40h]@2
|
|
1663 int v23; // [sp-4h] [bp-3Ch]@2
|
23
|
1664 char Dest[6]; // [sp+Ch] [bp-2Ch]@32
|
|
1665 //char v25; // [sp+Fh] [bp-29h]@32
|
|
1666 //char v26; // [sp+11h] [bp-27h]@34
|
0
|
1667 const char *v27; // [sp+20h] [bp-18h]@25
|
|
1668 int v28; // [sp+24h] [bp-14h]@25
|
|
1669 int v29; // [sp+28h] [bp-10h]@1
|
|
1670 size_t v30; // [sp+2Ch] [bp-Ch]@4
|
|
1671 GUIWindow *v31; // [sp+30h] [bp-8h]@1
|
|
1672 const char *v32; // [sp+34h] [bp-4h]@7
|
|
1673 size_t pInString; // [sp+4Ch] [bp+14h]@11
|
|
1674
|
|
1675 auto a1 = this;
|
|
1676 v29 = 0;
|
|
1677 v9 = a1;
|
|
1678 v10 = a2;
|
|
1679 v31 = a1;
|
|
1680 if ( !Str )
|
|
1681 {
|
|
1682 MessageBoxW(nullptr, L"Invalid string passed!", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Font.cpp:859", 0);
|
|
1683 return v11;
|
|
1684 }
|
|
1685 v11 = strcmp(Str, "null");
|
|
1686 if ( v11 )
|
|
1687 {
|
|
1688 v30 = strlen(Str);
|
|
1689 LOBYTE(v11) = 0;
|
|
1690 if ( !uX )
|
|
1691 uX = 12;
|
|
1692 if ( a8 )
|
|
1693 {
|
|
1694 v32 = Str;
|
|
1695 }
|
|
1696 else
|
|
1697 {
|
|
1698 v11 = (int)FitTextInAWindow(Str, v10, v9, uX, 0);
|
|
1699 v32 = (const char *)v11;
|
|
1700 }
|
|
1701 v12 = uX + v9->uFrameX;
|
|
1702 v13 = uY + v9->uFrameY;
|
|
1703 v14 = 0;
|
|
1704 if ( !a8 || (v11 = v13 + LOBYTE(v10->uFontHeight), v11 <= a8) )
|
|
1705 {
|
|
1706 pInString = 0;
|
|
1707 if ( (signed int)v30 > 0 )
|
|
1708 {
|
|
1709 do
|
|
1710 {
|
|
1711 LOBYTE(v11) = v32[v14];
|
|
1712 if ( (unsigned __int8)v11 >= v10->cFirstChar && (unsigned __int8)v11 <= v10->cLastChar
|
|
1713 || (char)v11 == 12
|
|
1714 || (char)v11 == 13
|
|
1715 || (char)v11 == 9
|
|
1716 || (char)v11 == 10 )
|
|
1717 {
|
|
1718 switch ( (unsigned __int8)v11 )
|
|
1719 {
|
|
1720 case 9u:
|
23
|
1721 strncpy(Dest, &v32[v14 + 1], 3u);
|
|
1722 Dest[3] = 0;
|
0
|
1723 pInString += 3;
|
23
|
1724 v29 = atoi(Dest);
|
|
1725 v19 = atoi(Dest);
|
0
|
1726 LOBYTE(v11) = (char)v31;
|
|
1727 v12 = uX + v31->uFrameX + v19;
|
|
1728 break;
|
|
1729 case 0xAu:
|
|
1730 v11 = LOBYTE(v10->uFontHeight);
|
|
1731 uY = uY + v11 - 3;
|
|
1732 v13 = uY + v31->uFrameY;
|
|
1733 v12 = uX + v29 + v31->uFrameX;
|
|
1734 if ( a8 )
|
|
1735 goto LABEL_36;
|
|
1736 break;
|
|
1737 case 0xCu:
|
23
|
1738 strncpy(Dest, &v32[v14 + 1], 5u);
|
|
1739 Dest[5] = 0;
|
|
1740 v11 = atoi(Dest);
|
0
|
1741 pInString += 5;
|
|
1742 uFontColor = v11;
|
|
1743 break;
|
|
1744 case 0xDu:
|
23
|
1745 strncpy(Dest, &v32[v14 + 1], 3u);
|
|
1746 Dest[3] = 0;
|
0
|
1747 pInString += 3;
|
23
|
1748 v18 = atoi(Dest);
|
0
|
1749 v11 = v10->GetLineWidth(&v32[pInString]);
|
|
1750 v12 = v31->uFrameZ - v11 - v18;
|
|
1751 v13 = uY + v31->uFrameY;
|
|
1752 if ( a8 )
|
|
1753 {
|
|
1754 v11 = LOBYTE(v10->uFontHeight);
|
|
1755 LABEL_36:
|
|
1756 v11 = v11 + v13 - 3;
|
|
1757 if ( v11 > a8 )
|
|
1758 return v11;
|
|
1759 break;
|
|
1760 }
|
|
1761 break;
|
|
1762 default:
|
|
1763 if ( (char)v11 == 34 && v32[v14 + 1] == 34 )
|
|
1764 {
|
|
1765 ++v14;
|
|
1766 pInString = v14;
|
|
1767 }
|
|
1768 v27 = &v32[v14];
|
|
1769 v15 = (unsigned __int8)v32[v14];
|
|
1770 v16 = *((int *)&v10->cFirstChar + 3 * v15 + 9);
|
|
1771 v28 = *((int *)&v10->cFirstChar + 3 * v15 + 9);
|
|
1772 if ( v14 > 0 )
|
|
1773 v12 += v10->pMetrics[v15].uLeftSpacing;
|
|
1774 v17 = (int)((char *)&v10[1] + v10->field_C20[v15]);
|
|
1775 if ( (short)uFontColor )
|
|
1776 pRenderer->DrawText(
|
|
1777 v12,
|
|
1778 v13,
|
|
1779 (unsigned __int8 *)v17,
|
|
1780 v16,
|
|
1781 LOBYTE(v10->uFontHeight),
|
|
1782 v10->pFontPalettes[0],
|
|
1783 uFontColor,
|
|
1784 uFontShadowColor);
|
|
1785 else
|
|
1786 pRenderer->DrawTextPalette(
|
|
1787 v12,
|
|
1788 v13,
|
|
1789 v17,
|
|
1790 v16,
|
|
1791 LOBYTE(v10->uFontHeight),
|
|
1792 v10->pFontPalettes[0],
|
|
1793 a7);
|
|
1794 LOBYTE(v11) = v30;
|
|
1795 v12 += v28;
|
|
1796 if ( (signed int)pInString < (signed int)v30 )
|
|
1797 {
|
|
1798 LOBYTE(v11) = 3 * *v27;
|
|
1799 v12 += v10->pMetrics[(unsigned __int8)*v27].uRightSpacing;
|
|
1800 }
|
|
1801 break;
|
|
1802 }
|
|
1803 }
|
|
1804 v14 = pInString++ + 1;
|
|
1805 }
|
|
1806 while ( (signed int)pInString < (signed int)v30 );
|
|
1807 }
|
|
1808 }
|
|
1809 }
|
|
1810 return v11;
|
|
1811 }
|
|
1812
|
|
1813
|
|
1814 //----- (0044CB4F) --------------------------------------------------------
|
|
1815 int GUIWindow::DrawTextInRect(GUIFont *a2, unsigned int uX, unsigned int uY, unsigned int uColor, const char *Str1, int Source, int a8)
|
|
1816 {
|
|
1817 GUIFont *v8; // edi@1
|
|
1818 int v9; // ebx@1
|
|
1819 int v11; // esi@3
|
|
1820 unsigned __int8 v12; // cl@7
|
|
1821 signed int v13; // esi@19
|
|
1822 signed int v14; // ebx@19
|
|
1823 unsigned __int8 v15; // cl@21
|
|
1824 int v16; // eax@22
|
|
1825 int v17; // ecx@22
|
|
1826 int v18; // ecx@23
|
|
1827 int v19; // ecx@24
|
|
1828 unsigned int v20; // ecx@26
|
|
1829 int v21; // eax@28
|
|
1830 int v22; // ebx@34
|
|
1831 int v23; // eax@34
|
|
1832 int v24; // ebx@36
|
|
1833 char Str; // [sp+Ch] [bp-20h]@34
|
|
1834 char v26; // [sp+Fh] [bp-1Dh]@34
|
|
1835 char v27; // [sp+11h] [bp-1Bh]@35
|
|
1836 int v28; // [sp+20h] [bp-Ch]@17
|
|
1837 GUIWindow *a1; // [sp+24h] [bp-8h]@1
|
|
1838 size_t v30; // [sp+28h] [bp-4h]@1
|
|
1839 size_t Str1a; // [sp+40h] [bp+14h]@5
|
|
1840 size_t Str1b; // [sp+40h] [bp+14h]@19
|
|
1841 const char *Sourcea; // [sp+44h] [bp+18h]@20
|
|
1842 int v34; // [sp+48h] [bp+1Ch]@26
|
|
1843
|
|
1844 v8 = a2;
|
|
1845 a1 = this;
|
|
1846 v30 = strlen(Str1);
|
|
1847 v9 = v8->GetLineWidth(Str1);
|
|
1848 if ( v9 < Source )
|
|
1849 {
|
|
1850 a1->DrawText(v8, uX, uY, uColor, Str1, 0, 0, 0);
|
|
1851 return v9;
|
|
1852 }
|
|
1853 strcpy(pTmpBuf2, Str1);
|
|
1854 v11 = 0;
|
|
1855 if ( a8 )
|
|
1856 _strrev(pTmpBuf2);
|
|
1857 Str1a = 0;
|
|
1858 if ( (signed int)v30 > 0 )
|
|
1859 {
|
|
1860 do
|
|
1861 {
|
|
1862 if ( v11 >= Source )
|
|
1863 break;
|
|
1864 if ( v8->IsCharValid(pTmpBuf2[Str1a]) )
|
|
1865 {
|
|
1866 if ( v12 < 9u )
|
|
1867 goto LABEL_12;
|
|
1868 if ( v12 > 0xAu )
|
|
1869 {
|
|
1870 if ( v12 == 12 )
|
|
1871 {
|
|
1872 Str1a += 5;
|
|
1873 }
|
|
1874 else
|
|
1875 {
|
|
1876 if ( v12 != 13 )
|
|
1877 {
|
|
1878 LABEL_12:
|
|
1879 if ( (signed int)Str1a > 0 )
|
|
1880 v11 += v8->pMetrics[v12].uLeftSpacing;
|
|
1881 v11 += *((int *)&v8->cFirstChar + 3 * v12 + 9);
|
|
1882 if ( (signed int)Str1a < (signed int)v30 )
|
|
1883 v11 += v8->pMetrics[v12].uRightSpacing;
|
|
1884 goto LABEL_16;
|
|
1885 }
|
|
1886 }
|
|
1887 }
|
|
1888 }
|
|
1889 LABEL_16:
|
|
1890 ++Str1a;
|
|
1891 }
|
|
1892 while ( (signed int)Str1a < (signed int)v30 );
|
|
1893 }
|
|
1894 pTmpBuf[Str1a + 1999] = 0;
|
|
1895 v30 = strlen(pTmpBuf2);
|
|
1896 v28 = v8->GetLineWidth(pTmpBuf2);
|
|
1897 if ( a8 )
|
|
1898 _strrev(pTmpBuf2);
|
|
1899 Str1b = 0;
|
|
1900 v13 = uX + a1->uFrameX;
|
|
1901 v14 = uY + a1->uFrameY;
|
|
1902 if ( (signed int)v30 > 0 )
|
|
1903 {
|
|
1904 Sourcea = &pTmpBuf2[1];
|
|
1905 do
|
|
1906 {
|
|
1907 if ( v8->IsCharValid(pTmpBuf2[Str1b]) )
|
|
1908 {
|
|
1909 v16 = v15;
|
|
1910 v17 = v15 - 9;
|
|
1911 if ( v17 )
|
|
1912 {
|
|
1913 v18 = v17 - 1;
|
|
1914 if ( v18 )
|
|
1915 {
|
|
1916 v19 = v18 - 2;
|
|
1917 if ( v19 )
|
|
1918 {
|
|
1919 if ( v19 == 1 )
|
|
1920 {
|
|
1921 strncpy(&Str, Sourcea, 3u);
|
|
1922 v26 = 0;
|
|
1923 Str1b += 3;
|
|
1924 Sourcea += 3;
|
|
1925 v22 = atoi(&Str);
|
|
1926 v23 = v8->GetLineWidth(&pTmpBuf2[Str1b]);
|
|
1927 v13 = a1->uFrameZ - v23 - v22;
|
|
1928 v14 = uY;
|
|
1929 }
|
|
1930 else
|
|
1931 {
|
|
1932 v20 = *((int *)&v8->cFirstChar + 3 * v16 + 9);
|
|
1933 v34 = *((int *)&v8->cFirstChar + 3 * v16 + 9);
|
|
1934 if ( (signed int)Str1b > 0 )
|
|
1935 v13 += v8->pMetrics[v16].uLeftSpacing;
|
|
1936 v21 = (int)((char *)&v8[1] + v8->field_C20[v16]);
|
|
1937 if ( (short)uColor )
|
|
1938 pRenderer->DrawText(
|
|
1939 v13,
|
|
1940 v14,
|
|
1941 (unsigned __int8 *)v21,
|
|
1942 v20,
|
|
1943 LOBYTE(v8->uFontHeight),
|
|
1944 v8->pFontPalettes[0],
|
|
1945 uColor,
|
|
1946 0);
|
|
1947 else
|
|
1948 pRenderer->DrawTextPalette(
|
|
1949 v13,
|
|
1950 v14,
|
|
1951 v21,
|
|
1952 v20,
|
|
1953 LOBYTE(v8->uFontHeight),
|
|
1954 v8->pFontPalettes[0],
|
|
1955 0);
|
|
1956 v13 += v34;
|
|
1957 if ( (signed int)Str1b < (signed int)v30 )
|
|
1958 v13 += v8->pMetrics[(unsigned __int8)pTmpBuf2[Str1b]].uRightSpacing;
|
|
1959 }
|
|
1960 }
|
|
1961 else
|
|
1962 {
|
|
1963 strncpy(&Str, Sourcea, 5u);
|
|
1964 v27 = 0;
|
|
1965 Str1b += 5;
|
|
1966 Sourcea += 5;
|
|
1967 uColor = atoi(&Str);
|
|
1968 }
|
|
1969 }
|
|
1970 else
|
|
1971 {
|
|
1972 v24 = LOBYTE(v8->uFontHeight);
|
|
1973 v13 = uX;
|
|
1974 uY = uY + v24 - 3;
|
|
1975 v14 = v24 + uY - 3;
|
|
1976 }
|
|
1977 }
|
|
1978 else
|
|
1979 {
|
|
1980 strncpy(&Str, Sourcea, 3u);
|
|
1981 v26 = 0;
|
|
1982 atoi(&Str);
|
|
1983 Str1b += 3;
|
|
1984 Sourcea += 3;
|
|
1985 }
|
|
1986 }
|
|
1987 ++Str1b;
|
|
1988 ++Sourcea;
|
|
1989 }
|
|
1990 while ( (signed int)Str1b < (signed int)v30 );
|
|
1991 }
|
|
1992 return v28;
|
|
1993 }
|
|
1994
|
|
1995 //----- (0041D12F) --------------------------------------------------------
|
|
1996 GUIButton *GUIWindow::CreateButton(unsigned int uX, unsigned int uY, unsigned int uWidth, unsigned int uHeight, int a6, int a7, unsigned int uControlID, unsigned int uControlParam, unsigned __int8 uHotkey, const char *pName, Texture *pTextures, ...)
|
|
1997 {
|
|
1998 GUIButton *v12; // esi@1
|
|
1999 unsigned int v13; // eax@1
|
|
2000 unsigned int v14; // ebx@4
|
|
2001 unsigned int v15; // eax@4
|
|
2002 unsigned int v16; // ebx@4
|
|
2003 unsigned int v17; // eax@4
|
|
2004 Texture *v18; // eax@4
|
|
2005 Texture **v19; // ecx@5
|
|
2006 Texture **v20; // edx@5
|
|
2007 GUIButton *v21; // eax@7
|
|
2008
|
|
2009 v12 = (GUIButton *)pAllocator->AllocNamedChunk(0, 0xBCu, "BUTTON");
|
|
2010 v12->pParent = this;
|
|
2011 v12->uX = uX + this->uFrameX;
|
|
2012 v13 = uY + this->uFrameY;
|
|
2013 v12->uHeight = uHeight;
|
|
2014 v12->uY = v13;
|
|
2015 v12->uWidth = uWidth;
|
|
2016 if ( a6 == 2 && !uHeight )
|
|
2017 v12->uHeight = uWidth;
|
|
2018 v14 = v12->uX;
|
|
2019 v12->uButtonType = a6;
|
|
2020 v15 = v14 + uWidth - 1;
|
|
2021 v16 = 0;
|
|
2022 v12->uZ = v15;
|
|
2023 v17 = v12->uY;
|
|
2024 v12->field_2C = 0;
|
|
2025 v12->uW = v17 + uHeight - 1;
|
|
2026 v12->field_1C = a7;
|
|
2027 v12->uControlID = uControlID;
|
|
2028 v12->uControlParam = uControlParam;
|
|
2029 v12->uHotkey = uHotkey;
|
|
2030 strlen(pName);
|
|
2031 strcpy(v12->pButtonName, pName);
|
|
2032 v18 = pTextures;
|
|
2033 if ( pTextures )
|
|
2034 {
|
|
2035 v19 = &pTextures;
|
|
2036 v20 = v12->pTextures;
|
|
2037 do
|
|
2038 {
|
|
2039 ++v19;
|
|
2040 *v20 = v18;
|
|
2041 ++v16;
|
|
2042 ++v20;
|
|
2043 v18 = *v19;
|
|
2044 }
|
|
2045 while ( *v19 );
|
|
2046 }
|
|
2047 v12->uNumTextures = v16;
|
|
2048 v21 = this->pControlsTail;
|
|
2049 if ( v21 )
|
|
2050 v21->pNext = v12;
|
|
2051 else
|
|
2052 this->pControlsHead = v12;
|
|
2053 v12->pPrev = this->pControlsTail;
|
|
2054 this->pControlsTail = v12;
|
|
2055 v12->pNext = 0;
|
|
2056 ++this->uNumControls;
|
|
2057 return v12;
|
|
2058 }
|
|
2059
|
|
2060 //----- (00459C2B) --------------------------------------------------------
|
|
2061 void GUIWindow::DrawFlashingInputCursor(signed int a3, int a4, GUIFont *a2)
|
|
2062 {
|
|
2063 signed int v4; // esi@1
|
|
2064 GUIWindow *v5; // edi@1
|
|
2065
|
|
2066 v4 = a3;
|
|
2067 v5 = this;
|
|
2068 if ( GetTickCount() % 1000 > 500 )
|
|
2069 DrawText(a2, v4, a4, 0, "_", 0, 0, 0);
|
|
2070 }
|
|
2071
|
|
2072
|
|
2073 //----- (0041C432) --------------------------------------------------------
|
2
|
2074 GUIWindow *GUIWindow::Create(unsigned int uX, unsigned int uY, unsigned int uWidth, unsigned int uHeight, WindowType eWindowType, int a4, int a5)
|
0
|
2075 {
|
|
2076 unsigned int uNextFreeWindowID; // ebp@1
|
2
|
2077 //int *v8; // eax@1
|
|
2078 //GUIWindow *pWindow; // esi@4
|
0
|
2079 int v10; // eax@4
|
|
2080 unsigned int v11; // ebx@15
|
|
2081 NPCData *v12; // ebp@15
|
|
2082 void *v13; // ecx@18
|
|
2083 bool v14; // eax@20
|
|
2084 void *v15; // ecx@23
|
|
2085 bool v16; // eax@25
|
|
2086 void *v17; // ecx@28
|
|
2087 bool v18; // eax@30
|
|
2088 void *v19; // ecx@33
|
|
2089 bool v20; // eax@35
|
|
2090 void *v21; // ecx@38
|
|
2091 bool v22; // eax@40
|
|
2092 void *v23; // ecx@43
|
|
2093 bool v24; // eax@45
|
|
2094 int v25; // eax@65
|
|
2095 unsigned int v26; // ebx@65
|
|
2096 char *v27; // eax@71
|
|
2097 const char *v29; // [sp-8h] [bp-18h]@68
|
|
2098 char *v30; // [sp-4h] [bp-14h]@68
|
|
2099 int uWidtha; // [sp+14h] [bp+4h]@66
|
|
2100 int a4a; // [sp+20h] [bp+10h]@15
|
|
2101
|
|
2102 uNextFreeWindowID = 0;
|
2
|
2103 for (uNextFreeWindowID = 0; uNextFreeWindowID < 20; ++uNextFreeWindowID)
|
0
|
2104 {
|
2
|
2105 if (pWindowList[uNextFreeWindowID].eWindowType == WINDOW_null)
|
0
|
2106 break;
|
|
2107 }
|
2
|
2108
|
|
2109
|
|
2110 auto pWindow = &pWindowList[uNextFreeWindowID];
|
0
|
2111 pWindow->uFrameWidth = uWidth;
|
|
2112 pWindow->uFrameZ = uX + uWidth - 1;
|
|
2113 pWindow->uFrameW = uY + uHeight - 1;
|
|
2114 pWindow->ptr_1C = (void *)a4;
|
44
|
2115 pWindow->Hint = (char *)a5;
|
0
|
2116 v10 = uNumVisibleWindows;
|
|
2117 pWindow->uFrameX = uX;
|
|
2118 ++v10;
|
|
2119 pWindow->uFrameY = uY;
|
|
2120 pWindow->uFrameHeight = uHeight;
|
2
|
2121 pWindow->eWindowType = eWindowType;
|
0
|
2122 pWindow->field_44 = 0;
|
|
2123 uNumVisibleWindows = v10;
|
|
2124 pWindow->field_3C = v10;
|
|
2125 pVisibleWindowsIdxs[v10] = uNextFreeWindowID + 1;
|
2
|
2126 if ( (signed int)eWindowType <= 20 )
|
0
|
2127 {
|
2
|
2128 if (eWindowType != WINDOW_Chest)
|
0
|
2129 {
|
2
|
2130 switch (eWindowType)
|
0
|
2131 {
|
2
|
2132 case WINDOW_Book:
|
0
|
2133 pWindow->InitializeBookView();
|
|
2134 break;
|
2
|
2135 case WINDOW_A:
|
44
|
2136 dword_506978 = pCurrentScreen;
|
|
2137 pCurrentScreen = 4;
|
0
|
2138 ptr_5076F4 = pWindow->CreateButton(
|
|
2139 0x1D7u,
|
|
2140 0x1BDu,
|
|
2141 0xA9u,
|
|
2142 0x23u,
|
|
2143 1,
|
|
2144 0,
|
|
2145 0x71u,
|
|
2146 0,
|
|
2147 0,
|
2
|
2148 pGlobalTXT_LocalizationStrings[79], //"Exit"
|
|
2149 (Texture *)(uTextureID_506438 != -1 ? &pIcons_LOD->pTextures[uTextureID_506438] : 0),
|
0
|
2150 0);
|
|
2151 if ( pWindow->ptr_1C != (void *)1 )
|
|
2152 {
|
|
2153 a4a = 0;
|
|
2154 v11 = LOBYTE(pFontArrus->uFontHeight) - 3;
|
|
2155 v12 = GetNPCData(uDialogue_SpeakingActorNPC_ID);
|
|
2156 if ( sub_445C8B(uDialogue_SpeakingActorNPC_ID) == 1 )
|
|
2157 {
|
|
2158 if ( v12->joins )
|
|
2159 {
|
2
|
2160 pWindow->CreateButton(0x1E0u, 0x82u, 0x8Cu, v11, 1, 0, 0x88u, 0xDu, 0, "", 0);
|
0
|
2161 a4a = 1;
|
|
2162 }
|
|
2163 v13 = (void *)v12->bDrawSomeAnim;
|
|
2164 if ( v13 )
|
|
2165 {
|
|
2166 if ( a4a < 4 )
|
|
2167 {
|
|
2168 v14 = sub_4466C4(v13);
|
|
2169 if ( v14 == 1 || v14 == 2 )
|
|
2170 pWindow->CreateButton(
|
|
2171 0x1E0u,
|
|
2172 a4a++ * v11 + 130,
|
|
2173 0x8Cu,
|
|
2174 v11,
|
|
2175 1,
|
|
2176 0,
|
|
2177 0x88u,
|
|
2178 0x13u,
|
|
2179 0,
|
59
|
2180 "",
|
0
|
2181 0);
|
|
2182 }
|
|
2183 }
|
|
2184 v15 = (void *)v12->evtb;
|
|
2185 if ( v15 )
|
|
2186 {
|
|
2187 if ( a4a < 4 )
|
|
2188 {
|
|
2189 v16 = sub_4466C4(v15);
|
|
2190 if ( v16 == 1 || v16 == 2 )
|
|
2191 pWindow->CreateButton(
|
|
2192 0x1E0u,
|
|
2193 a4a++ * v11 + 130,
|
|
2194 0x8Cu,
|
|
2195 v11,
|
|
2196 1,
|
|
2197 0,
|
|
2198 0x88u,
|
|
2199 0x14u,
|
|
2200 0,
|
59
|
2201 "",
|
0
|
2202 0);
|
|
2203 }
|
|
2204 }
|
|
2205 v17 = (void *)v12->evtc;
|
|
2206 if ( v17 )
|
|
2207 {
|
|
2208 if ( a4a < 4 )
|
|
2209 {
|
|
2210 v18 = sub_4466C4(v17);
|
|
2211 if ( v18 == 1 || v18 == 2 )
|
|
2212 pWindow->CreateButton(
|
|
2213 0x1E0u,
|
|
2214 a4a++ * v11 + 130,
|
|
2215 0x8Cu,
|
|
2216 v11,
|
|
2217 1,
|
|
2218 0,
|
|
2219 0x88u,
|
|
2220 0x15u,
|
|
2221 0,
|
59
|
2222 "",
|
0
|
2223 0);
|
|
2224 }
|
|
2225 }
|
|
2226 v19 = (void *)v12->evtd;
|
|
2227 if ( v19 )
|
|
2228 {
|
|
2229 if ( a4a < 4 )
|
|
2230 {
|
|
2231 v20 = sub_4466C4(v19);
|
|
2232 if ( v20 == 1 || v20 == 2 )
|
|
2233 pWindow->CreateButton(
|
|
2234 0x1E0u,
|
|
2235 a4a++ * v11 + 130,
|
|
2236 0x8Cu,
|
|
2237 v11,
|
|
2238 1,
|
|
2239 0,
|
|
2240 0x88u,
|
|
2241 0x16u,
|
|
2242 0,
|
59
|
2243 "",
|
0
|
2244 0);
|
|
2245 }
|
|
2246 }
|
|
2247 v21 = (void *)v12->evte;
|
|
2248 if ( v21 )
|
|
2249 {
|
|
2250 if ( a4a < 4 )
|
|
2251 {
|
|
2252 v22 = sub_4466C4(v21);
|
|
2253 if ( v22 == 1 || v22 == 2 )
|
|
2254 pWindow->CreateButton(
|
|
2255 0x1E0u,
|
|
2256 a4a++ * v11 + 130,
|
|
2257 0x8Cu,
|
|
2258 v11,
|
|
2259 1,
|
|
2260 0,
|
|
2261 0x88u,
|
|
2262 0x17u,
|
|
2263 0,
|
59
|
2264 "",
|
0
|
2265 0);
|
|
2266 }
|
|
2267 }
|
|
2268 v23 = (void *)v12->evtf;
|
|
2269 if ( v23 )
|
|
2270 {
|
|
2271 if ( a4a < 4 )
|
|
2272 {
|
|
2273 v24 = sub_4466C4(v23);
|
|
2274 if ( v24 == 1 || v24 == 2 )
|
|
2275 pWindow->CreateButton(
|
|
2276 0x1E0u,
|
|
2277 a4a++ * v11 + 130,
|
|
2278 0x8Cu,
|
|
2279 v11,
|
|
2280 1,
|
|
2281 0,
|
|
2282 0x88u,
|
|
2283 0x18u,
|
|
2284 0,
|
59
|
2285 "",
|
0
|
2286 0);
|
|
2287 }
|
|
2288 }
|
|
2289 }
|
|
2290 else
|
|
2291 {
|
|
2292 if ( v12->joins )
|
|
2293 {
|
|
2294 pWindow->CreateButton(
|
|
2295 0x1E0u,
|
|
2296 0x82u,
|
|
2297 0x8Cu,
|
|
2298 v11,
|
|
2299 1,
|
|
2300 0,
|
|
2301 0x88u,
|
|
2302 0x4Du,
|
|
2303 0,
|
|
2304 pGlobalTXT_LocalizationStrings[407],
|
|
2305 0);
|
|
2306 if ( v12->uFlags & 0x80 )
|
|
2307 {
|
80
|
2308 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[408], v12->pName);
|
0
|
2309 pWindow->CreateButton(0x1E0u, v11 + 130, 0x8Cu, v11, 1, 0, 0x88u, 0x4Cu, 0, pTmpBuf, 0);
|
|
2310 }
|
|
2311 else
|
|
2312 {
|
|
2313 pWindow->CreateButton(
|
|
2314 0x1E0u,
|
|
2315 v11 + 130,
|
|
2316 0x8Cu,
|
|
2317 v11,
|
|
2318 1,
|
|
2319 0,
|
|
2320 0x88u,
|
|
2321 0x4Cu,
|
|
2322 0,
|
|
2323 pGlobalTXT_LocalizationStrings[406],
|
|
2324 0);
|
|
2325 }
|
|
2326 a4a = 2;
|
|
2327 }
|
|
2328 }
|
|
2329 pWindow->_41D08F(a4a, 1, 0, 1);
|
|
2330 }
|
|
2331 break;
|
2
|
2332 case WINDOW_11:
|
44
|
2333 dword_506978 = pCurrentScreen;
|
|
2334 pCurrentScreen = 17;
|
0
|
2335 ptr_5076F4 = pWindow->CreateButton(
|
|
2336 0x236u,
|
|
2337 0x1BDu,
|
|
2338 0x4Bu,
|
|
2339 0x21u,
|
|
2340 1,
|
|
2341 0,
|
|
2342 0x5Bu,
|
|
2343 0,
|
|
2344 0x4Eu,
|
|
2345 pGlobalTXT_LocalizationStrings[156],
|
|
2346 (Texture *)(uTextureID_BUTTDESC2 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_BUTTDESC2] : 0),
|
|
2347 0);
|
|
2348 ptr_5076FC = pWindow->CreateButton(
|
|
2349 0x1E6u,
|
|
2350 0x1BDu,
|
|
2351 0x4Bu,
|
|
2352 0x21u,
|
|
2353 1,
|
|
2354 0,
|
|
2355 0x5Au,
|
|
2356 0,
|
|
2357 0x59u,
|
44
|
2358 pWindow->Hint,
|
0
|
2359 (Texture *)(uTextureID_BUTTYES2 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_BUTTYES2] : 0),
|
|
2360 0);
|
|
2361 pWindow->CreateButton(
|
|
2362 _4E5E50_transui_x,
|
|
2363 _4E5EE0_transui_y,
|
|
2364 0x3Fu,
|
|
2365 0x49u,
|
|
2366 1,
|
|
2367 0,
|
|
2368 0x5Au,
|
|
2369 1u,
|
|
2370 0x20u,
|
44
|
2371 pWindow->Hint,
|
0
|
2372 0,
|
|
2373 0,
|
|
2374 0);
|
44
|
2375 pWindow->CreateButton(8u, 8u, 0x1CCu, 0x158u, 1, 0, 0x5Au, 1u, 0, pWindow->Hint, 0);
|
0
|
2376 break;
|
2
|
2377 case WINDOW_12:
|
0
|
2378 InitializeBookTextures();
|
|
2379 pWindow->_411621();
|
|
2380 break;
|
2
|
2381 case WINDOW_13:
|
44
|
2382 dword_506978 = pCurrentScreen;
|
0
|
2383 pKeyActionMap->_459E5A(0, 15, pWindow);
|
44
|
2384 pCurrentScreen = 19;
|
0
|
2385 break;
|
|
2386 }
|
|
2387 return pWindow;
|
|
2388 }
|
|
2389 LABEL_62:
|
59
|
2390 pWindow->CreateButton(0x3Du, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 1u, 0x31u, "", 0);
|
|
2391 pWindow->CreateButton(0xB1u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 2u, 0x32u, "", 0);
|
|
2392 pWindow->CreateButton(0x124u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 3u, 0x33u, "", 0);
|
|
2393 pWindow->CreateButton(0x197u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 4u, 0x34u, "", 0);
|
|
2394 pWindow->CreateButton(0, 0, 0, 0, 1, 0, 0xB0u, 0, 9u, "", 0);
|
0
|
2395 return pWindow;
|
|
2396 }
|
2
|
2397 if (eWindowType == WINDOW_HouseInterior)
|
0
|
2398 {
|
44
|
2399 pCurrentScreen = 13;
|
0
|
2400 ptr_5076F4 = pWindow->CreateButton(
|
|
2401 0x1D7u,
|
|
2402 0x1BDu,
|
|
2403 0xA9u,
|
|
2404 0x23u,
|
|
2405 1,
|
|
2406 0,
|
|
2407 0x71u,
|
|
2408 0,
|
|
2409 0,
|
|
2410 pGlobalTXT_LocalizationStrings[80],
|
|
2411 (Texture *)(uTextureID_506438 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_506438] : 0),
|
|
2412 0);
|
|
2413 v25 = uNumDialogueNPCPortraits;
|
|
2414 v26 = 0;
|
|
2415 if ( uNumDialogueNPCPortraits > 0 )
|
|
2416 {
|
|
2417 do
|
|
2418 {
|
|
2419 uWidtha = v26 + 1;
|
|
2420 if ( v26 + 1 == v25 && uHouse_ExitPic )
|
|
2421 {
|
|
2422 v30 = pMapStats->pInfos[uHouse_ExitPic].pName;
|
|
2423 v29 = pGlobalTXT_LocalizationStrings[411];
|
|
2424 }
|
|
2425 else
|
|
2426 {
|
|
2427 if ( v26 || !dword_591080 )
|
|
2428 v27 = array_5913D8[v26 - (dword_591080 != 0)]->pName;
|
|
2429 else
|
|
2430 //v27 = (char *)p2DEvents_minus1_::08[13 * a4];
|
|
2431 v27 = (char *)p2DEvents[a4 - 1].pProprieterName;
|
|
2432 v30 = v27;
|
|
2433 v29 = pGlobalTXT_LocalizationStrings[435];
|
|
2434 }
|
80
|
2435 sprintf(&byte_591180[100 * v26], v29, v30);
|
0
|
2436 array_5913D8[v26 + 7] = (NPCData *)pWindow->CreateButton(
|
|
2437 *(&_4E5E50_transui_x + v26 + 6 * uNumDialogueNPCPortraits - 6),
|
|
2438 *(&_4E5EE0_transui_y + v26 + 6 * uNumDialogueNPCPortraits - 6),
|
|
2439 0x3Fu,
|
|
2440 0x49u,
|
|
2441 1,
|
|
2442 0,
|
|
2443 0x19Au,
|
|
2444 v26,
|
|
2445 0,
|
|
2446 &byte_591180[100 * v26],
|
|
2447 0,
|
|
2448 0,
|
|
2449 0);
|
|
2450 ++v26;
|
|
2451 v25 = uNumDialogueNPCPortraits;
|
|
2452 }
|
|
2453 while ( uWidtha < uNumDialogueNPCPortraits );
|
|
2454 }
|
|
2455 if ( v25 == 1 )
|
|
2456 {
|
|
2457 ptr_507BC0 = &pWindowList[uNextFreeWindowID];
|
|
2458 _4B4224_UpdateNPCTopics(0);
|
|
2459 }
|
|
2460 }
|
|
2461 else
|
|
2462 {
|
2
|
2463 if (eWindowType == WINDOW_1A)
|
0
|
2464 {
|
44
|
2465 dword_506978 = pCurrentScreen;
|
|
2466 pCurrentScreen = 18;
|
0
|
2467 ptr_5076F4 = pWindow->CreateButton(
|
|
2468 0x236u,
|
|
2469 0x1BDu,
|
|
2470 0x4Bu,
|
|
2471 0x21u,
|
|
2472 1,
|
|
2473 0,
|
|
2474 0x19Cu,
|
|
2475 0,
|
|
2476 0x4Eu,
|
|
2477 pGlobalTXT_LocalizationStrings[34],
|
|
2478 (Texture *)(uTextureID_BUTTDESC2 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_BUTTDESC2] : 0),
|
|
2479 0);
|
|
2480 ptr_5076FC = pWindow->CreateButton(
|
|
2481 0x1E6u,
|
|
2482 0x1BDu,
|
|
2483 0x4Bu,
|
|
2484 0x21u,
|
|
2485 1,
|
|
2486 0,
|
|
2487 0x19Bu,
|
|
2488 0,
|
|
2489 0x59u,
|
44
|
2490 pWindow->Hint,
|
0
|
2491 (Texture *)(uTextureID_BUTTYES2 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_BUTTYES2] : 0),
|
|
2492 0);
|
|
2493 pWindow->CreateButton(
|
|
2494 _4E5E50_transui_x,
|
|
2495 _4E5EE0_transui_y,
|
|
2496 0x3Fu,
|
|
2497 0x49u,
|
|
2498 1,
|
|
2499 0,
|
|
2500 0x19Bu,
|
|
2501 1u,
|
|
2502 0x20u,
|
44
|
2503 pWindow->Hint,
|
0
|
2504 0);
|
44
|
2505 pWindow->CreateButton(8u, 8u, 0x1CCu, 0x158u, 1, 0, 0x19Bu, 1u, 0, pWindow->Hint, 0);
|
0
|
2506 return pWindow;
|
|
2507 }
|
2
|
2508 if (eWindowType == WINDOW_1B)
|
0
|
2509 {
|
|
2510 pEventTimer->Pause();
|
|
2511 pAudioPlayer->StopChannels(-1, -1);
|
|
2512 pMouse->SetCursorBitmap("MICON2");
|
|
2513 ShowStatusBarString(pGlobalTXT_LocalizationStrings[39], 2u);
|
|
2514 return pWindow;
|
|
2515 }
|
2
|
2516 if (eWindowType == WINDOW_1E)
|
0
|
2517 goto LABEL_62;
|
2
|
2518 if (eWindowType == WINDOW_1F)
|
0
|
2519 {
|
|
2520 pMouse->SetCursorBitmap("MICON2");
|
|
2521 ptr_5076F4 = pWindow->CreateButton(
|
|
2522 0x188u,
|
|
2523 0x13Eu,
|
|
2524 0x4Bu,
|
|
2525 0x21u,
|
|
2526 1,
|
|
2527 0,
|
|
2528 0x71u,
|
|
2529 0,
|
|
2530 0,
|
|
2531 pGlobalTXT_LocalizationStrings[34],
|
|
2532 (Texture *)(uTextureID_BUTTDESC2 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_BUTTDESC2] : 0),
|
|
2533 0);
|
|
2534 ShowStatusBarString(pGlobalTXT_LocalizationStrings[39], 2u);
|
|
2535 ++pIcons_LOD->uTexturePacksCount;
|
|
2536 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 103;
|
44
|
2537 pCurrentScreen = 23;
|
0
|
2538 if ( !pIcons_LOD->uNumPrevLoadedFiles )
|
|
2539 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles;
|
|
2540 }
|
|
2541 }
|
|
2542 return pWindow;
|
|
2543 } |