Mercurial > mm7
annotate UiGame.cpp @ 1127:1c65d99d224d
sub_451007_scale_image_bicubic cleanup - removing commented out sections for readability
author | Grumpy7 |
---|---|
date | Fri, 31 May 2013 05:39:43 +0200 |
parents | 4339bb88c4f5 |
children | 29a8defbad9e |
rev | line source |
---|---|
706 | 1 #include <assert.h> |
2 | |
3 #include "MM7.h" | |
4 | |
1016 | 5 #include "BSPModel.h" |
6 #include "LightmapBuilder.h" | |
7 #include "DecalBuilder.h" | |
8 #include "ParticleEngine.h" | |
9 #include "Mouse.h" | |
10 #include "Keyboard.h" | |
11 #include "IndoorCameraD3D.h" | |
12 #include "CShow.h" | |
13 #include "GammaControl.h" | |
14 #include "stru6.h" | |
15 #include "stru9.h" | |
16 #include "stru10.h" | |
17 #include "stru11.h" | |
18 #include "stru12.h" | |
19 | |
20 #include "Vis.h" | |
706 | 21 #include "MapInfo.h" |
22 #include "Game.h" | |
23 #include "GUIWindow.h" | |
24 #include "GUIFont.h" | |
25 #include "GUIProgressBar.h" | |
26 #include "Party.h" | |
27 #include "AudioPlayer.h" | |
28 #include "Outdoor.h" | |
29 #include "IndoorCamera.h" | |
30 #include "Overlays.h" | |
31 #include "Monsters.h" | |
32 #include "Arcomage.h" | |
33 #include "LOD.h" | |
34 #include "Actor.h" | |
35 #include "Allocator.h" | |
36 #include "Events.h" | |
37 #include "Viewport.h" | |
38 #include "FrameTableInc.h" | |
39 #include "Math.h" | |
40 #include "SpriteObject.h" | |
41 #include "ObjectList.h" | |
42 #include "Chest.h" | |
43 #include "PaletteManager.h" | |
44 #include "DecorationList.h" | |
45 #include "PlayerFrameTable.h" | |
46 #include "SaveLoad.h" | |
47 #include "stru123.h" | |
48 #include "Time.h" | |
49 #include "IconFrameTable.h" | |
50 #include "Awards.h" | |
51 #include "Autonotes.h" | |
52 #include "stru160.h" | |
53 #include "TurnEngine.h" | |
924 | 54 #include "CastSpellInfo.h" |
706 | 55 #include "Weather.h" |
56 #include "stru298.h" | |
57 #include "StorylineTextTable.h" | |
58 #include "Events2D.h" | |
59 #include "texts.h" | |
747 | 60 #include "UIHouses.h" |
706 | 61 |
62 #include "mm7_data.h" | |
63 | |
64 | |
65 | |
66 | |
995 | 67 int uTextureID_GameUI_CharSelectionFrame; // 50C98C |
68 | |
991 | 69 |
1033 | 70 |
71 | |
72 | |
1038 | 73 //----- (00421D00) -------------------------------------------------------- |
74 void __fastcall GameUI_OnPlayerPortraitLeftClick(unsigned int uPlayerID) | |
75 { | |
76 //unsigned int v1; // esi@1 | |
77 //int v2; // eax@2 | |
78 //Player *v3; // ecx@2 | |
79 //Player *v4; // ecx@5 | |
80 unsigned int v5; // [sp-4h] [bp-10h]@21 | |
81 | |
82 //v1 = uPlayerID; | |
83 auto player = &pParty->pPlayers[uPlayerID - 1]; | |
84 if (pParty->pPickedItem.uItemID) | |
85 { | |
86 //v3 = player; | |
87 if (auto slot = player->AddItem(-1, pParty->pPickedItem.uItemID)) | |
88 { | |
89 memcpy(&player->pInventoryItems[slot-1], &pParty->pPickedItem, 0x24u); | |
90 viewparams->bRedrawGameUI = true; | |
91 pMouse->RemoveHoldingItem(); | |
92 return; | |
93 } | |
94 | |
95 if (!player->CanAct()) | |
96 { | |
97 player = pPlayers[uActiveCharacter]; | |
98 } | |
99 if(player->CanAct() || !pPlayers[uActiveCharacter]->CanAct()) | |
100 player->PlaySound(SPEECH_NoRoom, 0); | |
101 } | |
102 | |
103 //LABEL_9: | |
104 if (pCurrentScreen == SCREEN_GAME) | |
105 { | |
106 viewparams->bRedrawGameUI = true; | |
107 if ( uActiveCharacter != uPlayerID ) | |
108 //goto LABEL_27; | |
109 { | |
110 if ( pPlayers[uPlayerID]->uTimeToRecovery ) | |
111 return; | |
112 | |
113 uActiveCharacter = uPlayerID; | |
114 return; | |
115 } | |
116 v5 = 7; | |
117 //LABEL_22: | |
118 pGUIWindow_CurrentMenu = CharacterUI_Initialize(v5); | |
119 return; | |
120 } | |
121 if ( pCurrentScreen == SCREEN_SPELL_BOOK ) | |
122 return; | |
123 if ( pCurrentScreen == SCREEN_CHEST ) | |
124 { | |
125 //LABEL_23: | |
126 viewparams->bRedrawGameUI = true; | |
127 if ( uActiveCharacter == uPlayerID ) | |
128 { | |
129 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 103; | |
130 pCurrentScreen = SCREEN_CHEST_INVENTORY; | |
131 //goto LABEL_28; | |
132 uActiveCharacter = uPlayerID; | |
133 return; | |
134 } | |
135 //LABEL_27: | |
136 if ( pPlayers[uPlayerID]->uTimeToRecovery ) | |
137 return; | |
138 //goto LABEL_28; | |
139 uActiveCharacter = uPlayerID; | |
140 return; | |
141 } | |
142 if ( pCurrentScreen != SCREEN_HOUSE ) | |
143 { | |
144 if ( pCurrentScreen == SCREEN_E ) | |
145 { | |
146 //LABEL_28: | |
147 uActiveCharacter = uPlayerID; | |
148 return; | |
149 } | |
150 if ( pCurrentScreen != SCREEN_CHEST_INVENTORY ) | |
151 { | |
152 viewparams->bRedrawGameUI = true; | |
153 uActiveCharacter = uPlayerID; | |
154 if ( pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] == 102 ) | |
155 FillAwardsData(); | |
156 return; | |
157 } | |
158 //goto LABEL_23; | |
159 viewparams->bRedrawGameUI = true; | |
160 if ( uActiveCharacter == uPlayerID ) | |
161 { | |
162 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 103; | |
163 pCurrentScreen = SCREEN_CHEST_INVENTORY; | |
164 //goto LABEL_28; | |
165 uActiveCharacter = uPlayerID; | |
166 return; | |
167 } | |
168 //LABEL_27: | |
169 if ( pPlayers[uPlayerID]->uTimeToRecovery ) | |
170 return; | |
171 //goto LABEL_28; | |
172 uActiveCharacter = uPlayerID; | |
173 return; | |
174 } | |
175 if ( window_SpeakInHouse->receives_keyboard_input_2 == WINDOW_INPUT_IN_PROGRESS) | |
176 return; | |
177 viewparams->bRedrawGameUI = true; | |
178 if ( uActiveCharacter != uPlayerID ) | |
179 //goto LABEL_28; | |
180 uActiveCharacter = uPlayerID; | |
181 return; | |
182 if (dialog_menu_id == HOUSE_DIALOGUE_SHOP_BUY_STANDARD || dialog_menu_id == HOUSE_DIALOGUE_SHOP_6) | |
183 { | |
184 __debugbreak(); // fix indexing | |
185 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 103; | |
186 v5 = 14; | |
187 //goto LABEL_22; | |
188 pGUIWindow_CurrentMenu = CharacterUI_Initialize(v5); | |
189 return; | |
190 } | |
191 } | |
192 // 4E28F8: using guessed type int pCurrentScreen; | |
193 // F8B19C: using guessed type int dword_F8B19C; | |
194 | |
195 //----- (00416B01) -------------------------------------------------------- | |
196 void GameUI_DrawNPCPopup(void *_this)//PopupWindowForBenefitAndJoinText | |
197 { | |
198 int v1; // edi@2 | |
199 int v2; // ecx@2 | |
200 NPCData *v3; // eax@2 | |
201 NPCData *v4; // esi@7 | |
202 NPCData *v5; // eax@16 | |
203 NPCData *v6; // esi@16 | |
204 const CHAR *v7; // eax@18 | |
205 unsigned int v8; // eax@25 | |
206 unsigned int v9; // eax@25 | |
207 const char *v10; // ST14_4@26 | |
208 char *v11; // esi@26 | |
209 const char *v12; // ST18_4@27 | |
210 unsigned __int16 v13; // ax@28 | |
211 char *v14; // eax@28 | |
212 GUIWindow a1; // [sp+Ch] [bp-60h]@23 | |
213 int a2; // [sp+60h] [bp-Ch]@16 | |
214 void *v17; // [sp+64h] [bp-8h]@1 | |
215 LPCSTR lpsz; // [sp+68h] [bp-4h]@6 | |
216 | |
217 v17 = _this; | |
218 if ( bNoNPCHiring != 1 ) | |
219 { | |
220 v1 = 0; | |
221 v2 = 0; | |
222 v3 = pParty->pHirelings; | |
223 /*do | |
224 { | |
225 if ( v3->pName ) | |
226 pTmpBuf[v1++] = v2; | |
227 ++v3; | |
228 ++v2; | |
229 } | |
230 while ( (signed int)v3 < (signed int)&pParty->pPickedItem );*/ | |
231 for (int i = 0; i < 2; ++i) | |
232 { | |
233 if (pParty->pHirelings[i].pName) | |
234 pTmpBuf[v1++] = i; | |
235 } | |
236 lpsz = 0; | |
237 if ( (signed int)pNPCStats->uNumNewNPCs > 0 ) | |
238 { | |
239 /*v4 = pNPCStats->pNewNPCData; | |
240 do | |
241 { | |
242 if ( v4->uFlags & 0x80 | |
243 && (!pParty->pHirelings[0].pName || strcmp(v4->pName, pParty->pHirelings[0].pName)) | |
244 && (!pParty->pHirelings[1].pName || strcmp(v4->pName, pParty->pHirelings[1].pName)) ) | |
245 pTmpBuf[v1++] = (char)lpsz + 2; | |
246 ++lpsz; | |
247 ++v4; | |
248 } | |
249 while ( (signed int)lpsz < (signed int)pNPCStats->uNumNewNPCs );*/ | |
250 for (int i = 0; i < pNPCStats->uNumNewNPCs; ++i) | |
251 { | |
252 if (pNPCStats->pNewNPCData[i].Hired()) | |
253 { | |
254 if (!pParty->pHirelings[0].pName || strcmp((char *)pNPCStats->pNewNPCData[i].pName, (char *)pParty->pHirelings[0].pName)) | |
255 { | |
256 if (!pParty->pHirelings[1].pName || strcmp((char *)pNPCStats->pNewNPCData[i].pName, (char *)pParty->pHirelings[1].pName)) | |
257 pTmpBuf[v1++] = i + 2; | |
258 } | |
259 } | |
260 } | |
261 } | |
262 if ( (signed int)((char *)v17 + (unsigned __int8)pParty->field_709) < v1 ) | |
263 { | |
264 sDialogue_SpeakingActorNPC_ID = -1 - (unsigned __int8)pParty->field_709 - (int)v17; | |
1094 | 265 v5 = GetNewNPCData(sDialogue_SpeakingActorNPC_ID, &a2); |
1038 | 266 v6 = v5; |
267 if ( v5 ) | |
268 { | |
269 if ( a2 == 57 ) | |
270 v7 = pNPCTopics[512].pText; // Baby dragon | |
271 else | |
272 v7 = (const CHAR *)pNPCStats->pProfessions[v5->uProfession].pBenefits; | |
273 lpsz = v7; | |
274 if ( !v7 ) | |
275 { | |
276 lpsz = (LPCSTR)pNPCStats->pProfessions[v5->uProfession].pJoinText; | |
277 if ( !lpsz ) | |
278 lpsz = ""; | |
279 } | |
280 a1.Hint = 0; | |
281 a1.uFrameX = 38; | |
282 a1.uFrameY = 60; | |
283 a1.uFrameWidth = 276; | |
284 a1.uFrameZ = 313; | |
285 a1.uFrameHeight = pFontArrus->CalcTextHeight(lpsz, &a1, 0, 0) | |
286 + 2 * LOBYTE(pFontArrus->uFontHeight) | |
287 + 24; | |
288 if ( (signed int)a1.uFrameHeight < 130 ) | |
289 a1.uFrameHeight = 130; | |
290 a1.uFrameWidth = 400; | |
291 a1.uFrameZ = a1.uFrameX + 399; | |
292 a1.DrawMessageBox(0); | |
293 sprintfex(pTmpBuf2, "NPC%03d", v6->uPortraitID); | |
294 v8 = pIcons_LOD->LoadTexture(pTmpBuf2, TEXTURE_16BIT_PALETTE); | |
295 pRenderer->DrawTextureIndexed( | |
296 a1.uFrameX + 22, | |
297 a1.uFrameY + 36, | |
298 (Texture *)(v8 != -1 ? &pIcons_LOD->pTextures[v8] : 0)); | |
299 v9 = v6->uProfession; | |
300 if ( v9 ) | |
301 { | |
302 v10 = v6->pName; | |
303 v11 = pTmpBuf; | |
304 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[429], v10, aNPCProfessionNames[v9]); | |
305 } | |
306 else | |
307 { | |
308 v12 = v6->pName; | |
309 v11 = pTmpBuf; | |
310 strcpy(pTmpBuf, v12); | |
311 } | |
312 v13 = TargetColor(0xFFu, 0xFFu, 0x9Bu); | |
313 a1.DrawTitleText(pFontArrus, 0, 0xCu, v13, v11, 3u); | |
314 a1.uFrameWidth -= 24; | |
315 a1.uFrameZ = a1.uFrameX + a1.uFrameWidth - 1; | |
316 v14 = BuilDialogueString((char *)lpsz, uActiveCharacter - 1, 0, 0, 0, 0); | |
317 a1.DrawText(pFontArrus, 100, 36, 0, v14, 0, 0, 0); | |
318 } | |
319 } | |
320 } | |
321 } | |
322 | |
323 | |
1033 | 324 |
325 //----- (00445D4A) -------------------------------------------------------- | |
326 void GameUI_InitializeDialogue(Actor *actor, int bPlayerSaysHello) | |
327 { | |
328 NPCData *pNPCInfo; // ebp@1 | |
329 int v9; // esi@8 | |
330 int pNumberContacts; // eax@11 | |
331 char pContainer[32]; // [sp+14h] [bp-28h]@3 | |
332 | |
333 dword_A74CDC = -1; | |
334 dword_AE336C = -1; | |
335 pEventTimer->Pause(); | |
336 pMiscTimer->Pause(); | |
337 pAudioPlayer->StopChannels(-1, -1); | |
338 uDialogueType = 0; | |
339 sDialogue_SpeakingActorNPC_ID = actor->sNPC_ID; | |
340 pDialogue_SpeakingActor = actor; | |
341 pNPCInfo = GetNPCData(actor->sNPC_ID); | |
342 if ( (pNPCInfo->uFlags & 3) != 2 ) | |
343 pNPCInfo->uFlags = pNPCInfo->uFlags + 1; | |
344 | |
345 switch (pParty->alignment) | |
346 { | |
347 case PartyAlignment_Good: sprintfex(pContainer, "evt%02d-b", const_2()); break; | |
348 case PartyAlignment_Neutral: sprintfex(pContainer, "evt%02d", const_2()); break; | |
349 case PartyAlignment_Evil: sprintfex(pContainer, "evt%02d-c", const_2()); break; | |
350 } | |
351 | |
352 pDialogueNPCCount = 0; | |
353 uNumDialogueNPCPortraits = 1; | |
354 pTexture_Dialogue_Background = pIcons_LOD->LoadTexturePtr(pContainer, TEXTURE_16BIT_PALETTE); | |
355 sprintfex(pContainer, "npc%03u", pNPCInfo->uPortraitID); | |
356 v9 = 0; | |
357 pDialogueNPCPortraits[0] = pIcons_LOD->LoadTexturePtr(pContainer, TEXTURE_16BIT_PALETTE); | |
358 dword_591084 = areWeLoadingTexture; | |
359 uTextureID_right_panel_loop = uTextureID_right_panel; | |
360 if ( !pNPCInfo->Hired() && pNPCInfo->Location2D >= 0 ) | |
361 { | |
362 if ( (signed int)pParty->GetPartyFame() <= pNPCInfo->fame | |
363 || (pNumberContacts = pNPCInfo->uFlags & 0xFFFFFF7F, (pNumberContacts & 0x80000000u) != 0) ) | |
364 { | |
365 v9 = 1; | |
366 } | |
367 else | |
368 { | |
369 if ( pNumberContacts > 1 ) | |
370 { | |
371 if ( pNumberContacts == 2 ) | |
372 { | |
373 v9 = 3; | |
374 } | |
375 else | |
376 { | |
377 if ( pNumberContacts != 3 ) | |
378 { | |
379 if ( pNumberContacts != 4 ) | |
380 v9 = 1; | |
381 } | |
382 else | |
383 { | |
384 v9 = 2; | |
385 } | |
386 } | |
387 } | |
388 else if ( pNPCInfo->rep ) | |
389 { | |
390 v9 = 2; | |
391 } | |
392 } | |
393 } | |
394 if (sDialogue_SpeakingActorNPC_ID < 0) | |
395 v9 = 4; | |
396 pDialogueWindow = GUIWindow::Create(0, 0, 640, 480, WINDOW_Dialogue, v9, 0);//pNumberContacts = 1, v9 = 0; pNumberContacts = 2, v9 = 3; | |
397 if (pNPCInfo->Hired()) | |
398 { | |
399 if ( !pNPCInfo->bHasUsedTheAbility ) | |
400 { | |
401 if ( pNPCInfo->uProfession >= 10 ) | |
402 { | |
403 if ( pNPCInfo->uProfession <= 12 || pNPCInfo->uProfession > 32 && (pNPCInfo->uProfession <= 34 | |
404 || pNPCInfo->uProfession > 38 && (pNPCInfo->uProfession <= 43 || pNPCInfo->uProfession == 52)) ) | |
405 { | |
406 pDialogueWindow->CreateButton(480, 250, 140, LOBYTE(pFontArrus->uFontHeight) - 3, 1, 0, UIMSG_SelectNPCDialogueOption, 9, 0, "", 0); | |
407 pDialogueWindow->_41D08F_set_keyboard_control_group(4, 1, 0, 1); | |
408 } | |
409 } | |
410 } | |
411 } | |
412 | |
413 pDialogueWindow->CreateButton( 61, 424, 31, 40, 2, 94, UIMSG_SelectCharacter, 1, '1', "", 0); | |
414 pDialogueWindow->CreateButton(177, 424, 31, 40, 2, 94, UIMSG_SelectCharacter, 2, '2', "", 0); | |
415 pDialogueWindow->CreateButton(292, 424, 31, 40, 2, 94, UIMSG_SelectCharacter, 3, '3', "", 0); | |
416 pDialogueWindow->CreateButton(407, 424, 31, 40, 2, 94, UIMSG_SelectCharacter, 4, '4', "", 0); | |
417 | |
418 if (bPlayerSaysHello && uActiveCharacter && !pNPCInfo->Hired()) | |
419 { | |
420 if (pParty->uCurrentHour < 5 || pParty->uCurrentHour > 21) | |
421 pPlayers[uActiveCharacter]->PlaySound(SPEECH_GoodEvening, 0); | |
422 else | |
423 pPlayers[uActiveCharacter]->PlaySound(SPEECH_GoodDay, 0); | |
424 } | |
425 } | |
426 | |
427 //----- (00445350) -------------------------------------------------------- | |
428 void GameUI_DrawDialogue() | |
429 { | |
430 NPCData *pNPC; // ebx@2 | |
431 int pGreetType; // eax@2 | |
432 unsigned __int16 v2; // di@2 | |
433 //unsigned int v3; // eax@2 | |
434 char *v4; // esi@3 | |
435 //int v5; // eax@11 | |
436 //char *v6; // ecx@13 | |
437 //char *v7; // eax@16 | |
438 //unsigned int v8; // edi@19 | |
439 //char *v9; // ecx@27 | |
440 char *v10; // eax@29 | |
441 //int v11; // eax@30 | |
442 int v12; // esi@39 | |
443 char *v13; // eax@41 | |
444 GUIButton *v14; // eax@43 | |
445 //GUIButton *v15; // edi@43 | |
446 signed int v16; // eax@44 | |
447 //unsigned int v23; // eax@53 | |
448 //const char *v24; // eax@59 | |
449 //unsigned __int16 v30; // cx@83 | |
450 int v31; // ecx@86 | |
451 int v32; // ebx@93 | |
452 unsigned int v33; // eax@93 | |
453 GUIWindow *v34; // ecx@93 | |
454 int v35; // esi@93 | |
455 int i; // eax@93 | |
456 GUIButton *v37; // eax@94 | |
457 int v38; // eax@95 | |
458 signed int v39; // esi@99 | |
459 signed int v40; // eax@102 | |
460 unsigned int v41; // ebx@102 | |
461 int v42; // edi@102 | |
462 GUIButton *v43; // esi@103 | |
463 int v44; // eax@104 | |
464 unsigned int v45; // ecx@104 | |
465 unsigned __int16 *v46; // edx@104 | |
466 unsigned __int16 v47; // ax@104 | |
467 GUIWindow pWindow; // [sp+4h] [bp-110h]@39 | |
468 int v49; // [sp+Ch] [bp-108h]@39 | |
469 int v50; // [sp+14h] [bp-100h]@39 | |
470 GUIWindow v51; // [sp+58h] [bp-BCh]@2 | |
471 GUIWindow v52; // [sp+ACh] [bp-68h]@42 | |
472 char *Str; // [sp+100h] [bp-14h]@104 | |
473 //int v54; // [sp+104h] [bp-10h]@2 | |
474 //unsigned __int16 *v55; // [sp+108h] [bp-Ch]@82 | |
475 GUIFont *pOutString; // [sp+10Ch] [bp-8h]@39 | |
476 char *pInString=NULL; // [sp+110h] [bp-4h]@32 | |
477 | |
478 if ( !pDialogueWindow ) | |
479 return; | |
480 | |
481 memcpy(&v51, pDialogueWindow, sizeof(v51)); | |
482 pNPC = GetNPCData(sDialogue_SpeakingActorNPC_ID); | |
483 pGreetType = GetGreetType(sDialogue_SpeakingActorNPC_ID); | |
484 v51.uFrameWidth -= 10; | |
485 v51.uFrameZ -= 10; | |
486 //v54 = v1; | |
487 TargetColor(0xFFu, 0xFFu, 0xFFu); | |
488 TargetColor(0xE1u, 0xCDu, 0x23u); | |
489 v2 = TargetColor(0x15u, 0x99u, 0xE9u); | |
490 pRenderer->DrawTextureIndexed(477, 0, pTexture_Dialogue_Background); | |
491 pRenderer->DrawTextureTransparent(468, 0, (Texture *)(uTextureID_right_panel_loop != -1 ? &pIcons_LOD->pTextures[uTextureID_right_panel_loop] : 0)); | |
492 pRenderer->DrawTextureIndexed(pNPCPortraits_x[0][0] - 4, pNPCPortraits_y[0][0] - 4, (Texture *)(uTextureID_50795C != -1 ? &pIcons_LOD->pTextures[uTextureID_50795C] : 0)); | |
493 pRenderer->DrawTextureIndexed(pNPCPortraits_x[0][0], pNPCPortraits_y[0][0], pDialogueNPCPortraits[0]); | |
494 | |
495 if (pNPC->uProfession) | |
496 { | |
497 assert(pNPC->uProfession < sizeof(aNPCProfessionNames) / sizeof(*aNPCProfessionNames)); // sometimes buffer overflows; errors emerge both here and in dialogue text | |
498 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[429], pNPC->pName, aNPCProfessionNames[pNPC->uProfession]);//^Pi[%s] %s | |
499 } | |
500 else | |
501 strcpy(pTmpBuf, pNPC->pName); | |
502 | |
503 v51.DrawTitleText(pFontArrus, 483, 112, v2, pTmpBuf, 3); | |
504 pParty->GetPartyFame(); | |
505 | |
506 pInString = nullptr; | |
507 switch (uDialogueType) | |
508 { | |
509 case DIALOGUE_13: | |
510 pInString = BuilDialogueString(pNPCStats->pProfessions[pNPC->uProfession - 1].pJoinText, uActiveCharacter - 1, 0, 0, 0, 0); | |
511 break; | |
512 | |
513 case DIALOGUE_PROFESSION_DETAILS: | |
514 { | |
515 auto prof = pNPCStats->pProfessions + pNPC->uProfession - 1; | |
516 | |
517 if (dialogue_show_profession_details) | |
518 pInString = BuilDialogueString(prof->pBenefits, uActiveCharacter - 1, 0, 0, 0, 0); | |
519 else if (pNPC->Hired()) | |
520 pInString = BuilDialogueString(prof->pDismissText, uActiveCharacter - 1, 0, 0, 0, 0); | |
521 else | |
522 pInString = BuilDialogueString(prof->pJoinText, uActiveCharacter - 1, 0, 0, 0, 0); | |
523 } | |
524 break; | |
525 | |
526 | |
527 case DIALOGUE_ARENA_WELCOME: | |
528 pInString = pGlobalTXT_LocalizationStrings[574]; // "Welcome to the Arena of Life and Death. Remember, you are only allowed one arena combat per visit. To fight an arena battle, select the option that best describes your abilities and return to me- if you survive:" | |
529 break; | |
530 | |
531 case DIALOGUE_ARENA_FIGHT_NOT_OVER_YET: | |
532 pInString = pGlobalTXT_LocalizationStrings[577]; //"Get back in there you wimps:" | |
533 break; | |
534 | |
535 case DIALOGUE_ARENA_REWARD: | |
536 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[576], gold_transaction_amount);// "Congratulations on your win: here's your stuff: %u gold." | |
537 pInString = pTmpBuf; | |
538 break; | |
539 | |
540 case DIALOGUE_ARENA_ALREADY_WON: | |
541 pInString = pGlobalTXT_LocalizationStrings[582]; // "You already won this trip to the Arena:" | |
542 break; | |
543 | |
544 default: | |
545 if (uDialogueType > DIALOGUE_18 && uDialogueType < DIALOGUE_23 && !byte_5B0938[0]) | |
546 { | |
547 pInString = (char *)current_npc_text; | |
548 } | |
549 else if (pGreetType == 1)//QuestNPC_greet | |
550 { | |
551 if (pNPC->greet) | |
552 { | |
553 if ((pNPC->uFlags & 3) == 2) | |
554 pInString = pNPCStats->pNPCGreetings[pNPC->greet - 1].pGreeting2; | |
555 else | |
556 pInString = pNPCStats->pNPCGreetings[pNPC->greet - 1].pGreeting1; | |
557 } | |
558 } | |
559 else if (pGreetType == 2)//HiredNPC_greet | |
560 { | |
561 auto prof = pNPCStats->pProfessions + pNPC->uProfession - 1; | |
562 | |
563 if (pNPC->Hired()) | |
564 pInString = BuilDialogueString(prof->pDismissText, uActiveCharacter - 1, 0, 0, 0, 0); | |
565 else | |
566 pInString = BuilDialogueString(prof->pJoinText, uActiveCharacter - 1, 0, 0, 0, 0); | |
567 } | |
568 break; | |
569 } | |
570 | |
571 if (pInString) | |
572 { | |
573 pWindow.uFrameWidth = game_viewport_width; | |
574 pWindow.uFrameZ = 452; | |
575 auto font = pFontArrus; | |
576 v12 = pFontArrus->CalcTextHeight(pInString, &pWindow, 13, 0) + 7; | |
577 if ( 352 - v12 < 8 ) | |
578 { | |
579 font = pFontCreate; | |
580 v12 = pFontCreate->CalcTextHeight(pInString, &pWindow, 13, 0) + 7; | |
581 } | |
582 if (uTextureID_Leather != -1) | |
583 pRenderer->_4A6A68(8, 352 - v12, &pIcons_LOD->pTextures[uTextureID_Leather], pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight - v12); | |
584 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428); | |
585 v13 = FitTextInAWindow(pInString, font, &pWindow, 0xDu, 0); | |
586 pDialogueWindow->DrawText(font, 13, 354 - v12, 0, v13, 0, 0, 0); | |
587 } | |
588 | |
589 | |
590 memcpy(&v52, pDialogueWindow, sizeof(v52)); | |
591 v52.uFrameX = 483; | |
592 v52.uFrameWidth = 148; | |
593 v52.uFrameZ = 334; | |
594 for (int i = v52.pStartingPosActiveItem; | |
595 i < v52.pStartingPosActiveItem + v52.pNumPresenceButton; ++i) | |
596 { | |
597 v14 = v52.GetControl(i); | |
598 //v15 = v14; | |
599 if ( !v14 ) | |
600 break; | |
601 v16 = v14->msg_param; | |
602 | |
603 if ( v16 > 88 ) | |
604 v14->pButtonName[0] = 0; | |
605 else if (v16 == 88) | |
606 strcpy(v14->pButtonName, pGlobalTXT_LocalizationStrings[581]); // Lord | |
607 else if (v16 == 87) | |
608 strcpy(v14->pButtonName, pGlobalTXT_LocalizationStrings[580]); // Knight | |
609 else if (v16 == 86) | |
610 strcpy(v14->pButtonName, pGlobalTXT_LocalizationStrings[579]); // Squire | |
611 else if (v16 == 85) | |
612 strcpy(v14->pButtonName, pGlobalTXT_LocalizationStrings[578]); // Page | |
613 else if (v16 == 77) | |
614 strcpy(v14->pButtonName, pGlobalTXT_LocalizationStrings[407]); // Details | |
615 else if (v16 == 76) | |
616 { | |
617 if (pNPC->Hired()) | |
618 sprintf(v14->pButtonName, (const char*)pGlobalTXT_LocalizationStrings[408], pNPC->pName); // Release %s | |
619 else | |
620 strcpy(v14->pButtonName, pGlobalTXT_LocalizationStrings[406]); // Hire | |
621 } | |
622 else if (v16 == 24) | |
623 { | |
624 __debugbreak(); // learn conditions of this event | |
625 auto topic = pNPCTopics[pNPC->evt_F - 1].pTopic;//(&dword_721660)[8 * v23]; | |
626 if (!topic) | |
627 { | |
628 v14->pButtonName[0] = 0; | |
629 v14->msg_param = 0; | |
630 } | |
631 else | |
632 strcpy(v14->pButtonName, topic); | |
633 } | |
634 else if (v16 == 9) | |
635 strcpy(v14->pButtonName, GetProfessionActionText(pNPC->uProfession)); | |
636 else if (v16 == 19) | |
637 { | |
638 // __debugbreak(); // learn conditions of this event Scavenger Hunt | |
639 auto topic = pNPCTopics[pNPC->evt_A - 1].pTopic;//(&dword_721660)[8 * v23]; | |
640 if (!topic) | |
641 { | |
642 v14->pButtonName[0] = 0; | |
643 v14->msg_param = 0; | |
644 } | |
645 else strcpy(v14->pButtonName, topic); | |
646 } | |
647 else if (v16 == 20) | |
648 { | |
649 //__debugbreak(); // learn conditions of this event instruments | |
650 auto topic = pNPCTopics[pNPC->evt_B - 1].pTopic;//(&dword_721660)[8 * v23]; | |
651 if (!topic) | |
652 { | |
653 v14->pButtonName[0] = 0; | |
654 v14->msg_param = 0; | |
655 } | |
656 else strcpy(v14->pButtonName, topic); | |
657 } | |
658 else if (v16 == 21) | |
659 { | |
660 //__debugbreak(); // learn conditions of this event | |
661 auto topic = pNPCTopics[pNPC->evt_C - 1].pTopic;//(&dword_721660)[8 * v23]; | |
662 if (!topic) | |
663 { | |
664 v14->pButtonName[0] = 0; | |
665 v14->msg_param = 0; | |
666 } | |
667 else strcpy(v14->pButtonName, topic); | |
668 } | |
669 else if (v16 == 22) | |
670 { | |
671 //__debugbreak(); // learn conditions of this event | |
672 auto topic = pNPCTopics[pNPC->evt_D - 1].pTopic;//(&dword_721660)[8 * v23]; | |
673 if (!topic) | |
674 { | |
675 v14->pButtonName[0] = 0; | |
676 v14->msg_param = 0; | |
677 } | |
678 else strcpy(v14->pButtonName, topic); | |
679 } | |
680 else if (v16 == 23) | |
681 { | |
682 //__debugbreak(); // learn conditions of this event | |
683 auto topic = pNPCTopics[pNPC->evt_E - 1].pTopic;//(&dword_721660)[8 * v23]; | |
684 if (!topic) | |
685 { | |
686 v14->pButtonName[0] = 0; | |
687 v14->msg_param = 0; | |
688 } | |
689 else strcpy(v14->pButtonName, topic); | |
690 } | |
691 else if (v16 == 13) | |
692 { | |
693 if (pNPC->Hired()) | |
694 sprintf(v14->pButtonName, pGlobalTXT_LocalizationStrings[408], pNPC->pName); // Release %s | |
695 else | |
696 strcpy(v14->pButtonName, pGlobalTXT_LocalizationStrings[122]); // Join | |
697 } | |
698 else | |
699 v14->pButtonName[0] = 0; | |
700 | |
701 | |
702 if (pParty->field_7B5_in_arena_quest && pParty->field_7B5_in_arena_quest != -1) | |
703 { | |
704 int num_dead_actors = 0; | |
705 pInString = 0; | |
706 for (uint i = 0; i < uNumActors; ++i) | |
707 { | |
708 if (pActors[i].uAIState == Dead || pActors[i].uAIState == Removed || | |
709 pActors[i].uAIState == Disabled) | |
710 ++num_dead_actors; | |
711 else | |
712 { | |
713 int sumonner_type = PID_TYPE(pActors[i].uSummonerID); | |
714 if (sumonner_type == OBJECT_Player) | |
715 ++num_dead_actors; | |
716 } | |
717 } | |
718 if (num_dead_actors == uNumActors) | |
719 strcpy(v14->pButtonName, pGlobalTXT_LocalizationStrings[658]); // Collect Prize | |
720 } | |
721 } | |
722 | |
723 | |
724 v32 = 0; | |
725 //pInString = (char *)TargetColor(0xFFu, 0xFFu, 0xFFu); | |
726 v33 = TargetColor(0xE1u, 0xCDu, 0x23u); | |
727 v34 = pDialogueWindow; | |
728 //v54 = v33; | |
729 v35 = pDialogueWindow->pStartingPosActiveItem; | |
730 for ( i = v35 + pDialogueWindow->pNumPresenceButton; v35 < i; i = pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem ) | |
731 { | |
732 v37 = v34->GetControl(v35); | |
733 if ( !v37 ) | |
734 { | |
735 v34 = pDialogueWindow; | |
736 break; | |
737 } | |
738 v38 = pFontArrus->CalcTextHeight(v37->pButtonName, &v52, 0, 0); | |
739 v34 = pDialogueWindow; | |
740 v32 += v38; | |
741 ++v35; | |
742 } | |
743 v39 = v34->pNumPresenceButton; | |
744 if ( v39 ) | |
745 { | |
746 pOutString = (GUIFont *)((174 - v32) / v39); | |
747 if ( (174 - v32) / v39 > 32 ) | |
748 pOutString = (GUIFont *)32; | |
749 int v55 = 1; | |
750 v40 = 174 - (int)pOutString * v39 - v32; | |
751 v41 = v34->pStartingPosActiveItem; | |
752 v42 = v40 / 2 - (signed int)pOutString / 2 + 138; | |
753 if ( (signed int)v41 < (signed int)(v41 + v39) ) | |
754 { | |
755 do | |
756 { | |
757 v43 = v34->GetControl(v41); | |
758 if ( !v43 ) | |
759 break; | |
760 v43->uY = (unsigned int)((char *)pOutString + v42); | |
761 Str = v43->pButtonName; | |
762 v44 = pFontArrus->CalcTextHeight(v43->pButtonName, &v52, 0, 0); | |
763 v45 = v43->uY; | |
764 v46 = (unsigned short *)v55; | |
765 v43->uHeight = v44; | |
766 v42 = v45 + v44 - 1; | |
767 v43->uW = v42; | |
768 v47 = v33; | |
769 if ( (unsigned __int16 *)pDialogueWindow->pCurrentPosActiveItem != v46 ) | |
770 v47 = TargetColor(0xFFu, 0xFFu, 0xFFu); | |
771 v52.DrawTitleText(pFontArrus, 0, v45, v47, Str, 3u); | |
772 v34 = pDialogueWindow; | |
773 ++v55; | |
774 ++v41; | |
775 } | |
776 while ( (signed int)v41 < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem ); | |
777 } | |
778 } | |
779 pRenderer->DrawTextureIndexed(471, 445, pIcons_LOD->GetTexture(uExitCancelTextureId)); | |
780 } | |
781 | |
782 | |
783 | |
784 //----- (00444FBE) -------------------------------------------------------- | |
785 void GameUI_DrawBranchlessDialogue() | |
786 { | |
787 //GUIFont *v0; // esi@1 | |
788 int v1; // esi@4 | |
789 char *v2; // eax@6 | |
790 int v3; // edi@12 | |
791 char Str[200]; // [sp+Ch] [bp-120h]@12 | |
792 GUIWindow v5; // [sp+D4h] [bp-58h]@4 | |
793 GUIFont *pFont; // [sp+128h] [bp-4h]@1 | |
794 | |
795 pFont = pFontArrus; | |
796 if ( current_npc_text && !byte_5B0938[0] ) | |
797 strcpy(byte_5B0938, current_npc_text); | |
798 v5.uFrameWidth = game_viewport_width; | |
799 v5.uFrameZ = 452; | |
800 v1 = pFontArrus->CalcTextHeight(byte_5B0938, &v5, 12, 0) + 7; | |
801 if ( 352 - v1 < 8 ) | |
802 { | |
803 pFont = pFontCreate; | |
804 v1 = pFontCreate->CalcTextHeight(byte_5B0938, &v5, 12, 0) + 7; | |
805 } | |
806 pRenderer->_4A6A68(8, 352 - v1, | |
807 pIcons_LOD->GetTexture(uTextureID_Leather), | |
808 pIcons_LOD->GetTexture(uTextureID_Leather)->uTextureHeight - v1); | |
809 pRenderer->DrawTextureIndexed(8, 347 - v1, pTexture_591428); | |
810 v2 = FitTextInAWindow(byte_5B0938, pFont, &v5, 0xCu, 0); | |
811 pGUIWindow2->DrawText(pFont, 12, 354 - v1, 0, v2, 0, 0, 0); | |
812 pRenderer->DrawTextureRGB(0, 0x160u, pTexture_StatusBar); | |
1038 | 813 if ( pGUIWindow2->receives_keyboard_input_2 != WINDOW_INPUT_IN_PROGRESS) |
1033 | 814 { |
1038 | 815 if ( pGUIWindow2->receives_keyboard_input_2 == WINDOW_INPUT_CONFIRMED) |
1033 | 816 { |
1038 | 817 pGUIWindow2->receives_keyboard_input_2 = WINDOW_INPUT_NONE; |
1033 | 818 strcpy(GameUI_Footer_TimedString, (const char *)pKeyActionMap->pPressedKeysBuffer); |
819 LABEL_16: | |
820 sub_4452BB(); | |
821 return; | |
822 } | |
1038 | 823 if ( pGUIWindow2->receives_keyboard_input_2 != WINDOW_INPUT_CANCELLED) |
1033 | 824 return; |
1038 | 825 pGUIWindow2->receives_keyboard_input_2 = WINDOW_INPUT_NONE; |
1033 | 826 LABEL_15: |
827 memset(GameUI_Footer_TimedString, 0, 0xC8u); | |
828 goto LABEL_16; | |
829 } | |
830 if ( pGUIWindow2->ptr_1C == (void *)26 ) | |
831 { | |
832 sprintf(Str, "%s %s", GameUI_Footer_TimedString, pKeyActionMap->pPressedKeysBuffer); | |
833 v3 = pFontLucida->GetLineWidth(Str); | |
834 pGUIWindow2->DrawText(pFontLucida, 13, 357, 0, Str, 0, 0, 0); | |
835 pGUIWindow2->DrawFlashingInputCursor(v3 + 13, 357, pFontLucida); | |
836 return; | |
837 } | |
838 if ( pKeyActionMap->pPressedKeysBuffer[0] ) | |
839 { | |
1038 | 840 pKeyActionMap->SetWindowInputStatus(0); |
1033 | 841 goto LABEL_15; |
842 } | |
843 } | |
844 | |
845 | |
846 //----- (004443D5) -------------------------------------------------------- | |
847 const char *GameUI_GetMinimapHintText() | |
848 { | |
849 int v0; // ST20_4@1 | |
850 unsigned int v1; // esi@1 | |
851 signed int v2; // ebx@1 | |
852 double v3; // st7@1 | |
853 int v4; // esi@3 | |
854 int v5; // edi@4 | |
855 int v6; // eax@4 | |
856 int v7; // eax@4 | |
857 BSPModel *v8; // ecx@4 | |
858 unsigned __int8 v9; // zf@5 | |
859 char v10; // sf@5 | |
860 unsigned __int8 v11; // of@5 | |
861 ODMFace *v12; // eax@6 | |
862 __int16 v13; // cx@6 | |
863 const char *v14; // eax@8 | |
864 const char *v15; // edi@8 | |
865 char *result; // eax@12 | |
866 unsigned int v17; // eax@14 | |
867 unsigned int v18; // [sp+Ch] [bp-20h]@1 | |
868 int v19; // [sp+10h] [bp-1Ch]@1 | |
869 int v20; // [sp+14h] [bp-18h]@1 | |
870 char *v21; // [sp+18h] [bp-14h]@1 | |
871 unsigned int pY; // [sp+1Ch] [bp-10h]@1 | |
872 int v23; // [sp+20h] [bp-Ch]@1 | |
873 int v24; // [sp+24h] [bp-8h]@1 | |
874 int pX; // [sp+28h] [bp-4h]@1 | |
875 | |
876 v24 = pParty->vPosition.x; | |
877 v0 = pParty->vPosition.y; | |
878 v1 = pOutdoor->uNumBModels; | |
879 *(float *)&v23 = (double)(signed int)viewparams->uMinimapZoom * 0.000015258789; | |
880 v2 = 0; | |
881 v18 = pOutdoor->uNumBModels; | |
882 v21 = 0; | |
883 pMouse->GetClickPos((unsigned int *)&pX, &pY); | |
884 v3 = 1.0 / *(float *)&v23; | |
885 v23 = pX - 557; | |
886 v19 = (signed __int64)((double)(pX - 557) * v3 + (double)v24); | |
887 v20 = (signed __int64)((double)v0 - (double)(signed int)(pY - 74) * v3); | |
888 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor || (*(float *)&v23 = 0.0, (signed int)v1 <= 0) ) | |
889 { | |
890 LABEL_14: | |
891 v17 = pMapStats->GetMapInfo(pCurrentMapName); | |
892 if ( v17 == v2 ) | |
893 result = "No Maze Info for this maze on file!"; | |
894 else | |
895 result = pMapStats->pInfos[v17].pName; | |
896 } | |
897 else | |
898 { | |
899 v4 = 0; | |
900 while ( 1 ) | |
901 { | |
902 pX = pOutdoor->pBModels[v4].vBoundingCenter.x - v19; | |
903 pY = pOutdoor->pBModels[v4].vBoundingCenter.y - v20; | |
904 v5 = abs((signed)pY); | |
905 v6 = abs((signed)pX); | |
906 v7 = int_get_vector_length(v6, v5, v2); | |
907 v8 = &pOutdoor->pBModels[0]; | |
908 if ( v7 < 2 * pOutdoor->pBModels[v4].sBoundingRadius ) | |
909 { | |
910 v11 = __OFSUB__(pOutdoor->pBModels[v4].uNumFaces, v2); | |
911 v9 = pOutdoor->pBModels[v4].uNumFaces == v2; | |
912 v10 = ((pOutdoor->pBModels[v4].uNumFaces - v2) & 0x80000000u) != 0; | |
913 v24 = v2; | |
914 if ( !((unsigned __int8)(v10 ^ v11) | v9) ) | |
915 { | |
916 do | |
917 { | |
918 v12 = &v8[v4].pFaces[v2 / 0x134u]; | |
919 v13 = v12->sCogTriggeredID; | |
920 if ( v13 ) | |
921 { | |
922 if ( !(BYTE2(v12->uAttributes) & 0x10) ) | |
923 { | |
924 v14 = GetEventHintString(v13); | |
925 v15 = v14; | |
926 if ( v14 ) | |
927 { | |
1104 | 928 if ( _stricmp(v14, "") ) |
1033 | 929 v21 = (char *)v15; |
930 } | |
931 } | |
932 } | |
933 ++v24; | |
934 v8 = pOutdoor->pBModels; | |
935 v2 += 308; | |
936 } | |
937 while ( v24 < (signed int)pOutdoor->pBModels[v4].uNumFaces ); | |
938 } | |
939 result = v21; | |
940 v2 = 0; | |
941 if ( v21 ) | |
942 break; | |
943 } | |
944 ++v23; | |
945 ++v4; | |
946 if ( v23 >= (signed int)v18 ) | |
947 goto LABEL_14; | |
948 } | |
949 } | |
950 return result; | |
951 } | |
952 | |
953 | |
954 | |
955 | |
956 | |
1004 | 957 //----- (0041D3B7) -------------------------------------------------------- |
958 void GameUI_CharacterQuickRecord_Draw(GUIWindow *window, Player *player) | |
959 { | |
960 //Player *pPlayer; // esi@1 | |
961 int v6; // eax@5 | |
962 int v7; // ebx@5 | |
963 //unsigned int v8; // ecx@5 | |
964 int v9; // ebx@5 | |
965 //unsigned int v10; // eax@5 | |
966 //int v11; // eax@5 | |
967 //unsigned int v12; // ecx@5 | |
968 Texture *v13; // eax@6 | |
969 unsigned int v14; // eax@12 | |
970 PlayerFrame *v15; // eax@12 | |
971 //unsigned int v16; // eax@15 | |
972 unsigned int v20; // eax@15 | |
973 unsigned int v24; // eax@15 | |
974 unsigned int v25; // eax@15 | |
975 unsigned __int8 v28; // al@15 | |
976 char *v29; // eax@16 | |
977 __int64 v35; // ST38_8@22 | |
978 int v36; // esi@22 | |
979 unsigned int v38; // eax@22 | |
980 char *v39; // eax@24 | |
981 signed int uFramesetID; // [sp+20h] [bp-8h]@9 | |
982 int uFramesetIDa; // [sp+20h] [bp-8h]@18 | |
983 | |
984 uint numActivePlayerBuffs = 0; | |
985 for (uint i = 0; i < 24; ++i) | |
986 if (player->pPlayerBuffs[i].uExpireTime > 0) | |
987 ++numActivePlayerBuffs; | |
988 | |
989 v6 = pFontArrus->uFontHeight + 162; | |
990 v7 = (numActivePlayerBuffs - 1) * pFontArrus->uFontHeight; | |
991 v9 = v6 + v7; | |
992 window->uFrameHeight = v9; | |
993 window->uFrameZ = window->uFrameWidth + window->uFrameX - 1; | |
994 window->uFrameW = v9 + window->uFrameY - 1; | |
995 window->DrawMessageBox(0); | |
996 | |
997 if (player->Eradicated()) | |
998 v13 = pTexture_PlayerFaceEradicated; | |
999 else if (player->Dead()) | |
1000 v13 = pTexture_PlayerFaceDead; | |
1001 else | |
1002 { | |
1003 uFramesetID = pPlayerFrameTable->GetFrameIdByExpression(player->expression); | |
1004 if ( !uFramesetID ) | |
1005 uFramesetID = 1; | |
1006 if ( player->expression == CHARACTER_EXPRESSION_21) | |
1007 { | |
1008 v15 = pPlayerFrameTable->GetFrameBy_y(&player->_expression21_frameset, &player->_expression21_animtime, pMiscTimer->uTimeElapsed); | |
1009 } | |
1010 else | |
1011 { | |
1012 v14 = pMiscTimer->Time(); | |
1013 v15 = pPlayerFrameTable->GetFrameBy_x(uFramesetID, v14); | |
1014 } | |
1015 player->field_1AA2 = v15->uTextureID - 1; | |
1016 v13 = pTextures_PlayerFaces[(unsigned int)window->ptr_1C][v15->uTextureID - 1]; | |
1017 } | |
1018 | |
1019 pRenderer->DrawTextureTransparent(window->uFrameX + 24, window->uFrameY + 24, v13); | |
1020 | |
1021 sprintfex(pTmpBuf, "\f%05d", ui_character_header_text_color); | |
1022 sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[429], player->pName, pClassNames[player->classType]); // "%s the %s" | |
1023 strcat(pTmpBuf, pTmpBuf2); | |
1024 strcat(pTmpBuf, "\f00000\n"); | |
1025 | |
1026 v20 = UI_GetHealthManaStringColor(player->sHealth, player->GetMaxHealth()); | |
1027 sprintf(pTmpBuf2, "%s : \f%05u%d\f00000 / %d\n", | |
1028 pGlobalTXT_LocalizationStrings[108], // "Hit Points" | |
1029 v20, player->sHealth, player->GetMaxHealth()); | |
1030 strcat(pTmpBuf, pTmpBuf2); | |
1031 | |
1032 v24 = UI_GetHealthManaStringColor(player->sMana, player->GetMaxMana()); | |
1033 sprintf(pTmpBuf2, "%s : \f%05u%d\f00000 / %d\n", | |
1034 pGlobalTXT_LocalizationStrings[212], // "Spell Points" | |
1035 v24, player->sMana, player->GetMaxMana()); | |
1036 strcat(pTmpBuf, pTmpBuf2); | |
1037 | |
1038 v25 = player->GetMajorConditionIdx(); | |
1039 sprintf(pTmpBuf2, "%s: \f%05d%s\f00000\n", | |
1040 pGlobalTXT_LocalizationStrings[47], // "Condition | |
1041 GetConditionDrawColor(v25), aCharacterConditionNames[v25]); | |
1042 strcat(pTmpBuf, pTmpBuf2); | |
1043 | |
1044 v28 = player->uQuickSpell; | |
1045 if ( v28 ) | |
1046 v29 = pSpellStats->pInfos[v28].pShortName; | |
1047 else | |
1048 v29 = pGlobalTXT_LocalizationStrings[153]; | |
1049 sprintfex(pTmpBuf2, "%s: %s", pGlobalTXT_LocalizationStrings[172], v29); // "Quick Spell" | |
1050 strcat(pTmpBuf, pTmpBuf2); | |
1051 | |
1052 window->DrawText(pFontArrus, 120, 22, 0, pTmpBuf, 0, 0, 0); | |
1053 | |
1054 uFramesetIDa = 0; | |
1055 for (uint i = 0; i < 24; ++i) | |
1056 { | |
1057 auto buff = player->pPlayerBuffs + i; | |
1058 if (buff->uExpireTime > 0) | |
1059 { | |
1060 v35 = buff->uExpireTime - pParty->uTimePlayed; | |
1061 v36 = uFramesetIDa++ * pFontComic->uFontHeight + 134; | |
1062 v38 = ui_game_character_record_playerbuff_colors[i]; | |
1063 window->DrawText(pFontComic, 52, v36, v38, aSpellNames[20 + i], 0, 0, 0); | |
1064 sub_41D20D_buff_remaining_time_string(v36, window, v35, pFontComic); | |
1065 } | |
1066 } | |
1067 | |
1068 v39 = ""; | |
1069 if ( uFramesetIDa == 0 ) | |
1070 v39 = pGlobalTXT_LocalizationStrings[153]; // "None" | |
1071 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[450], v39); // "Active Spells: %s" | |
1072 window->DrawText(pFontArrus, 14, 114, 0, pTmpBuf, 0, 0, 0); | |
1073 } | |
1074 | |
1075 | |
1076 | |
991 | 1077 //----- (0041A57E) -------------------------------------------------------- |
1078 void GameUI_QuickRef_Draw() | |
1079 { | |
994 | 1080 //unsigned int v0; // ebx@1 |
991 | 1081 //unsigned int v1; // eax@1 |
994 | 1082 //Player *pPlayer; // ebp@2 |
1083 //int v3; // eax@6 | |
1084 //int v4; // edi@6 | |
991 | 1085 unsigned int v5; // eax@7 |
1086 unsigned int v6; // edi@9 | |
1087 unsigned int v7; // edi@11 | |
994 | 1088 //signed int v8; // eax@13 |
991 | 1089 unsigned int v9; // eax@13 |
1090 unsigned int v10; // edi@13 | |
994 | 1091 //int v11; // eax@15 |
991 | 1092 unsigned int v12; // eax@15 |
1093 unsigned int v13; // edi@15 | |
994 | 1094 //int v14; // eax@17 |
1095 //int v15; // ST18_4@17 | |
1096 //int v16; // ebx@17 | |
1097 //int v17; // eax@17 | |
991 | 1098 unsigned int v18; // eax@17 |
1099 unsigned int v19; // edi@17 | |
994 | 1100 //int v20; // eax@19 |
991 | 1101 unsigned int v21; // edi@19 |
1102 char *v22; // eax@21 | |
1103 unsigned int v23; // edi@21 | |
994 | 1104 //int v24; // eax@23 |
991 | 1105 unsigned int v25; // edi@23 |
1106 char *v26; // eax@25 | |
1107 unsigned int v27; // edi@25 | |
1108 int v28; // ecx@27 | |
1109 char *v29; // eax@27 | |
1110 signed int v30; // edx@27 | |
1111 unsigned int v31; // edi@31 | |
1112 unsigned int v32; // edi@33 | |
1113 const char *v33; // ST10_4@35 | |
1114 unsigned int v34; // eax@35 | |
1115 unsigned int v35; // edi@35 | |
994 | 1116 //unsigned __int8 v36; // al@37 |
991 | 1117 char *v37; // eax@38 |
1118 int v38; // eax@41 | |
1119 signed int v39; // edi@42 | |
994 | 1120 //char *v40; // eax@45 |
1121 //unsigned int v41; // eax@45 | |
991 | 1122 signed int v43; // [sp+10h] [bp-1Ch]@1 |
1123 unsigned int v44; // [sp+14h] [bp-18h]@2 | |
1124 int v45; // [sp+18h] [bp-14h]@1 | |
994 | 1125 //unsigned int v46; // [sp+1Ch] [bp-10h]@1 |
1126 //unsigned int v47; // [sp+20h] [bp-Ch]@1 | |
991 | 1127 unsigned int v48; // [sp+24h] [bp-8h]@33 |
1128 //unsigned int v49; // [sp+28h] [bp-4h]@1 | |
1129 | |
994 | 1130 //v0 = 0; |
1131 //v47 = TargetColor(0xFFu, 0xFFu, 0x9Bu); | |
991 | 1132 //v49 = TargetColor(0xFFu, 0, 0); |
994 | 1133 //v46 = TargetColor(0, 0xFFu, 0); |
991 | 1134 //v1 = pIcons_LOD->LoadTexture("quikref", TEXTURE_16BIT_PALETTE); |
994 | 1135 pRenderer->DrawTextureIndexed(8, 8, pIcons_LOD->LoadTexturePtr("quikref", TEXTURE_16BIT_PALETTE)); |
991 | 1136 v43 = 0; |
1137 v45 = LOBYTE(pFontArrus->uFontHeight) + 1; | |
1138 do | |
994 | 1139 { |
1140 auto player = &pParty->pPlayers[v43]; | |
991 | 1141 v44 = 94 * v43 + 89; |
994 | 1142 if ( v43 == 0 ) |
1143 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, 0x12u, 0, pGlobalTXT_LocalizationStrings[149], 60, 0);//Name | |
995 | 1144 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 94 * v43 + 89, 0x12u, ui_character_header_text_color, player->pName, 84, 0); |
994 | 1145 if ( v43 == 0 ) |
1146 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, 0x2Fu, 0, pGlobalTXT_LocalizationStrings[131], 60, 0); //Óðîâ. | |
1147 sprintf(pTmpBuf, "%lu", player->GetActualLevel()); | |
1148 if ( player->GetActualLevel() <= player->GetBaseLevel()) | |
1149 v5 = player->GetExperienceDisplayColor(); | |
991 | 1150 else |
995 | 1151 v5 = ui_character_bonus_text_color; |
994 | 1152 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, 0x2Fu, v5, pTmpBuf, 84, 0); |
991 | 1153 v6 = v45 + 47; |
994 | 1154 if ( v43 == 0 ) |
1155 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v45 + 47, 0, pGlobalTXT_LocalizationStrings[41], 60, 0);//Êëàññ | |
1156 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v6, 0, pClassNames[player->classType], 84, 0); | |
991 | 1157 v7 = v45 + v6; |
994 | 1158 if ( v43 == 0 ) |
1159 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v7, 0, pGlobalTXT_LocalizationStrings[107], 60, 0);//Çäîð. | |
1160 sprintf(pTmpBuf, "%d", player->sHealth); | |
1161 v9 = UI_GetHealthManaStringColor(player->sHealth, player->GetMaxHealth()); | |
1162 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v7, v9, pTmpBuf, 84, 0); | |
991 | 1163 v10 = v45 + v7; |
994 | 1164 if ( v43 == 0 ) |
1165 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v10, 0, pGlobalTXT_LocalizationStrings[209], 60, 0);//Ìàíà | |
1166 sprintf(pTmpBuf, "%d", player->sMana); | |
1167 v12 = UI_GetHealthManaStringColor(player->sMana, player->GetMaxMana()); | |
1168 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v10, v12, pTmpBuf, 84, 0); | |
991 | 1169 v13 = v45 + v10; |
994 | 1170 if ( v43 == 0 ) |
1171 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v13, 0, pGlobalTXT_LocalizationStrings[0], 60, 0);//Êëàññ áðîíè | |
1172 sprintf(pTmpBuf, "%d", player->GetActualAC()); | |
1173 v18 = UI_GetHealthManaStringColor(player->GetActualAC(), player->GetBaseAC()); | |
1174 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v13, v18, pTmpBuf, 84, 0); | |
991 | 1175 v19 = v45 + v13; |
1176 if ( !v43 ) | |
1177 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v19, 0, pGlobalTXT_LocalizationStrings[18], 60, 0);//Àòàêà | |
994 | 1178 sprintf(pTmpBuf, "%+d", player->GetActualAttack(0)); |
991 | 1179 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v19, 0, pTmpBuf, 84, 0); |
1180 v21 = v45 + v19; | |
1181 if ( !v43 ) | |
1182 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v21, 0, pGlobalTXT_LocalizationStrings[66], 60, 0);//Ïîâð. | |
994 | 1183 v22 = player->GetMeleeDamageString(); |
991 | 1184 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v21, 0, v22, 84, 0); |
1185 v23 = v45 + v21; | |
1186 if ( !v43 ) | |
1187 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v23, 0, pGlobalTXT_LocalizationStrings[203], 60, 0);// Ñòðåëÿòü | |
994 | 1188 sprintf(pTmpBuf, "%+d", player->GetRangedAttack()); |
991 | 1189 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v23, 0, pTmpBuf, 84, 0); |
1190 v25 = v45 + v23; | |
1191 if ( !v43 ) | |
1192 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v25, 0, pGlobalTXT_LocalizationStrings[66], 60, 0);//Ïîâð. | |
994 | 1193 v26 = player->GetRangedDamageString(); |
991 | 1194 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v25, 0, v26, 84, 0); |
1195 v27 = v45 + v25; | |
1196 if ( !v43 ) | |
1197 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v27, 0, pGlobalTXT_LocalizationStrings[205], 60, 0);//Íàâûêè | |
1198 v28 = 0; | |
994 | 1199 v29 = (char *)player->pActiveSkills; |
991 | 1200 v30 = 36; |
1201 do | |
1202 { | |
1203 if ( *(short *)v29 ) | |
1204 ++v28; | |
1205 v29 += 2; | |
1206 --v30; | |
1207 } | |
1208 while ( v30 ); | |
1209 sprintf(pTmpBuf, "%lu", v28); | |
1210 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v27, 0, pTmpBuf, 84, 0); | |
1211 v31 = v45 + v27; | |
1212 if ( !v43 ) | |
1213 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v31, 0, pGlobalTXT_LocalizationStrings[168], 60, 0);//Î÷êè | |
994 | 1214 sprintf(pTmpBuf, "%lu", player->uSkillPoints); |
995 | 1215 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v31, player->uSkillPoints ? ui_character_bonus_text_color : ui_character_default_text_color, pTmpBuf, 84, 0); |
991 | 1216 v32 = v45 + v31; |
994 | 1217 v48 = player->GetMajorConditionIdx(); |
991 | 1218 if ( !v43 ) |
1219 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v32, 0, pGlobalTXT_LocalizationStrings[45], 60, 0);//Ñîñò. | |
1220 v33 = aCharacterConditionNames[v48]; | |
1221 v34 = GetConditionDrawColor(v48); | |
1222 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v32, v34, v33, 84, 0); | |
1223 v35 = v45 + v32; | |
1224 if ( !v43 ) | |
1225 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v35, 0, pGlobalTXT_LocalizationStrings[170], 60, 0);//Á.Ïðèì. | |
994 | 1226 if (player->uQuickSpell) |
1227 v37 = pSpellStats->pInfos[player->uQuickSpell].pShortName; | |
991 | 1228 else |
1229 v37 = pGlobalTXT_LocalizationStrings[153];//Íåò | |
1230 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v35, 0, v37, 84, 0); | |
1231 ++v43; | |
1232 } | |
1233 while ( v43 < 4 ); | |
1234 | |
1235 v38 = GetPartyReputation(); | |
1236 if ( v38 >= 0 ) | |
1237 { | |
1238 if ( v38 <= 5 ) | |
995 | 1239 v39 = ui_character_default_text_color; |
991 | 1240 else |
995 | 1241 v39 = ui_character_bonus_text_color_neg; |
991 | 1242 } |
1243 else | |
995 | 1244 v39 = ui_character_bonus_text_color; |
991 | 1245 |
994 | 1246 sprintf(pTmpBuf, "%s: \f%05d%s\f00000", pGlobalTXT_LocalizationStrings[180], v39, GetReputationString(v38));//Reputation |
991 | 1247 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 22, 323, 0, pTmpBuf, 0, 0, 0); |
994 | 1248 |
1249 sprintf(pTmpBuf, "\r261%s: %d", pGlobalTXT_LocalizationStrings[84], pParty->GetPartyFame());// Fame Ñëàâà | |
991 | 1250 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 0, 323, 0, pTmpBuf, 0, 0, 0); |
994 | 1251 } |
1252 | |
1253 | |
991 | 1254 |
706 | 1255 //----- (0041AD6E) -------------------------------------------------------- |
994 | 1256 void GameUI_DrawRightPanelItems() |
706 | 1257 { |
1258 if (GameUI_RightPanel_BookFlashTimer > pParty->uTimePlayed) | |
1259 GameUI_RightPanel_BookFlashTimer = 0; | |
1260 | |
1261 if (pParty->uTimePlayed - GameUI_RightPanel_BookFlashTimer > 128) | |
1262 { | |
1263 GameUI_RightPanel_BookFlashTimer = pParty->uTimePlayed; | |
994 | 1264 |
1265 static bool byte_50697C = false; // 50697C | |
1266 byte_50697C = !byte_50697C; | |
706 | 1267 if ( byte_50697C && pCurrentScreen != SCREEN_REST ) |
1268 { | |
994 | 1269 if (bFlashQuestBook) pRenderer->DrawTextureTransparent(493, 355, pIcons_LOD->GetTexture(uTextureID_ib_td1_A)); |
1270 if (bFlashAutonotesBook) pRenderer->DrawTextureTransparent(527, 353, pIcons_LOD->GetTexture(uTextureID_ib_td2_A)); | |
1271 if (bFlashHistoryBook) pRenderer->DrawTextureTransparent(600, 361, pIcons_LOD->GetTexture(uTextureID_ib_td5_A)); | |
706 | 1272 } |
1273 else | |
1274 { | |
994 | 1275 pRenderer->DrawTextureRGB(468, 0, pTexture_RightFrame); |
1276 GameUI_DrawHiredNPCs(); | |
706 | 1277 } |
1278 } | |
1279 } | |
1280 | |
1281 //----- (0041AEBB) -------------------------------------------------------- | |
994 | 1282 void GameUI_DrawFoodAndGold() |
706 | 1283 { |
1284 int v2; // esi@2 | |
1285 | |
1286 if ( uGameState != GAME_STATE_FINAL_WINDOW ) | |
1287 { | |
1288 v2 = sub_44100D() != 0 ? 381 : 322; | |
1289 sprintf(pTmpBuf, "\r087%lu", pParty->uNumFoodRations); | |
1290 pPrimaryWindow->DrawText(pFontSmallnum, 0, v2, uGameUIFontMain, pTmpBuf, 0, 0, uGameUIFontShadow); | |
1291 sprintf(pTmpBuf, "\r028%lu", pParty->uNumGold); | |
1292 pPrimaryWindow->DrawText(pFontSmallnum, 0, v2, uGameUIFontMain, pTmpBuf, 0, 0, uGameUIFontShadow); | |
1293 } | |
1294 } | |
1295 | |
1296 | |
1297 //----- (0041B0C9) -------------------------------------------------------- | |
994 | 1298 void GameUI_DrawLifeManaBars() |
706 | 1299 { |
1300 double v3; // st7@3 | |
1301 double v7; // st7@25 | |
1302 Texture *v9; // [sp-4h] [bp-30h]@10 | |
1303 Texture *v10; // [sp+Ch] [bp-20h]@1 | |
994 | 1304 |
1305 | |
1306 v10 = pIcons_LOD->GetTexture(uTextureID_BarBlue); | |
706 | 1307 |
994 | 1308 for (uint i = 0; i < 4; ++i) |
706 | 1309 { |
994 | 1310 auto player = pParty->pPlayers + i; |
1311 | |
1312 if (player->sHealth > 0) | |
706 | 1313 { |
994 | 1314 int v17 = 0; |
1315 if (i == 2 || i == 3) | |
1316 v17 = 2; | |
1317 | |
1318 v3 = (double)player->sHealth / (double)player->GetMaxHealth(); | |
1319 if( v3 > 0.5 ) | |
1320 { | |
1321 if ( v3 > 1.0 ) | |
1322 v3 = 1.0; | |
1323 v9 = pIcons_LOD->GetTexture(uTextureID_BarGreen); | |
1324 } | |
1325 else if ( v3 > 0.25 ) | |
1326 v9 = pIcons_LOD->GetTexture(uTextureID_BarYellow); | |
1327 else if ( v3 > 0.0 ) | |
1328 v9 = pIcons_LOD->GetTexture(uTextureID_BarRed); | |
1329 | |
1330 | |
706 | 1331 if( v3 > 0.0 ) |
1332 { | |
994 | 1333 pRenderer->SetTextureClipRect(v17 + pHealthBarPos[i], |
1334 (signed __int64)((1.0 - v3) * v9->uTextureHeight) + 402, | |
1335 v17 + pHealthBarPos[i] + v9->uTextureWidth, | |
1336 v9->uTextureHeight + 402); | |
1337 | |
1338 pRenderer->DrawTextureIndexed(v17 + pHealthBarPos[i], 402, v9); | |
727 | 1339 pRenderer->ResetTextureClipRect(); |
706 | 1340 } |
1341 } | |
994 | 1342 |
1343 | |
1344 if (player->sMana > 0) | |
706 | 1345 { |
994 | 1346 v7 = player->sMana / (double)player->GetMaxMana(); |
706 | 1347 if ( v7 > 1.0 ) |
1348 v7 = 1.0; | |
994 | 1349 |
1350 int v17 = 0; | |
1351 if (i == 2) | |
1352 v17 = 1; | |
1353 | |
1354 pRenderer->SetTextureClipRect(v17 + pManaBarPos[i], | |
1355 (signed __int64)((1.0 - v7) * v10->uTextureHeight) + 402, | |
1356 v17 + pManaBarPos[i] + v10->uTextureWidth, | |
1357 v10->uTextureHeight + 402); | |
1358 pRenderer->DrawTextureIndexed(v17 + pManaBarPos[i], 402, v10); | |
727 | 1359 pRenderer->ResetTextureClipRect(); |
706 | 1360 } |
1361 } | |
1362 } | |
1363 | |
1364 //----- (0041B3B6) -------------------------------------------------------- | |
994 | 1365 void GameUI_DrawRightPanel() |
706 | 1366 { |
994 | 1367 pRenderer->DrawTextureTransparent(pViewport->uViewportBR_X, 0, |
1368 pIcons_LOD->GetTexture(uTextureID_right_panel)); | |
706 | 1369 } |
1370 | |
1371 //----- (0041B3E2) -------------------------------------------------------- | |
994 | 1372 void GameUI_DrawRightPanelFrames() |
706 | 1373 { |
994 | 1374 pRenderer->DrawTextureRGB(0, 0, pTexture_TopFrame); |
1375 pRenderer->DrawTextureRGB(0, 8, pTexture_LeftFrame); | |
1376 pRenderer->DrawTextureRGB(468, 0, pTexture_RightFrame); | |
1377 pRenderer->DrawTextureRGB(0, 352, pTexture_BottomFrame); | |
706 | 1378 GameUI_DrawFoodAndGold(); |
1379 GameUI_DrawRightPanelItems(); | |
1380 } | |
1381 | |
994 | 1382 |
1383 //----- (0041C047) -------------------------------------------------------- | |
1384 void GameUI_Footer_2() | |
706 | 1385 { |
994 | 1386 char *v1; // edx@2 |
1387 int v5; // eax@5 | |
706 | 1388 |
994 | 1389 pRenderer->DrawTextureRGB(0, 352, pTexture_StatusBar); |
1390 if (GameUI_Footer_TimeLeft) | |
1391 v1 = GameUI_Footer_TimedString; | |
1392 else | |
706 | 1393 { |
994 | 1394 if (!pFooterString[0]) |
1395 return; | |
1396 v1 = pFooterString; | |
706 | 1397 } |
994 | 1398 |
1399 v5 = pFontLucida->AlignText_Center(450, v1); | |
1400 pPrimaryWindow->DrawText(pFontLucida, v5 + 11, 357, uGameUIFontMain, v1, 0, 0, uGameUIFontShadow); | |
706 | 1401 } |
1402 | |
1403 //----- (0041C0B8) -------------------------------------------------------- | |
994 | 1404 void GameUI_SetFooterString(const char *pStr) |
1405 { | |
706 | 1406 const char *v1; // esi@1 |
1407 int i; // eax@7 | |
1408 int j; // eax@11 | |
1409 | |
1410 v1 = pStr; | |
994 | 1411 if ( pStr && strcmp(pStr, "test") && !IsBadStringPtrA(v1, 1) && (*v1 || GameUI_Footer_TimeLeft) ) |
706 | 1412 { |
783 | 1413 if ( GameUI_Footer_TimeLeft ) |
706 | 1414 { |
783 | 1415 for ( i = pFontLucida->GetLineWidth(GameUI_Footer_TimedString); |
706 | 1416 i > 450; |
783 | 1417 i = pFontLucida->GetLineWidth(GameUI_Footer_TimedString) ) |
1418 byte_5C3427[strlen(GameUI_Footer_TimedString)] = 0; | |
706 | 1419 } |
1420 else | |
1421 { | |
783 | 1422 strcpy(pFooterString, v1); |
1423 for ( j = pFontLucida->GetLineWidth(pFooterString); | |
706 | 1424 j > 450; |
783 | 1425 j = pFontLucida->GetLineWidth(pFooterString) ) |
1426 GameUI_Footer_TimedString[strlen(pFooterString) + 199] = 0; | |
706 | 1427 } |
1428 } | |
1429 } | |
1430 | |
1431 //----- (0041C179) -------------------------------------------------------- | |
783 | 1432 void GameUI_Footer() |
1433 { | |
994 | 1434 //unsigned int v0; // ebp@1 |
706 | 1435 char *v1; // edi@5 |
1436 int v2; // eax@5 | |
1437 unsigned int v3; // esi@5 | |
1438 size_t v4; // eax@6 | |
1439 GUIFont *v5; // ecx@6 | |
1440 int v6; // eax@9 | |
1441 size_t v7; // eax@10 | |
1442 GUIFont *v8; // ecx@10 | |
1443 char v9; // zf@12 | |
994 | 1444 //unsigned int v10; // ST08_4@13 |
706 | 1445 int v11; // eax@13 |
1446 | |
783 | 1447 if ( pFooterString[0] || GameUI_Footer_TimeLeft || bForceDrawFooter ) |
706 | 1448 { |
1449 pRenderer->DrawTextureRGB(0, 352u, pTexture_StatusBar); | |
783 | 1450 if ( GameUI_Footer_TimeLeft ) |
706 | 1451 { |
783 | 1452 v1 = GameUI_Footer_TimedString; |
1453 v2 = pFontLucida->GetLineWidth(GameUI_Footer_TimedString); | |
706 | 1454 v3 = 450; |
1455 while ( v2 > 450 ) | |
1456 { | |
783 | 1457 v4 = strlen(GameUI_Footer_TimedString); |
706 | 1458 v5 = pFontLucida; |
1459 byte_5C3427[v4] = 0; | |
783 | 1460 v2 = pFontLucida->GetLineWidth(GameUI_Footer_TimedString); |
706 | 1461 } |
1462 } | |
1463 else | |
1464 { | |
783 | 1465 v1 = pFooterString; |
1466 v6 = pFontLucida->GetLineWidth(pFooterString); | |
706 | 1467 v3 = 450; |
1468 while ( v6 > 450 ) | |
1469 { | |
783 | 1470 v7 = strlen(pFooterString); |
706 | 1471 v8 = pFontLucida; |
783 | 1472 GameUI_Footer_TimedString[v7 + 199] = 0; |
1473 v6 = pFontLucida->GetLineWidth(pFooterString); | |
706 | 1474 } |
1475 } | |
1476 v9 = *v1 == 0; | |
783 | 1477 bForceDrawFooter = 0; |
706 | 1478 if ( !v9 ) |
1479 { | |
1480 v11 = pFontLucida->AlignText_Center(v3, v1); | |
994 | 1481 pPrimaryWindow->DrawText(pFontLucida, v11 + 11, 357, uGameUIFontMain, v1, 0, 0, uGameUIFontShadow); |
706 | 1482 } |
1483 } | |
1484 } | |
783 | 1485 // 5C35BC: using guessed type int bForceDrawFooter; |
706 | 1486 |
1487 | |
1488 //----- (00420EFF) -------------------------------------------------------- | |
1489 void __cdecl GameUI_WritePointedObjectStatusString() | |
1490 { | |
1491 int v1; // ebx@6 | |
1492 GUIWindow *pWindow; // edi@7 | |
1493 GUIButton *pButton; // ecx@11 | |
1494 Player *pPlayer; // eax@19 | |
1495 char v5; // cl@19 | |
1496 unsigned int v6; // eax@19 | |
1497 int v7; // ecx@19 | |
1498 __int16 v8; // fps@23 | |
1499 unsigned __int8 v9; // c0@23 | |
1500 unsigned __int8 v10; // c3@23 | |
1501 enum UIMessageType pMessageType1; // esi@24 | |
832 | 1502 //int v12; // edx@25 |
706 | 1503 char *v13; // ecx@28 |
1504 int v14; // eax@41 | |
1505 ItemGen *pItemGen; // ecx@44 | |
1506 int v16; // ecx@46 | |
1507 const char *v17; // eax@49 | |
1508 signed int v18; // eax@55 | |
867 | 1509 signed int v18b; |
706 | 1510 signed int v19; // ecx@63 |
1511 BLVFace *pFace; // eax@69 | |
1512 __int16 v21; // ax@70 | |
1513 const char *v22; // eax@72 | |
1514 LevelDecoration *v23; // ecx@75 | |
1515 LevelDecoration *v24; // esi@75 | |
1516 __int16 v25; // ax@75 | |
1517 const char *v26; // ecx@79 | |
1518 Actor *pActor; // ecx@82 | |
1519 char *v28; // esi@82 | |
1520 int v29; // eax@82 | |
1521 signed int v30; // ecx@88 | |
1522 const char *v31; // eax@91 | |
1523 __int16 v32; // fps@109 | |
1524 //unsigned __int8 v33; // c0@109 | |
1525 //unsigned __int8 v34; // c3@109 | |
1526 enum UIMessageType pMessageType2; // esi@110 | |
832 | 1527 //int v36; // edx@111 |
706 | 1528 enum UIMessageType pMessageType3; // edx@117 |
832 | 1529 //int v38; // ecx@118 |
706 | 1530 const char *v39; // [sp-8h] [bp-E8h]@20 |
1531 char *v40; // [sp-8h] [bp-E8h]@83 | |
1532 int v41; // [sp-4h] [bp-E4h]@20 | |
1533 char Str1[200]; // [sp+Ch] [bp-D4h]@129 | |
1534 unsigned int pX; // [sp+D4h] [bp-Ch]@1 | |
1535 unsigned int pY; // [sp+D8h] [bp-8h]@1 | |
1536 unsigned int v45; // [sp+DCh] [bp-4h]@21 | |
1537 | |
1538 v13 = nullptr; | |
1539 | |
1540 pMouse->uPointingObjectID = 0; | |
1541 pMouse->GetClickPos(&pX, &pY); | |
1542 if ( pX < 0 || (signed int)pX > 639 || pY < 0 || (signed int)pY > 479 )//( (pX & 0x80000000u) != 0 || (signed int)pX > 639 || (pY & 0x80000000u) != 0 || (signed int)pY > 479 ) | |
1543 return; | |
1544 if (pCurrentScreen == SCREEN_GAME) | |
1545 { | |
1546 if ( (signed int)pX > 467 || (signed int)pY > 351 ) | |
1547 goto _click_on_game_ui; | |
871 | 1548 if ( pRenderer->pRenderD3D ) // inlined mm8::4C1E01 |
706 | 1549 { |
1550 v18 = pGame->pVisInstance->get_picked_object_zbuf_val(); | |
1551 if ( (signed int)pX < (signed int)pViewport->uScreen_TL_X | |
1552 || (signed int)pX > (signed int)pViewport->uScreen_BR_X | |
1553 || (signed int)pY < (signed int)pViewport->uScreen_TL_Y | |
1554 || (signed int)pY > (signed int)pViewport->uScreen_BR_Y ) | |
1555 v18 = -1; | |
1556 if ( v18 == -1 ) | |
1557 //goto LABEL_61; | |
1558 { | |
1559 pMouse->uPointingObjectID = 0; | |
1560 if ( pMouse->uPointingObjectID == 0 ) | |
1561 { | |
1562 if ( uLastPointedObjectID != 0 ) | |
1563 { | |
783 | 1564 pFooterString[0] = 0; |
1565 bForceDrawFooter = 1; | |
706 | 1566 } |
1567 } | |
1568 uLastPointedObjectID = pMouse->uPointingObjectID; | |
1569 return; | |
1570 } | |
1571 } | |
1572 else | |
1573 { | |
1574 v18 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]]; | |
1575 } | |
1576 pMouse->uPointingObjectID = (unsigned __int16)v18; | |
828
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
809
diff
changeset
|
1577 v19 = (signed)PID_ID(v18); |
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
809
diff
changeset
|
1578 if (PID_TYPE(v18) == OBJECT_Item) |
706 | 1579 { |
1580 v30 = v19; | |
1581 if ( pObjectList->pObjects[pSpriteObjects[v30].uObjectDescID].uFlags & 0x10 ) | |
1582 //goto LABEL_73; | |
1583 { | |
1584 pMouse->uPointingObjectID = 0; | |
1585 //goto LABEL_50; | |
1586 uLastPointedObjectID = 1; | |
1587 if ( pMouse->uPointingObjectID == 0 ) | |
1588 { | |
1589 if ( uLastPointedObjectID != 0 ) | |
1590 { | |
783 | 1591 pFooterString[0] = 0; |
1592 bForceDrawFooter = 1; | |
706 | 1593 } |
1594 } | |
1595 uLastPointedObjectID = pMouse->uPointingObjectID; | |
1596 return; | |
1597 } | |
1598 if ( v18 >= (signed int)0x2000000u || pParty->pPickedItem.uItemID ) | |
1599 { | |
1600 v22 = pSpriteObjects[v30].stru_24.GetDisplayName(); | |
1601 //LABEL_93: | |
1602 v26 = v22; | |
1603 //goto LABEL_87; | |
994 | 1604 GameUI_SetFooterString(v26); |
706 | 1605 if ( pMouse->uPointingObjectID == 0 ) |
1606 { | |
1607 if ( uLastPointedObjectID != 0 ) | |
1608 { | |
783 | 1609 pFooterString[0] = 0; |
1610 bForceDrawFooter = 1; | |
706 | 1611 } |
1612 } | |
1613 uLastPointedObjectID = pMouse->uPointingObjectID; | |
1614 return; | |
1615 } | |
1616 v31 = pSpriteObjects[v30].stru_24.GetDisplayName(); | |
1617 v28 = pTmpBuf; | |
809 | 1618 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[470], v31);// "Get %s" |
706 | 1619 } |
1620 else | |
1621 { | |
828
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
809
diff
changeset
|
1622 if (PID_TYPE(v18) != OBJECT_Actor) |
706 | 1623 { |
828
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
809
diff
changeset
|
1624 if (PID_TYPE(v18) == OBJECT_Decoration) |
706 | 1625 { |
1626 v23 = &pLevelDecorations[v19]; | |
1627 v24 = v23; | |
1628 v25 = v23->field_16_event_id; | |
1629 if ( !v25 ) | |
1630 { | |
1631 if ( v23->IsInteractive() ) | |
1632 v26 = pNPCTopics[stru_5E4C90._decor_events[v24->_idx_in_stru123 - 75] + 379].pTopic; | |
1633 else | |
1634 v26 = pDecorationList->pDecorations[v24->uDecorationDescID].field_20; | |
1635 //goto LABEL_87; | |
994 | 1636 GameUI_SetFooterString(v26); |
706 | 1637 if ( pMouse->uPointingObjectID == 0 ) |
1638 { | |
1639 if ( uLastPointedObjectID != 0 ) | |
1640 { | |
783 | 1641 pFooterString[0] = 0; |
1642 bForceDrawFooter = 1; | |
706 | 1643 } |
1644 } | |
1645 uLastPointedObjectID = pMouse->uPointingObjectID; | |
1646 return; | |
1647 } | |
1648 v22 = GetEventHintString(v25); | |
1649 if ( !v22 ) | |
1650 //goto _return; | |
1651 { | |
1652 if ( pMouse->uPointingObjectID == 0 ) | |
1653 { | |
1654 if ( uLastPointedObjectID != 0 ) | |
1655 { | |
783 | 1656 pFooterString[0] = 0; |
1657 bForceDrawFooter = 1; | |
706 | 1658 } |
1659 } | |
1660 uLastPointedObjectID = pMouse->uPointingObjectID; | |
1661 return; | |
1662 } | |
1663 //goto LABEL_93; | |
1664 v26 = v22; | |
1665 //goto LABEL_87; | |
994 | 1666 GameUI_SetFooterString(v26); |
706 | 1667 if ( pMouse->uPointingObjectID == 0 ) |
1668 { | |
1669 if ( uLastPointedObjectID != 0 ) | |
1670 { | |
783 | 1671 pFooterString[0] = 0; |
1672 bForceDrawFooter = 1; | |
706 | 1673 } |
1674 } | |
1675 uLastPointedObjectID = pMouse->uPointingObjectID; | |
1676 return; | |
1677 } | |
828
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
809
diff
changeset
|
1678 if (PID_TYPE(v18) == OBJECT_BModel) |
706 | 1679 { |
1030 | 1680 if ( HIWORD(v18) < 512) |
706 | 1681 { |
1682 if ( uCurrentlyLoadedLevelType != LEVEL_Indoor) | |
1683 { | |
867 | 1684 v18b = (signed int)(unsigned __int16)v18 >> 9; |
1685 v21 = pOutdoor->pBModels[v18b].pFaces[v19 & 0x3F].sCogTriggeredID; | |
706 | 1686 //goto LABEL_71; |
1687 if ( !v21 || (v22 = GetEventHintString(v21)) == 0 ) | |
1688 //goto LABEL_73; | |
1689 { | |
1690 pMouse->uPointingObjectID = 0; | |
1691 //goto LABEL_50; | |
1692 uLastPointedObjectID = 1; | |
1693 if ( pMouse->uPointingObjectID == 0 ) | |
1694 { | |
1695 if ( uLastPointedObjectID != 0 ) | |
1696 { | |
783 | 1697 pFooterString[0] = 0; |
1698 bForceDrawFooter = 1; | |
706 | 1699 } |
1700 } | |
1701 uLastPointedObjectID = pMouse->uPointingObjectID; | |
1702 return; | |
1703 } | |
1704 //goto LABEL_93; | |
1705 v26 = v22; | |
1706 //goto LABEL_87; | |
994 | 1707 GameUI_SetFooterString(v26); |
706 | 1708 if ( pMouse->uPointingObjectID == 0 ) |
1709 { | |
1710 if ( uLastPointedObjectID != 0 ) | |
1711 { | |
783 | 1712 pFooterString[0] = 0; |
1713 bForceDrawFooter = 1; | |
706 | 1714 } |
1715 } | |
1716 uLastPointedObjectID = pMouse->uPointingObjectID; | |
1717 return; | |
1718 } | |
1719 pFace = &pIndoor->pFaces[v19]; | |
1720 if ( BYTE3(pFace->uAttributes) & 6 ) | |
1721 { | |
1722 v21 = pIndoor->pFaceExtras[pFace->uFaceExtraID].uEventID; | |
1723 //LABEL_71: | |
1724 if ( !v21 || (v22 = GetEventHintString(v21)) == 0 ) | |
1725 //goto LABEL_73; | |
1726 { | |
1727 pMouse->uPointingObjectID = 0; | |
1728 //goto LABEL_50; | |
1729 uLastPointedObjectID = 1; | |
1730 if ( pMouse->uPointingObjectID == 0 ) | |
1731 { | |
1732 if ( uLastPointedObjectID != 0 ) | |
1733 { | |
783 | 1734 pFooterString[0] = 0; |
1735 bForceDrawFooter = 1; | |
706 | 1736 } |
1737 } | |
1738 uLastPointedObjectID = pMouse->uPointingObjectID; | |
1739 return; | |
1740 } | |
1741 //goto LABEL_93; | |
1742 v26 = v22; | |
1743 //goto LABEL_87; | |
994 | 1744 GameUI_SetFooterString(v26); |
706 | 1745 if ( pMouse->uPointingObjectID == 0 ) |
1746 { | |
1747 if ( uLastPointedObjectID != 0 ) | |
1748 { | |
783 | 1749 pFooterString[0] = 0; |
1750 bForceDrawFooter = 1; | |
706 | 1751 } |
1752 } | |
1753 uLastPointedObjectID = pMouse->uPointingObjectID; | |
1754 return; | |
1755 } | |
1756 } | |
1757 //LABEL_73: | |
1758 pMouse->uPointingObjectID = 0; | |
1759 //goto LABEL_50; | |
1760 uLastPointedObjectID = 1; | |
1761 if ( pMouse->uPointingObjectID == 0 ) | |
1762 { | |
1763 if ( uLastPointedObjectID != 0 ) | |
1764 { | |
783 | 1765 pFooterString[0] = 0; |
1766 bForceDrawFooter = 1; | |
706 | 1767 } |
1768 } | |
1769 uLastPointedObjectID = pMouse->uPointingObjectID; | |
1770 return; | |
1771 } | |
1772 //LABEL_61: | |
1773 pMouse->uPointingObjectID = 0; | |
1774 //goto _return; | |
1775 if ( pMouse->uPointingObjectID == 0 ) | |
1776 { | |
1777 if ( uLastPointedObjectID != 0 ) | |
1778 { | |
783 | 1779 pFooterString[0] = 0; |
1780 bForceDrawFooter = 1; | |
706 | 1781 } |
1782 } | |
1783 uLastPointedObjectID = pMouse->uPointingObjectID; | |
1784 return; | |
1785 } | |
1786 if ( v18 >= 335544320 ) | |
1787 //goto LABEL_61; | |
1788 { | |
1789 pMouse->uPointingObjectID = 0; | |
1790 if ( pMouse->uPointingObjectID == 0 ) | |
1791 { | |
1792 if ( uLastPointedObjectID != 0 ) | |
1793 { | |
783 | 1794 pFooterString[0] = 0; |
1795 bForceDrawFooter = 1; | |
706 | 1796 } |
1797 } | |
1798 uLastPointedObjectID = pMouse->uPointingObjectID; | |
1799 return; | |
1800 } | |
1801 pActor = &pActors[v19]; | |
1802 v28 = pTmpBuf; | |
1803 v29 = pActor->dword_000334_unique_name; | |
1804 if ( v29 ) | |
1805 v40 = pMonsterStats->pPlaceStrings[v29]; | |
1806 else | |
1807 v40 = pMonsterStats->pInfos[pActor->pMonsterInfo.uID].pName; | |
1808 strncpy(pTmpBuf, v40, 0x7D0u); | |
1809 } | |
1810 v26 = v28; | |
1811 //LABEL_87: | |
994 | 1812 GameUI_SetFooterString(v26); |
706 | 1813 //goto _return; |
1814 if ( pMouse->uPointingObjectID == 0 ) | |
1815 { | |
1816 if ( uLastPointedObjectID != 0 ) | |
1817 { | |
783 | 1818 pFooterString[0] = 0; |
1819 bForceDrawFooter = 1; | |
706 | 1820 } |
1821 } | |
1822 uLastPointedObjectID = pMouse->uPointingObjectID; | |
1823 return; | |
1824 } | |
1825 v1 = uNumVisibleWindows; | |
1826 if ( uNumVisibleWindows > 0 ) | |
1827 { | |
1828 while ( 1 ) // some other fullscreen ui | |
1829 { | |
1830 pWindow = &pWindowList[pVisibleWindowsIdxs[v1] - 1]; | |
1831 if ( (signed int)pX >= (signed int)pWindow->uFrameX | |
1832 && (signed int)pX <= (signed int)pWindow->uFrameZ | |
1833 && (signed int)pY >= (signed int)pWindow->uFrameY | |
1834 && (signed int)pY <= (signed int)pWindow->uFrameW ) | |
1835 { | |
1836 for ( pButton = pWindow->pControlsHead; ; pButton = pButton->pNext ) | |
1837 { | |
1838 if ( !pButton ) | |
1839 break; | |
1840 if ( pButton->uButtonType == 1 ) | |
1841 { | |
1842 if ( (signed int)pX >= (signed int)pButton->uX | |
1843 && (signed int)pX <= (signed int)pButton->uZ | |
1844 && (signed int)pY >= (signed int)pButton->uY | |
1845 && (signed int)pY <= (signed int)pButton->uW ) | |
1846 { | |
1847 //LABEL_24: | |
1848 pMessageType1 = (UIMessageType)pButton->field_1C; | |
1849 if ( pMessageType1 ) | |
1850 { | |
832 | 1851 pMessageQueue_50CBD0->AddMessage(pMessageType1, pButton->msg_param, 0); |
706 | 1852 } |
1853 //LABEL_28: | |
1854 v13 = pButton->pButtonName; | |
1855 //_set_status_and_ret: | |
994 | 1856 GameUI_SetFooterString(v13); |
706 | 1857 //LABEL_131: |
1858 uLastPointedObjectID = 1; | |
1859 return; | |
1860 } | |
1861 } | |
1862 else | |
1863 { | |
1864 if ( pButton->uButtonType == 2 ) | |
1865 { | |
1866 v45 = pX - pButton->uX; | |
1867 v45 = pY - pButton->uY; | |
1868 if ( (double)(signed int)pButton->uWidth != 0.0 ) | |
1869 { | |
1870 if ( (double)(signed int)pButton->uHeight != 0.0 ) | |
1871 { | |
1872 pMessageType1 = (UIMessageType)pButton->field_1C; | |
1873 if ( pMessageType1 ) | |
1874 { | |
832 | 1875 pMessageQueue_50CBD0->AddMessage(pMessageType1, pButton->msg_param, 0); |
706 | 1876 } |
1877 v13 = pButton->pButtonName; | |
994 | 1878 GameUI_SetFooterString(v13); |
706 | 1879 uLastPointedObjectID = 1; |
1880 return; | |
1881 //} | |
1882 } | |
1883 } | |
1884 } | |
1885 else // click on skill | |
1886 { | |
1887 if ( pButton->uButtonType == 3 | |
1888 && (signed int)pX >= (signed int)pButton->uX | |
1889 && (signed int)pX <= (signed int)pButton->uZ | |
1890 && (signed int)pY >= (signed int)pButton->uY | |
1891 && (signed int)pY <= (signed int)pButton->uW ) | |
1892 { | |
1893 //LABEL_19: | |
1894 pPlayer = pPlayers[uActiveCharacter]; | |
832 | 1895 v5 = LOBYTE(pPlayer->pActiveSkills[pButton->msg_param]); |
706 | 1896 v6 = pPlayer->uSkillPoints; |
1897 v7 = (v5 & 0x3F) + 1; | |
1898 if ( v6 < v7 ) | |
1899 { | |
1900 v41 = v7 - v6; | |
1901 v39 = pGlobalTXT_LocalizationStrings[469];// "You need %d more Skill Points to advance here" | |
1902 } | |
1903 else | |
1904 { | |
1905 v41 = v7; | |
1906 v39 = pGlobalTXT_LocalizationStrings[468];// "Clicking here will spend %d Skill Points" | |
1907 } | |
1908 sprintf(Str1, v39, v41); | |
1909 v13 = Str1; | |
1910 //goto _set_status_and_ret; | |
994 | 1911 GameUI_SetFooterString(v13); |
706 | 1912 uLastPointedObjectID = 1; |
1913 return; | |
1914 } | |
1915 } | |
1916 } | |
1917 } | |
1918 } | |
1919 if ( pWindow->uFrameHeight == 480 ) | |
1920 break; | |
1921 --v1; | |
1922 if ( v1 <= 0 ) | |
1923 { | |
1924 break; | |
1925 } | |
1926 } | |
1927 } | |
1928 if ( uNumVisibleWindows <= 0 || (uNumVisibleWindows > 0 && pWindow->uFrameHeight != 480 && v1 <= 0)) | |
1929 { | |
1930 if ( pCurrentScreen == SCREEN_CHEST ) | |
1931 { | |
1932 sub_42038D(); | |
1933 //goto _return; | |
1934 if ( pMouse->uPointingObjectID == 0 ) | |
1935 { | |
1936 if ( uLastPointedObjectID != 0 ) | |
1937 { | |
783 | 1938 pFooterString[0] = 0; |
1939 bForceDrawFooter = 1; | |
706 | 1940 } |
1941 } | |
1942 uLastPointedObjectID = pMouse->uPointingObjectID; | |
1943 return; | |
1944 } | |
1945 if ( pCurrentScreen == SCREEN_HOUSE ) | |
1946 { | |
747 | 1947 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD |
706 | 1948 || (v16 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]], v16 == 0) |
1949 || v16 == -65536 ) | |
1950 //goto _return; | |
1951 { | |
1952 if ( pMouse->uPointingObjectID == 0 ) | |
1953 { | |
1954 if ( uLastPointedObjectID != 0 ) | |
1955 { | |
783 | 1956 pFooterString[0] = 0; |
1957 bForceDrawFooter = 1; | |
706 | 1958 } |
1959 } | |
1960 uLastPointedObjectID = pMouse->uPointingObjectID; | |
1961 return; | |
1962 } | |
1963 pItemGen = (ItemGen *)((char *)&pParty->pPickedItem + 36 * (v16 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 4); | |
1964 //LABEL_49: | |
1965 v17 = pItemGen->GetDisplayName(); | |
994 | 1966 GameUI_SetFooterString(v17); |
706 | 1967 //LABEL_50: |
1968 uLastPointedObjectID = 1; | |
1969 //_return: | |
1970 if ( pMouse->uPointingObjectID == 0 ) | |
1971 { | |
1972 if ( uLastPointedObjectID != 0 ) | |
1973 { | |
783 | 1974 pFooterString[0] = 0; |
1975 bForceDrawFooter = 1; | |
706 | 1976 } |
1977 } | |
1978 uLastPointedObjectID = pMouse->uPointingObjectID; | |
1979 return; | |
1980 } | |
1981 if ( (signed int)pY < 350 ) | |
1982 { | |
1983 v14 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]]; | |
1984 if ( v14 == 0 || v14 == -65536 || (unsigned int)v14 >= 0x1388 ) | |
1985 //goto _return; | |
1986 { | |
1987 if ( pMouse->uPointingObjectID == 0 ) | |
1988 { | |
1989 if ( uLastPointedObjectID != 0 ) | |
1990 { | |
783 | 1991 pFooterString[0] = 0; |
1992 bForceDrawFooter = 1; | |
706 | 1993 } |
1994 } | |
1995 uLastPointedObjectID = pMouse->uPointingObjectID; | |
1996 return; | |
1997 } | |
1998 pItemGen = (ItemGen *)&pPlayers[uActiveCharacter]->pInventoryItems[v14-1]; | |
1999 //goto LABEL_49; | |
2000 v17 = pItemGen->GetDisplayName(); | |
994 | 2001 GameUI_SetFooterString(v17); |
706 | 2002 uLastPointedObjectID = 1; |
2003 if ( pMouse->uPointingObjectID == 0 ) | |
2004 { | |
2005 if ( uLastPointedObjectID != 0 ) | |
2006 { | |
783 | 2007 pFooterString[0] = 0; |
2008 bForceDrawFooter = 1; | |
706 | 2009 } |
2010 } | |
2011 uLastPointedObjectID = pMouse->uPointingObjectID; | |
2012 return; | |
2013 } | |
2014 _click_on_game_ui: | |
2015 if ( (signed int)pX >= (signed int)pWindowList[0].uFrameX | |
2016 && (signed int)pX <= (signed int)pWindowList[0].uFrameZ | |
2017 && (signed int)pY >= (signed int)pWindowList[0].uFrameY | |
2018 && (signed int)pY <= (signed int)pWindowList[0].uFrameW ) | |
2019 { | |
2020 for ( pButton = pWindowList[0].pControlsHead; pButton != (GUIButton *)0; pButton = pButton->pNext ) | |
2021 { | |
2022 if ( pButton->uButtonType == 1 ) | |
2023 { | |
2024 if ( (signed int)pX >= (signed int)pButton->uX | |
2025 && (signed int)pX <= (signed int)pButton->uZ | |
2026 && (signed int)pY >= (signed int)pButton->uY | |
2027 && (signed int)pY <= (signed int)pButton->uW ) | |
2028 { | |
2029 pMessageType3 = (UIMessageType)pButton->field_1C; | |
2030 if ( pMessageType3 == 0 ) // For books | |
2031 //goto LABEL_28; | |
2032 { | |
2033 v13 = pButton->pButtonName; | |
994 | 2034 GameUI_SetFooterString(v13); |
706 | 2035 uLastPointedObjectID = 1; |
2036 return; | |
2037 } | |
832 | 2038 |
2039 pMessageQueue_50CBD0->AddMessage(pMessageType3, pButton->msg_param, 0); | |
706 | 2040 //goto LABEL_131; |
2041 uLastPointedObjectID = 1; | |
2042 return; | |
2043 } | |
2044 } | |
2045 else | |
2046 { | |
2047 if ( pButton->uButtonType == 2 ) | |
2048 { | |
2049 v45 = pX - pButton->uX; | |
2050 v45 = pY - pButton->uY; | |
2051 | |
2052 if (pX >= pButton->uX && pX <= pButton->uZ && | |
2053 pY >= pButton->uY && pY <= pButton->uW) | |
2054 if ( (double)(signed int)pButton->uWidth != 0.0 ) | |
2055 { | |
2056 if ( (double)(signed int)pButton->uHeight != 0.0 ) | |
2057 { | |
2058 //UNDEF(v32); | |
2059 //if ( v33 | v34 ) | |
2060 //{ | |
2061 pMessageType2 = (UIMessageType)pButton->field_1C; | |
2062 if ( pMessageType2 != 0 ) | |
832 | 2063 pMessageQueue_50CBD0->AddMessage(pMessageType2, pButton->msg_param, 0); |
2064 | |
706 | 2065 //goto LABEL_28; |
2066 v13 = pButton->pButtonName; | |
994 | 2067 GameUI_SetFooterString(v13); |
706 | 2068 uLastPointedObjectID = 1; |
2069 return; | |
2070 //} | |
2071 } | |
2072 } | |
2073 } | |
2074 else | |
2075 { | |
2076 if ( pButton->uButtonType == 3 | |
2077 && (signed int)pX >= (signed int)pButton->uX | |
2078 && (signed int)pX <= (signed int)pButton->uZ | |
2079 && (signed int)pY >= (signed int)pButton->uY | |
2080 && (signed int)pY <= (signed int)pButton->uW ) | |
2081 //goto LABEL_19; | |
2082 { | |
2083 pPlayer = pPlayers[uActiveCharacter]; | |
832 | 2084 v5 = LOBYTE(pPlayer->pActiveSkills[pButton->msg_param]); |
706 | 2085 v6 = pPlayer->uSkillPoints; |
2086 v7 = (v5 & 0x3F) + 1; | |
2087 if ( v6 < v7 ) | |
2088 { | |
2089 v41 = v7 - v6; | |
2090 v39 = pGlobalTXT_LocalizationStrings[469];// "You need %d more Skill Points to advance here" | |
2091 } | |
2092 else | |
2093 { | |
2094 v41 = v7; | |
2095 v39 = pGlobalTXT_LocalizationStrings[468];// "Clicking here will spend %d Skill Points" | |
2096 } | |
2097 sprintf(Str1, v39, v41); | |
2098 v13 = Str1; | |
2099 //goto _set_status_and_ret; | |
994 | 2100 GameUI_SetFooterString(v13); |
706 | 2101 uLastPointedObjectID = 1; |
2102 return; | |
2103 } | |
2104 } | |
2105 } | |
2106 } | |
2107 } | |
2108 pMouse->uPointingObjectID = sub_46A99B(); | |
2109 //goto _return; | |
2110 if ( pMouse->uPointingObjectID == 0 ) | |
2111 { | |
2112 if ( uLastPointedObjectID != 0 ) | |
2113 { | |
783 | 2114 pFooterString[0] = 0; |
2115 bForceDrawFooter = 1; | |
706 | 2116 } |
2117 } | |
2118 uLastPointedObjectID = pMouse->uPointingObjectID; | |
2119 return; | |
2120 } | |
2121 } | |
2122 | |
2123 | |
2124 //----- (0044158F) -------------------------------------------------------- | |
995 | 2125 void GameUI_DrawCharacterSelectionFrame() |
920 | 2126 { |
2127 if ( uActiveCharacter ) | |
995 | 2128 pRenderer->DrawTextureTransparent(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[uActiveCharacter - 1] - 9, 380, |
2129 pIcons_LOD->GetTexture(uTextureID_GameUI_CharSelectionFrame)); | |
920 | 2130 } |
706 | 2131 |
2132 | |
2133 | |
2134 //----- (0044162D) -------------------------------------------------------- | |
995 | 2135 void GameUI_DrawPartySpells() |
2136 { | |
706 | 2137 unsigned int v0; // ebp@1 |
2138 //signed int v1; // edi@1 | |
2139 //int v2; // eax@2 | |
2140 //int v3; // ecx@5 | |
2141 //__int16 *v4; // ebx@25 | |
2142 //Player *v5; // edi@26 | |
2143 //unsigned int v6; // [sp-4h] [bp-1Ch]@11 | |
2144 Texture *v7; // [sp-4h] [bp-1Ch]@12 | |
2145 //unsigned int v8; // [sp-4h] [bp-1Ch]@20 | |
2146 Texture *v9; // [sp-4h] [bp-1Ch]@21 | |
2147 //Player **v10; // [sp+10h] [bp-8h]@25 | |
2148 | |
2149 v0 = (signed __int64)((double)GetTickCount() * 0.050000001); | |
2150 //v1 = 0; | |
2151 for (uint i = 0; i < 14; ++i) | |
2152 { | |
2153 //v2 = byte_4E5DD8[v1]; | |
2154 if (pParty->pPartyBuffs[byte_4E5DD8[i]].uExpireTime) | |
2155 { | |
2156 auto tex = pIcons_LOD->GetTexture(pTextureIDs_PartyBuffIcons[i]); | |
2157 //v3 = pTextureIDs_PartyBuffIcons[i]; | |
2158 pRenderer->_4A65CC(pPartySpellbuffsUI_XYs[i][0], | |
2159 pPartySpellbuffsUI_XYs[i][1], tex, tex, | |
2160 v0 + 20 * pPartySpellbuffsUI_smthns[i], 0, 63); | |
2161 } | |
2162 //++v1; | |
2163 } | |
2164 //while ( v1 < 14 ); | |
2165 | |
2166 if (pCurrentScreen == SCREEN_GAME || pCurrentScreen == SCREEN_NPC_DIALOGUE) | |
2167 { | |
2168 if (pParty->FlyActive()) | |
2169 { | |
2170 if ( pParty->bFlying ) | |
995 | 2171 v7 = pIcons_LOD->GetTexture(pIconsFrameTable->GetFrame(uIconIdx_FlySpell, v0)->uTextureID); |
706 | 2172 else |
995 | 2173 v7 = pIcons_LOD->GetTexture(pIconsFrameTable->GetFrame(uIconIdx_FlySpell, 0)->uTextureID); |
706 | 2174 if ( pRenderer->pRenderD3D ) |
995 | 2175 pRenderer->DrawTextureIndexed(8, 8, v7); |
706 | 2176 else |
995 | 2177 pRenderer->DrawTextureTransparent(8, 8, v7); |
706 | 2178 } |
2179 if (pParty->WaterWalkActive()) | |
2180 { | |
2181 if ( pParty->uFlags & PARTY_FLAGS_1_STANDING_ON_WATER) | |
995 | 2182 v9 = pIcons_LOD->GetTexture(pIconsFrameTable->GetFrame(uIconIdx_WaterWalk, v0)->uTextureID); |
706 | 2183 else |
995 | 2184 v9 = pIcons_LOD->GetTexture(pIconsFrameTable->GetFrame(uIconIdx_WaterWalk, 0)->uTextureID); |
706 | 2185 if ( pRenderer->pRenderD3D ) |
2186 pRenderer->DrawTextureIndexed(396u, 8u, v9); | |
2187 else | |
2188 pRenderer->DrawTextureTransparent(396u, 8u, v9); | |
2189 } | |
2190 } | |
2191 | |
2192 for (uint i = 0; i < 4; ++i) | |
2193 { | |
2194 auto player = pParty->pPlayers + i; | |
2195 | |
2196 if (player->pPlayerBuffs[PLAYER_BUFF_HAMMERHANDS].uExpireTime) | |
2197 pRenderer->DrawTextureIndexed(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 72, 427, pIcons_LOD->GetTexture(uTextureID_PlayerBuff_Hammerhands)); | |
2198 if (player->pPlayerBuffs[PLAYER_BUFF_BLESS].uExpireTime) | |
2199 pRenderer->DrawTextureIndexed(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 72, 393, pIcons_LOD->GetTexture(uTextureID_PlayerBuff_Bless)); | |
2200 if (player->pPlayerBuffs[PLAYER_BUFF_PRESERVATION].uExpireTime) | |
2201 pRenderer->DrawTextureIndexed(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 72, 410, pIcons_LOD->GetTexture(uTextureID_PlayerBuff_Preservation)); | |
2202 if (player->pPlayerBuffs[PLAYER_BUFF_PAIN_REFLECTION].uExpireTime) | |
2203 pRenderer->DrawTextureIndexed(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 72, 444, pIcons_LOD->GetTexture(uTextureID_PlayerBuff_PainReflection)); | |
2204 } | |
2205 } | |
2206 | |
2207 | |
2208 | |
2209 //----- (004921C1) -------------------------------------------------------- | |
2210 void GameUI_DrawPortraits(unsigned int _this) | |
832 | 2211 { |
706 | 2212 Texture *pFace; // eax@10 |
2213 unsigned int v7; // eax@17 | |
2214 PlayerFrame *pFrame; // eax@21 | |
2215 unsigned int v9; // eax@27 | |
2216 bool v10; // eax@33 | |
2217 bool v11; // edi@40 | |
2218 bool v12; // edx@43 | |
2219 bool v13; // ecx@46 | |
2220 int v16; // eax@57 | |
2221 int v19; // eax@62 | |
2222 Texture *pPortrait; // [sp-4h] [bp-1Ch]@27 | |
2223 unsigned int v22; // [sp+14h] [bp-4h]@1 | |
2224 | |
2225 v22 = _this; | |
2226 if ( qword_A750D8 ) | |
2227 { | |
2228 qword_A750D8 -= (signed int)pMiscTimer->uTimeElapsed; | |
2229 if ( qword_A750D8 <= 0 ) | |
2230 { | |
2231 if ( pPlayers[word_A750E2]->CanAct() ) | |
2232 pPlayers[word_A750E2]->PlaySound((PlayerSpeech)word_A750E0, 0); | |
2233 qword_A750D8 = 0i64; | |
2234 } | |
2235 } | |
2236 | |
2237 for (uint i = 0; i < 4; ++i) | |
2238 { | |
2239 auto pPlayer = pParty->pPlayers + i; | |
2240 | |
2241 if (pPlayer->Eradicated()) | |
2242 { | |
2243 pFace = pTexture_PlayerFaceEradicated; | |
2244 pPortrait = pFace; | |
2245 v9 = pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i]; | |
2246 if ( pParty->pPartyBuffs[11].uExpireTime ) | |
2247 pRenderer->_4A6E7E(v9, 0x183u, pPortrait); | |
2248 else | |
2249 pRenderer->DrawTextureTransparent(v9 + 1, 0x184u, pPortrait); | |
2250 auto _v1 = 0; | |
2251 v10 = pPlayer->pPlayerBuffs[14].uExpireTime > 0; | |
2252 if (pPlayer->pPlayerBuffs[1].uExpireTime > 0) | |
2253 _v1 = 1; | |
2254 v11 = pPlayer->pPlayerBuffs[8].uExpireTime > 0; | |
2255 v12 = pPlayer->pPlayerBuffs[7].uExpireTime > 0; | |
2256 v13 = pPlayer->pPlayerBuffs[13].uExpireTime > 0; | |
2257 if ( v13 | v12 | v11 | _v1 | v10 ) | |
2258 sub_441A4E(i); | |
2259 continue; | |
2260 } | |
2261 if (pPlayer->Dead()) | |
2262 { | |
2263 pFace = pTexture_PlayerFaceDead; | |
2264 pPortrait = pFace; | |
2265 v9 = pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i]; | |
2266 if ( pParty->pPartyBuffs[11].uExpireTime ) | |
2267 pRenderer->_4A6E7E(v9, 0x183u, pPortrait); | |
2268 else | |
2269 pRenderer->DrawTextureTransparent(v9 + 1, 0x184u, pPortrait); | |
2270 auto _v1 = 0; | |
2271 v10 = pPlayer->pPlayerBuffs[14].uExpireTime > 0; | |
2272 if (pPlayer->pPlayerBuffs[1].uExpireTime > 0) | |
2273 _v1 = 1; | |
2274 v11 = pPlayer->pPlayerBuffs[8].uExpireTime > 0; | |
2275 v12 = pPlayer->pPlayerBuffs[7].uExpireTime > 0; | |
2276 v13 = pPlayer->pPlayerBuffs[13].uExpireTime > 0; | |
2277 if ( v13 | v12 | v11 | _v1 | v10 ) | |
2278 sub_441A4E(i); | |
2279 continue; | |
2280 } | |
2281 v7 = 0; | |
2282 for (uint j = 0; j < pPlayerFrameTable->uNumFrames; ++j) | |
2283 if (pPlayerFrameTable->pFrames[j].expression == pPlayer->expression) | |
2284 { | |
2285 v7 = j; | |
2286 break; | |
2287 } | |
2288 if ( v7 == 0 ) | |
2289 v7 = 1; | |
2290 if (pPlayer->expression == CHARACTER_EXPRESSION_21) | |
2291 pFrame = pPlayerFrameTable->GetFrameBy_y(&pPlayer->_expression21_frameset, &pPlayer->_expression21_animtime, pMiscTimer->uTimeElapsed); | |
2292 else | |
2293 pFrame = pPlayerFrameTable->GetFrameBy_x(v7, pPlayer->uExpressionTimePassed); | |
2294 if (pPlayer->field_1AA2 != pFrame->uTextureID - 1 || v22 ) | |
2295 { | |
2296 pPlayer->field_1AA2 = pFrame->uTextureID - 1; | |
2297 pFace = (Texture *)pTextures_PlayerFaces[i][pPlayer->field_1AA2];//pFace = (Texture *)pTextures_PlayerFaces[i][pFrame->uTextureID]; | |
2298 pPortrait = pFace; | |
2299 v9 = pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i]; | |
2300 if ( pParty->pPartyBuffs[11].uExpireTime ) | |
2301 pRenderer->_4A6E7E(v9, 0x183u, pPortrait); | |
2302 else | |
2303 pRenderer->DrawTextureTransparent(v9 + 1, 0x184u, pPortrait); | |
2304 auto _v1 = 0; | |
2305 v10 = pPlayer->pPlayerBuffs[14].uExpireTime > 0; | |
2306 if (pPlayer->pPlayerBuffs[1].uExpireTime > 0) | |
2307 _v1 = 1; | |
2308 v11 = pPlayer->pPlayerBuffs[8].uExpireTime > 0; | |
2309 v12 = pPlayer->pPlayerBuffs[7].uExpireTime > 0; | |
2310 v13 = pPlayer->pPlayerBuffs[13].uExpireTime > 0; | |
2311 if ( v13 | v12 | v11 | _v1 | v10 ) | |
2312 sub_441A4E(i); | |
2313 continue; | |
2314 } | |
2315 } | |
2316 if ( pParty->bTurnBasedModeOn == 1 ) | |
2317 { | |
2318 if ( pTurnEngine->field_4 != 1 ) | |
2319 { | |
828
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
809
diff
changeset
|
2320 if (PID_TYPE(pTurnEngine->pQueue[0].uPackedID) == OBJECT_Player) |
706 | 2321 { |
2322 //v14 = 0; | |
2323 if ( pTurnEngine->uActorQueueSize > 0 ) | |
2324 { | |
2325 //v15 = (char *)pTurnEngine->pQueue; | |
2326 for (uint i = 0; i < pTurnEngine->uActorQueueSize; ++i) | |
2327 { | |
2328 auto pElem = pTurnEngine->pQueue + i; | |
2329 | |
828
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
809
diff
changeset
|
2330 if (PID_TYPE(pElem->uPackedID) != OBJECT_Player) |
706 | 2331 break; |
2332 v16 = dword_5079D0; | |
2333 if ( pParty->uFlags & 0x10 ) | |
2334 { | |
2335 v16 = dword_5079CC; | |
2336 } | |
2337 else | |
2338 { | |
2339 if ( pParty->uFlags & 0x20 ) | |
2340 v16 = dword_5079C8; | |
2341 } | |
948 | 2342 pRenderer->DrawTextureTransparent(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[PID_ID(pElem->uPackedID)] - 4, 0x181u, pIcons_LOD->GetTexture(v16)); |
706 | 2343 } |
2344 } | |
2345 } | |
2346 } | |
2347 } | |
2348 else | |
2349 { | |
2350 for (uint i = 0; i < 4; ++i) | |
2351 { | |
2352 auto pPlayer = pParty->pPlayers + i; | |
2353 if (pPlayer->CanAct() && !pPlayer->uTimeToRecovery) | |
2354 { | |
2355 v19 = dword_5079D0; | |
2356 if ( pParty->uFlags & 0x10 ) | |
2357 { | |
2358 v19 = dword_5079CC; | |
2359 } | |
2360 else | |
2361 { | |
2362 if ( pParty->uFlags & 0x20 ) | |
2363 v19 = dword_5079C8; | |
2364 } | |
948 | 2365 pRenderer->DrawTextureTransparent(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] - 4, 0x181u, pIcons_LOD->GetTexture(v19)); |
706 | 2366 } |
2367 } | |
2368 } | |
2369 } | |
2370 | |
709 | 2371 //----- (00441D38) -------------------------------------------------------- |
706 | 2372 void GameUI_DrawMinimap(unsigned int uX, unsigned int uY, unsigned int uZ, unsigned int uW, unsigned int uZoom, unsigned int bRedrawOdmMinimap) |
2373 { | |
2374 int uHeight; // ebx@6 | |
2375 __int16 v11; // cx@11 | |
2376 unsigned int v14; // ebx@23 | |
2377 int v15; // eax@23 | |
2378 __int16 v17; // di@30 | |
2379 double v18; // st7@30 | |
2380 float v19; // ST38_4@30 | |
2381 double v20; // st7@30 | |
2382 double v21; // st6@30 | |
2383 double v22; // st5@33 | |
2384 signed int v27; // eax@37 | |
2385 unsigned __int16 *v28; // ecx@37 | |
2386 signed int v29; // edi@40 | |
2387 //signed int v33; // ebx@50 | |
2388 //unsigned int v34; // eax@50 | |
2389 //signed int v35; // ecx@50 | |
2390 //unsigned __int16 v36; // di@66 | |
2391 int v37; // edi@72 | |
2392 int v38; // ebx@72 | |
2393 __int16 v39; // ax@87 | |
2394 int v40; // edi@91 | |
2395 int v41; // ebx@91 | |
2396 unsigned int v42; // eax@101 | |
2397 unsigned int v43; // ebx@101 | |
2398 unsigned int v44; // ST30_4@101 | |
2399 char *v45; // ebx@106 | |
2400 int v46; // edi@108 | |
2401 int v47; // eax@108 | |
2402 unsigned int v48; // ebx@114 | |
2403 unsigned int v49; // ST64_4@114 | |
709 | 2404 //unsigned int v51; // [sp-10h] [bp-64h]@79 |
706 | 2405 unsigned int v52; // [sp-10h] [bp-64h]@100 |
709 | 2406 //unsigned int v53; // [sp-Ch] [bp-60h]@79 |
706 | 2407 unsigned int v54; // [sp-Ch] [bp-60h]@100 |
709 | 2408 //unsigned int v55; // [sp-8h] [bp-5Ch]@77 |
706 | 2409 unsigned int v56; // [sp-8h] [bp-5Ch]@100 |
2410 //signed int v57; // [sp-4h] [bp-58h]@54 | |
709 | 2411 //unsigned __int16 v58; // [sp-4h] [bp-58h]@77 |
706 | 2412 unsigned __int16 v59; // [sp-4h] [bp-58h]@100 |
995 | 2413 //unsigned __int16 v60; // [sp+10h] [bp-44h]@66 |
2414 //unsigned int v61; // [sp+10h] [bp-44h]@85 | |
2415 //unsigned int v63; // [sp+14h] [bp-40h]@85 | |
2416 //unsigned int v65; // [sp+18h] [bp-3Ch]@85 | |
706 | 2417 unsigned int lPitch; // [sp+20h] [bp-34h]@1 |
2418 unsigned int lPitcha; // [sp+20h] [bp-34h]@23 | |
2419 char *lPitchb; // [sp+20h] [bp-34h]@106 | |
2420 unsigned int v69; // [sp+24h] [bp-30h]@23 | |
2421 signed int v70; // [sp+24h] [bp-30h]@37 | |
995 | 2422 //unsigned __int16 uBlue; // [sp+28h] [bp-2Ch]@1 |
706 | 2423 signed int uBluea; // [sp+28h] [bp-2Ch]@37 |
2424 int v73; // [sp+2Ch] [bp-28h]@30 | |
2425 int v76; // [sp+34h] [bp-20h]@91 | |
2426 int v77; // [sp+34h] [bp-20h]@108 | |
709 | 2427 //int v79; // [sp+38h] [bp-1Ch]@72 |
2428 //char *a2c; // [sp+40h] [bp-14h]@68 | |
706 | 2429 signed int uCenterY; // [sp+48h] [bp-Ch]@1 |
2430 signed int uCenterX; // [sp+4Ch] [bp-8h]@1 | |
2431 signed int uWidth; // [sp+5Ch] [bp+8h]@30 | |
709 | 2432 //signed int uZe; // [sp+5Ch] [bp+8h]@67 |
706 | 2433 signed int uZf; // [sp+5Ch] [bp+8h]@85 |
2434 signed int uZg; // [sp+5Ch] [bp+8h]@105 | |
2435 unsigned int uWa; // [sp+60h] [bp+Ch]@23 | |
2436 float uWb; // [sp+60h] [bp+Ch]@30 | |
2437 unsigned int uWd; // [sp+60h] [bp+Ch]@95 | |
2438 float uZooma; // [sp+64h] [bp+10h]@117 | |
995 | 2439 //unsigned int flagsb; // [sp+68h] [bp+14h]@66 |
706 | 2440 Actor *flagsc; // [sp+68h] [bp+14h]@86 |
995 | 2441 //unsigned int flagsd; // [sp+68h] [bp+14h]@105 |
706 | 2442 |
2443 uCenterX = (uX + uZ) / 2; | |
2444 uCenterY = (uY + uW) / 2; | |
2445 lPitch = pRenderer->uTargetSurfacePitch; | |
995 | 2446 //TargetColor(0, 0, 0); |
2447 //uBlue = TargetColor(0, 0, 0xFFu); | |
706 | 2448 auto bWizardEyeActive = pParty->WizardEyeActive(); |
2449 auto uWizardEyeSkillLevel = pParty->WizardEyeSkillLevel(); | |
2450 if (CheckHiredNPCSpeciality(Cartographer)) | |
2451 { | |
2452 bWizardEyeActive = true; | |
2453 uWizardEyeSkillLevel = 2; | |
2454 } | |
709 | 2455 bWizardEyeActive = true; |
2456 uWizardEyeSkillLevel = 3; | |
2457 pRenderer->SetRasterClipRect(uX, uY, uZ - 1, uW - 1); | |
706 | 2458 uHeight = uW - uY; |
2459 uWidth = uZ - uX; | |
2460 | |
2461 if ( uCurrentlyLoadedLevelType != LEVEL_Indoor) | |
2462 { | |
2463 v17 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uWidthLn2; | |
710 | 2464 auto pMapLod0 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].pLevelOfDetail0_prolly_alpha_mask; |
706 | 2465 auto pPal = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].pPalette16; |
2466 v73 = (1 << (v17 + 16)) / (signed int)uZoom; | |
2467 v18 = (double)(1 << (16 - v17)); | |
2468 v19 = v18; | |
2469 v20 = (double)(pParty->vPosition.x + 32768) / v18; | |
2470 v21 = (double)(32768 - pParty->vPosition.y) / v19; | |
2471 uWb = v21; | |
2472 switch (uZoom) | |
2473 { | |
2474 case 512: | |
2475 { | |
2476 v20 = v20 - (double)(uWidth / 2); | |
2477 v22 = (double)(uHeight / 2); | |
2478 uWb = v21 - v22; | |
2479 } | |
2480 break; | |
2481 | |
2482 case 1024: | |
2483 { | |
2484 v20 = v20 - (double)(uWidth / 4); | |
2485 v22 = (double)(uHeight / 4); | |
2486 uWb = v21 - v22; | |
2487 } | |
2488 break; | |
2489 | |
2490 case 2048: | |
2491 { | |
2492 v20 = v20 - (double)(uWidth / 8); | |
2493 v22 = (double)(uHeight / 8); | |
2494 uWb = v21 - v22; | |
2495 } | |
2496 break; | |
2497 | |
2498 default: assert(false); | |
2499 } | |
2500 assert(sizeof(pOdmMinimap) == 137 * 117 * sizeof(short)); | |
2501 | |
2502 v70 = floorf(v20 * 65536.0 + 0.5f);//LODWORD(v24); | |
2503 uBluea = floorf(uWb * 65536.0 + 0.5f);//LODWORD(v25); | |
2504 v27 = uBluea >> 16; | |
2505 v28 = &pRenderer->pTargetSurface[uX + uY * lPitch]; | |
2506 if (pMapLod0 && bRedrawOdmMinimap) | |
2507 { | |
2508 assert(uWidth == 137 && uHeight == 117); | |
2509 //auto pMinimap = (unsigned __int16 *)pOdmMinimap; | |
2510 | |
2511 auto mapWidth = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uTextureWidth; | |
2512 | |
2513 v29 = v70 >> 16; | |
2514 | |
2515 for (int y = 0; y < uHeight; ++y) | |
2516 { | |
2517 auto pMapLod0Line = &pMapLod0[v27 * mapWidth]; | |
2518 for (int x = 0; x < uWidth; ++x) | |
2519 { | |
2520 //*pMinimap++ = pPal[pMapLod0Line[v29]]; | |
2521 pOdmMinimap[y][x] = pPal[pMapLod0Line[v29]]; | |
2522 v29 = (v70 + x * v73) >> 16; | |
2523 } | |
2524 | |
2525 v29 = v70 >> 16; | |
2526 v28 += 137 - uWidth; | |
2527 uBluea += v73; | |
2528 v27 = uBluea >> 16; | |
2529 } | |
2530 } | |
2531 | |
2532 for (int y = 0; y < 117; ++y) | |
2533 { | |
2534 for (int x = 0; x < 137; ++x) | |
2535 { | |
2536 *v28++ = pOdmMinimap[y][x]; | |
2537 } | |
2538 v28 += lPitch - 137; | |
2539 } | |
2540 uNumBlueFacesInBLVMinimap = 0; | |
2541 } | |
2542 else | |
2543 { | |
2544 pRenderer->FillRectFast(uX, uY, uZ - uX, uHeight, 0xF); | |
2545 uNumBlueFacesInBLVMinimap = 0; | |
2546 | |
2547 for (uint i = 0; i < pIndoor->pMapOutlines->uNumOutlines; ++i) | |
2548 { | |
2549 auto pOutline = &pIndoor->pMapOutlines->pOutlines[i]; | |
2550 | |
2551 auto pFace1 = pIndoor->pFaces + pOutline->uFace1ID; | |
2552 auto pFace2 = pIndoor->pFaces + pOutline->uFace2ID; | |
2553 //v9 = pIndoor->pFaces[pMapVertex->uFace1ID].uAttributes; | |
2554 //v10 = pIndoor->pFaces[pMapVertex->uFace2ID].uAttributes; | |
2555 if (pFace1->Visible() && pFace2->Visible()) | |
2556 { | |
2557 v11 = pOutline->uFlags; | |
2558 if ( v11 & 1 ) | |
2559 goto LABEL_15; | |
1107 | 2560 if (pFace1->uAttributes & 0x80 || pFace2->uAttributes & 0x80) |
706 | 2561 goto LABEL_ABC; |
2562 | |
2563 } | |
2564 continue; | |
2565 | |
2566 LABEL_ABC: | |
2567 pOutline->uFlags = v11 | 1; | |
2568 pIndoor->_visible_outlines[i >> 3] |= 1 << (7 - i % 8); | |
2569 | |
2570 LABEL_15: | |
2571 //v12 = &pIndoor->pFaces[pOutline->uFace1ID]; | |
2572 if (bWizardEyeActive && uWizardEyeSkillLevel >= 3 && | |
1062 | 2573 (pFace1->uAttributes & 0x2000 || pFace2->uAttributes & 0x2000) && |
706 | 2574 (pIndoor->pFaceExtras[pFace1->uFaceExtraID].uEventID || pIndoor->pFaceExtras[pFace2->uFaceExtraID].uEventID)) |
2575 { | |
2576 if (uNumBlueFacesInBLVMinimap < 49) | |
2577 pBlueFacesInBLVMinimapIDs[uNumBlueFacesInBLVMinimap++] = i; | |
2578 } | |
2579 else | |
2580 { | |
2581 auto _a = (uZoom * (signed __int64)pIndoor->pVertices[pOutline->uVertex1ID].x); | |
2582 auto _b = ((unsigned int)((unsigned __int64)_a >> 16) << 16); | |
2583 auto _c = ((signed int)(_b - uZoom * pParty->vPosition.x) >> 16); | |
2584 v69 = uCenterX + _c; | |
2585 v69 = uCenterX + ((signed int)(((unsigned int)((unsigned __int64)(uZoom * (signed __int64)pIndoor->pVertices[pOutline->uVertex1ID].x) >> 16) << 16) - uZoom * pParty->vPosition.x) >> 16); | |
2586 lPitcha = uCenterY - ((signed int)(((unsigned int)((unsigned __int64)(uZoom * (signed __int64)pIndoor->pVertices[pOutline->uVertex1ID].y) >> 16) << 16) - uZoom * pParty->vPosition.y) >> 16); | |
2587 uWa = uCenterX + ((signed int)(((unsigned int)((unsigned __int64)(uZoom * (signed __int64)pIndoor->pVertices[pOutline->uVertex2ID].x) >> 16) << 16) - uZoom * pParty->vPosition.x) >> 16); | |
2588 v14 = uCenterY - ((signed int)(((unsigned int)((unsigned __int64)(uZoom * (signed __int64)pIndoor->pVertices[pOutline->uVertex2ID].y) >> 16) << 16) - uZoom * pParty->vPosition.y) >> 16); | |
2589 v15 = abs(pOutline->sZ - pParty->vPosition.z) / 8; | |
2590 if ( v15 > 100 ) | |
2591 v15 = 100; | |
709 | 2592 pRenderer->RasterLine2D(v69, lPitcha, uWa, v14, viewparams->pPalette[-v15 + 200]); |
706 | 2593 } |
2594 } | |
2595 | |
2596 | |
2597 for (uint i = 0; i < uNumBlueFacesInBLVMinimap; ++i) | |
2598 { | |
2599 //v16 = (uint *)&pIndoor->pMapOutlines->pOutlines[pBlueFacesInBLVMinimapIDs[uZb]]; | |
2600 auto pOutline = &pIndoor->pMapOutlines->pOutlines[pBlueFacesInBLVMinimapIDs[i]]; | |
709 | 2601 pRenderer->RasterLine2D(uCenterX + ((signed int)(((unsigned int)((unsigned __int64)((signed int)uZoom |
706 | 2602 * (signed __int64)pIndoor->pVertices[pOutline->uVertex1ID].x) >> 16) << 16) |
2603 - uZoom * pParty->vPosition.x) >> 16), | |
2604 uCenterY | |
2605 - ((signed int)(((unsigned int)((unsigned __int64)((signed int)uZoom | |
2606 * (signed __int64)pIndoor->pVertices[pOutline->uVertex1ID].y) >> 16) << 16) | |
2607 - uZoom * pParty->vPosition.y) >> 16), | |
2608 uCenterX | |
2609 + ((signed int)(((unsigned int)((unsigned __int64)((signed int)uZoom | |
2610 * (signed __int64)pIndoor->pVertices[pOutline->uVertex2ID].x) >> 16) << 16) | |
2611 - uZoom * pParty->vPosition.x) >> 16), | |
2612 uCenterY | |
2613 - ((signed int)(((unsigned int)((unsigned __int64)((signed int)uZoom | |
2614 * (signed __int64)pIndoor->pVertices[pOutline->uVertex2ID].y) >> 16) << 16) | |
2615 - uZoom * pParty->vPosition.y) >> 16), | |
995 | 2616 ui_game_minimap_outline_color); |
706 | 2617 } |
2618 } | |
2619 | |
2620 | |
2621 assert(pParty->sRotationY >= 0); | |
2622 float angle = (pParty->sRotationY % 2048) / 2048.0f; | |
2623 const float two_pi = 2.0f * 3.14159f; | |
2624 | |
2625 uint arrow_idx = floorf(0.5f + 7 * angle); | |
2626 pRenderer->DrawTextureTransparent(uCenterX - 3, uCenterY - 3, pIcons_LOD->GetTexture(pTextureIDs_pMapDirs[arrow_idx])); | |
2627 | |
995 | 2628 //flagsb = TargetColor(0, 0, 255); |
2629 //v60 = TargetColor(255, 0, 0); | |
706 | 2630 if (bWizardEyeActive) |
2631 { | |
709 | 2632 //uZe = 0; |
2633 if (uWizardEyeSkillLevel >= 2) | |
2634 for (uint i = 0; i < uNumSpriteObjects; ++i) | |
2635 //if (uNumSpriteObjects > 0) | |
2636 { | |
2637 auto object = pSpriteObjects + i; | |
2638 | |
2639 //a2c = (char *)&pSpriteObjects[0].uObjectDescID; | |
2640 //while ( 1 ) | |
2641 //{ | |
2642 if (!object->uType || !object->uObjectDescID) | |
2643 continue; | |
2644 //if (uWizardEyeSkillLevel == 1 | |
2645 v37 = uCenterX + ((unsigned __int64)((object->vPosition.x - pParty->vPosition.x) * (signed __int64)uZoom) >> 16); | |
2646 //v79 = (unsigned __int64)((object->vPosition.y - pParty->vPosition.y) * (signed __int64)(signed int)uZoom) >> 16; | |
2647 //v38 = uCenterY - v79; | |
2648 v38 = uCenterY - ((signed __int64)((object->vPosition.y - pParty->vPosition.y) * (signed __int64)uZoom) >> 16); | |
2649 if (v37 < pRenderer->raster_clip_x || v37 > pRenderer->raster_clip_z || | |
2650 v38 < pRenderer->raster_clip_y || v38 > pRenderer->raster_clip_w) | |
2651 continue; | |
2652 | |
2653 assert(uZoom >= 512); | |
2654 if (pObjectList->pObjects[object->uObjectDescID].uFlags & OBJECT_DESC_UNPICKABLE) | |
706 | 2655 { |
995 | 2656 pRenderer->RasterLine2D(v37, v38, v37, v38, ui_game_minimap_projectile_color); |
709 | 2657 } |
2658 else if (uZoom > 512) | |
2659 { | |
995 | 2660 pRenderer->RasterLine2D(v37 - 1, v38 - 1, v37 - 1, v38 + 1, ui_game_minimap_treasure_color); |
2661 pRenderer->RasterLine2D(v37, v38 - 2, v37, v38 + 1, ui_game_minimap_treasure_color); | |
2662 pRenderer->RasterLine2D(v37 + 1, v38 - 1, v37 + 1, v38 + 1, ui_game_minimap_treasure_color); | |
2663 pRenderer->RasterLine2D(v37 - 2, v38, v37 - 2, v38 + 1, ui_game_minimap_treasure_color); | |
709 | 2664 pRenderer->RasterLine2D(v37 + 2, v38, |
995 | 2665 v37 + 2, v38 + 1, ui_game_minimap_treasure_color); |
706 | 2666 } |
709 | 2667 else |
2668 { | |
2669 pRenderer->RasterLine2D(v37 - 1, v38 - 1, | |
995 | 2670 v37 - 1, v38, ui_game_minimap_treasure_color); |
709 | 2671 pRenderer->RasterLine2D(v37, v38 - 1, |
995 | 2672 v37, v38, ui_game_minimap_treasure_color); |
709 | 2673 } |
2674 //LABEL_82: | |
2675 //LABEL_83: | |
2676 //++uZe; | |
2677 //a2c += 112; | |
2678 //if ( uZe >= (signed int)uNumSpriteObjects ) | |
2679 //{ | |
2680 //goto LABEL_85; | |
2681 //} | |
2682 //} | |
706 | 2683 } |
709 | 2684 |
2685 | |
706 | 2686 LABEL_85: |
995 | 2687 //v63 = TargetColor(255, 0, 0); |
2688 //v61 = TargetColor(0, 255, 0); | |
2689 //v65 = TargetColor(255, 255, 0); | |
706 | 2690 uZf = 0; |
2691 if ( (signed int)uNumActors > 0 ) | |
2692 { | |
2693 flagsc = pActors;//[0].uAIState; | |
2694 do | |
2695 { | |
2696 v39 = flagsc->uAIState; | |
2697 if ( flagsc->uAIState != 11 && v39 != 19 && (v39 == 5 || BYTE1(flagsc->uAttributes) & 0x80) ) | |
2698 { | |
2699 v40 = ((unsigned __int64)(( flagsc->vPosition.x - pParty->vPosition.x) | |
2700 * (signed __int64)(signed int)uZoom) >> 16) | |
2701 + uCenterX; | |
2702 v76 = (unsigned __int64)(( flagsc->vPosition.y - pParty->vPosition.y) | |
2703 * (signed __int64)(signed int)uZoom) >> 16; | |
2704 v41 = uCenterY - v76; | |
709 | 2705 if ( v40 >= pRenderer->raster_clip_x ) |
706 | 2706 { |
709 | 2707 if ( v40 <= pRenderer->raster_clip_z && v41 >= pRenderer->raster_clip_y && v41 <= pRenderer->raster_clip_w ) |
706 | 2708 { |
995 | 2709 uWd = ui_game_minimap_actor_friendly_color; |
706 | 2710 if ( BYTE3(flagsc->uAttributes) & 1 ) |
995 | 2711 uWd = ui_game_minimap_actor_hostile_color; |
2712 if ( flagsc->uAIState == Dead) | |
2713 uWd = ui_game_minimap_actor_corpse_color; | |
706 | 2714 if ( (signed int)uZoom > 1024 ) |
2715 { | |
709 | 2716 pRenderer->RasterLine2D(v40 - 1, v41 - 2, v40 - 1, v41 + 2, uWd); |
2717 pRenderer->RasterLine2D(v40, v41 - 2, v40, v41 + 2, uWd); | |
2718 pRenderer->RasterLine2D(v40 + 1, v41 - 2, v40 + 1, v41 + 2, uWd); | |
706 | 2719 v42 = v41 + 1; |
2720 v43 = v41 - 1; | |
2721 v44 = v42; | |
709 | 2722 pRenderer->RasterLine2D(v40 - 2, v43, v40 - 2, v42, uWd); |
706 | 2723 v40 += 2; |
2724 v59 = uWd; | |
2725 v56 = v44; | |
2726 v54 = v40; | |
2727 v52 = v43; | |
2728 } | |
2729 else | |
2730 { | |
709 | 2731 pRenderer->RasterLine2D(v40 - 1, v41 - 1, v40 - 1, uCenterY - v76, uWd); |
706 | 2732 v59 = uWd; |
2733 v56 = uCenterY - v76; | |
2734 v54 = v40; | |
2735 v52 = v41 - 1; | |
2736 } | |
709 | 2737 pRenderer->RasterLine2D(v40, v52, v54, v56, v59); |
706 | 2738 } |
2739 } | |
2740 } | |
2741 ++uZf; | |
2742 ++flagsc; | |
2743 } | |
2744 while ( uZf < (signed int)uNumActors ); | |
2745 } | |
2746 } | |
709 | 2747 |
2748 | |
995 | 2749 //flagsd = TargetColor(255, 255, 255); |
706 | 2750 uZg = 0; |
2751 if ( (signed int)uNumLevelDecorations > 0 ) | |
2752 { | |
2753 v45 = (char *)&pLevelDecorations[0].vPosition; | |
2754 lPitchb = (char *)&pLevelDecorations[0].vPosition; | |
2755 do | |
2756 { | |
2757 if ( *(v45 - 2) & 8 ) | |
2758 { | |
2759 v46 = ((unsigned __int64)((*(int *)v45 - pParty->vPosition.x) * (signed __int64)(signed int)uZoom) >> 16) | |
2760 + uCenterX; | |
2761 v77 = (unsigned __int64)((*((int *)v45 + 1) - pParty->vPosition.y) * (signed __int64)(signed int)uZoom) >> 16; | |
2762 v47 = uCenterY - v77; | |
709 | 2763 if ( v46 >= pRenderer->raster_clip_x ) |
706 | 2764 { |
709 | 2765 if ( v46 <= pRenderer->raster_clip_z && v47 >= pRenderer->raster_clip_y && v47 <= pRenderer->raster_clip_w ) |
706 | 2766 { |
2767 if ( (signed int)uZoom > 512 ) | |
2768 { | |
2769 v48 = v47 + 1; | |
2770 v49 = v47 - 1; | |
995 | 2771 pRenderer->RasterLine2D(v46 - 1, v47 - 1, v46 - 1, v47 + 1, ui_game_minimap_decoration_color_1); |
2772 pRenderer->RasterLine2D(v46, v49, v46, v48, ui_game_minimap_decoration_color_1); | |
2773 pRenderer->RasterLine2D(v46 + 1, v49, v46 + 1, v48, ui_game_minimap_decoration_color_1); | |
706 | 2774 v45 = lPitchb; |
2775 } | |
2776 else | |
2777 { | |
995 | 2778 pRenderer->RasterLine2D(v46, uCenterY - v77, v46, uCenterY - v77, ui_game_minimap_decoration_color_1); |
706 | 2779 } |
2780 } | |
2781 } | |
2782 } | |
2783 ++uZg; | |
2784 v45 += 32; | |
2785 lPitchb = v45; | |
2786 } | |
2787 while ( uZg < (signed int)uNumLevelDecorations ); | |
2788 } | |
948 | 2789 pRenderer->DrawTextureTransparent(0x1D4u, 0, pIcons_LOD->GetTexture(dword_5079D8)); |
706 | 2790 uZooma = (double)pParty->sRotationY * 0.1171875; |
2791 //v50 = uZooma + 6.7553994e15; | |
727 | 2792 pRenderer->SetTextureClipRect(541, 0, 567, 480); |
948 | 2793 pRenderer->DrawTextureIndexed(floorf(uZooma + 0.5f) + 285, 136, pIcons_LOD->GetTexture(dword_5079B4)); |
727 | 2794 pRenderer->ResetTextureClipRect(); |
706 | 2795 } |
2796 | |
2797 //----- (00441498) -------------------------------------------------------- | |
2798 void __cdecl GameUI_DrawTorchlightAndWizardEye() | |
2799 { | |
2800 if (pCurrentScreen == SCREEN_GAME | |
2801 || pCurrentScreen == SCREEN_MENU | |
2802 || pCurrentScreen == SCREEN_OPTIONS | |
2803 || pCurrentScreen == SCREEN_REST | |
2804 || pCurrentScreen == SCREEN_SPELL_BOOK | |
2805 || pCurrentScreen == SCREEN_CHEST | |
2806 || pCurrentScreen == SCREEN_SAVEGAME | |
2807 || pCurrentScreen == SCREEN_LOADGAME | |
987 | 2808 || pCurrentScreen == SCREEN_CHEST_INVENTORY |
706 | 2809 || pCurrentScreen == SCREEN_BOOKS |
2810 || pCurrentScreen == SCREEN_BRANCHLESS_NPC_DIALOG ) | |
2811 { | |
2812 if (pParty->TorchlightActive()) | |
2813 { | |
2814 auto icon = pIconsFrameTable->GetFrame((signed __int16)pUIAnum_Torchlight->uIconID, pEventTimer->Time()); | |
2815 pRenderer->DrawTextureTransparent(pUIAnum_Torchlight->x, pUIAnum_Torchlight->y, pIcons_LOD->GetTexture(icon->uTextureID)); | |
2816 } | |
2817 if (pParty->WizardEyeActive()) | |
2818 { | |
2819 auto icon = pIconsFrameTable->GetFrame((signed __int16)pUIAnim_WizardEye->uIconID, pEventTimer->Time()); | |
2820 pRenderer->DrawTextureTransparent(pUIAnim_WizardEye->x, pUIAnim_WizardEye->y, pIcons_LOD->GetTexture(icon->uTextureID)); | |
2821 } | |
2822 } | |
2823 } | |
2824 // 4E28F8: using guessed type int pCurrentScreen; | |
2825 | |
2826 | |
2827 //----- (00491F87) -------------------------------------------------------- | |
994 | 2828 void GameUI_DrawHiredNPCs() |
706 | 2829 { |
2830 //int v6; // eax@15 | |
2831 char v7; // al@17 | |
2832 unsigned int v8; // eax@18 | |
2833 int v9; // esi@18 | |
2834 int v10; // eax@18 | |
2835 unsigned int v11; // eax@19 | |
2836 unsigned int v12; // esi@19 | |
2837 unsigned int v13; // eax@23 | |
2838 IconFrame *v14; // eax@24 | |
2839 unsigned int v15; // eax@26 | |
2840 char pContainer[20]; // [sp+Ch] [bp-30h]@18 | |
2841 unsigned int v17; // [sp+20h] [bp-1Ch]@19 | |
2842 signed int uFrameID; // [sp+24h] [bp-18h]@19 | |
2843 //int i; // [sp+28h] [bp-14h]@15 | |
2844 unsigned int v20; // [sp+2Ch] [bp-10h]@20 | |
2845 unsigned int v21; // [sp+30h] [bp-Ch]@19 | |
2846 int v22; // [sp+34h] [bp-8h]@2 | |
2847 unsigned __int8 v23; // [sp+3Bh] [bp-1h]@2 | |
2848 | |
2849 if ( bNoNPCHiring != 1 ) | |
2850 { | |
2851 v23 = 0; | |
2852 v22 = 0; | |
2853 /*for (uint i = 0; i < 2; ++i) | |
2854 { | |
2855 if (pParty->pHirelings[i].pName) | |
2856 pTmpBuf[v22++] = i; | |
2857 }*/ | |
2858 if (pParty->pHirelings[0].pName) | |
2859 pTmpBuf[v22++] = 0; | |
2860 if (pParty->pHirelings[1].pName) | |
2861 pTmpBuf[v22++] = 1; | |
2862 | |
2863 for (uint i = 0; i < pNPCStats->uNumNewNPCs; ++i) | |
2864 { | |
2865 if (pNPCStats->pNewNPCData[i].uFlags & 128) | |
2866 { | |
2867 if (!pParty->pHirelings[0].pName || strcmp(pNPCStats->pNewNPCData[i].pName, pParty->pHirelings[0].pName)) | |
2868 { | |
2869 if (!pParty->pHirelings[1].pName || strcmp(pNPCStats->pNewNPCData[i].pName, pParty->pHirelings[1].pName)) | |
2870 pTmpBuf[v22++] = i + 2; | |
2871 } | |
2872 } | |
2873 } | |
2874 | |
2875 //v6 = (unsigned __int8)pParty->field_709; | |
2876 for ( int i = (unsigned __int8)pParty->field_709; i < v22 && v23 < 2; i++ ) | |
2877 { | |
2878 v7 = pTmpBuf[i]; | |
2879 if ( (unsigned __int8)v7 >= 2 ) | |
2880 { | |
2881 sprintf(pContainer, "NPC%03d", pNPCStats->pNPCData[(unsigned __int8)v7 + 499].uPortraitID); | |
2882 v15 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); | |
948 | 2883 pRenderer->DrawTextureIndexed(pHiredNPCsIconsOffsetsX[v23], pHiredNPCsIconsOffsetsY[v23], pIcons_LOD->GetTexture(v15)); |
706 | 2884 } |
2885 else | |
2886 { | |
2887 sprintf(pContainer, "NPC%03d", pParty->pHirelings[(unsigned __int8)v7].uPortraitID); | |
2888 v8 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); | |
2889 v9 = v23; | |
948 | 2890 pRenderer->DrawTextureIndexed(pHiredNPCsIconsOffsetsX[v9], pHiredNPCsIconsOffsetsY[v9], pIcons_LOD->GetTexture(v8)); |
706 | 2891 v10 = (unsigned __int8)pTmpBuf[i]; |
2892 if ( pParty->pHirelings[v10].evt_A == 1 ) | |
2893 { | |
2894 uFrameID = pParty->pHirelings[v10].evt_B; | |
2895 v11 = pHiredNPCsIconsOffsetsX[v9]; | |
2896 v12 = pHiredNPCsIconsOffsetsY[v9]; | |
2897 v17 = v11; | |
2898 v21 = 0; | |
2899 if ( (signed int)pIconsFrameTable->uNumIcons <= 0 ) | |
2900 { | |
2901 LABEL_23: | |
2902 v13 = 0; | |
2903 } | |
2904 else | |
2905 { | |
2906 v20 = 0; | |
1104 | 2907 while ( _stricmp("spell96", pIconsFrameTable->pIcons[v20 / 0x20].pAnimationName) ) |
706 | 2908 { |
2909 ++v21; | |
2910 v20 += 32; | |
2911 if ( (signed int)v21 >= (signed int)pIconsFrameTable->uNumIcons ) | |
2912 goto LABEL_23; | |
2913 } | |
2914 v13 = v21; | |
2915 } | |
2916 v14 = pIconsFrameTable->GetFrame(v13, uFrameID); | |
2917 pRenderer->DrawTextureTransparent(v17, v12, &pIcons_LOD->pTextures[v14->uTextureID]); | |
2918 } | |
2919 } | |
2920 ++v23; | |
2921 } | |
2922 } | |
2923 } | |
2924 // 6BE3C5: using guessed type char bNoNPCHiring; | |
2925 |