Mercurial > mm7
comparison UI/UiGame.cpp @ 1506:c76c0f6974bc
Слияние
author | Ritor1 |
---|---|
date | Mon, 02 Sep 2013 12:03:40 +0600 |
parents | 6306a33af531 5e601a07010d |
children | a109bb203e28 |
comparison
equal
deleted
inserted
replaced
1505:6306a33af531 | 1506:c76c0f6974bc |
---|---|
33 #include "..\texts.h" | 33 #include "..\texts.h" |
34 #include "UIHouses.h" | 34 #include "UIHouses.h" |
35 #include "..\BSPModel.h" | 35 #include "..\BSPModel.h" |
36 | 36 |
37 | 37 |
38 | |
39 | |
40 | |
41 int uTextureID_GameUI_CharSelectionFrame; // 50C98C | 38 int uTextureID_GameUI_CharSelectionFrame; // 50C98C |
42 | |
43 | |
44 | |
45 | |
46 | 39 |
47 //----- (00421D00) -------------------------------------------------------- | 40 //----- (00421D00) -------------------------------------------------------- |
48 void __fastcall GameUI_OnPlayerPortraitLeftClick(unsigned int uPlayerID) | 41 void __fastcall GameUI_OnPlayerPortraitLeftClick(unsigned int uPlayerID) |
49 { | 42 { |
50 //unsigned int v1; // esi@1 | |
51 //int v2; // eax@2 | |
52 //Player *v3; // ecx@2 | |
53 //Player *v4; // ecx@5 | |
54 unsigned int v5; // [sp-4h] [bp-10h]@21 | |
55 | |
56 //v1 = uPlayerID; | |
57 auto player = &pParty->pPlayers[uPlayerID - 1]; | 43 auto player = &pParty->pPlayers[uPlayerID - 1]; |
58 if (pParty->pPickedItem.uItemID) | 44 if (pParty->pPickedItem.uItemID) |
59 { | 45 { |
60 //v3 = player; | |
61 if (auto slot = player->AddItem(-1, pParty->pPickedItem.uItemID)) | 46 if (auto slot = player->AddItem(-1, pParty->pPickedItem.uItemID)) |
62 { | 47 { |
63 memcpy(&player->pInventoryItemList[slot-1], &pParty->pPickedItem, 0x24u); | 48 memcpy(&player->pInventoryItemList[slot-1], &pParty->pPickedItem, 0x24u); |
64 viewparams->bRedrawGameUI = true; | 49 viewparams->bRedrawGameUI = true; |
65 pMouse->RemoveHoldingItem(); | 50 pMouse->RemoveHoldingItem(); |
68 | 53 |
69 if (!player->CanAct()) | 54 if (!player->CanAct()) |
70 { | 55 { |
71 player = pPlayers[uActiveCharacter]; | 56 player = pPlayers[uActiveCharacter]; |
72 } | 57 } |
73 if(player->CanAct() || !pPlayers[uActiveCharacter]->CanAct()) | 58 if( player->CanAct() || !pPlayers[uActiveCharacter]->CanAct() ) |
74 player->PlaySound(SPEECH_NoRoom, 0); | 59 player->PlaySound(SPEECH_NoRoom, 0); |
75 } | 60 } |
76 | 61 |
77 //LABEL_9: | |
78 if (pCurrentScreen == SCREEN_GAME) | 62 if (pCurrentScreen == SCREEN_GAME) |
79 { | 63 { |
80 viewparams->bRedrawGameUI = true; | 64 viewparams->bRedrawGameUI = true; |
81 if ( uActiveCharacter != uPlayerID ) | 65 if ( uActiveCharacter != uPlayerID ) |
82 //goto LABEL_27; | |
83 { | 66 { |
84 if ( pPlayers[uPlayerID]->uTimeToRecovery ) | 67 if ( pPlayers[uPlayerID]->uTimeToRecovery ) |
85 return; | 68 return; |
86 | 69 |
87 uActiveCharacter = uPlayerID; | 70 uActiveCharacter = uPlayerID; |
88 return; | 71 return; |
89 } | 72 } |
90 v5 = 7; | 73 pGUIWindow_CurrentMenu = CharacterUI_Initialize(7); |
91 //LABEL_22: | |
92 pGUIWindow_CurrentMenu = CharacterUI_Initialize(v5); | |
93 return; | 74 return; |
94 } | 75 } |
95 if ( pCurrentScreen == SCREEN_SPELL_BOOK ) | 76 if ( pCurrentScreen == SCREEN_SPELL_BOOK ) |
96 return; | 77 return; |
97 if ( pCurrentScreen == SCREEN_CHEST ) | 78 if ( pCurrentScreen == SCREEN_CHEST ) |
98 { | 79 { |
99 //LABEL_23: | |
100 viewparams->bRedrawGameUI = true; | 80 viewparams->bRedrawGameUI = true; |
101 if ( uActiveCharacter == uPlayerID ) | 81 if ( uActiveCharacter == uPlayerID ) |
102 { | 82 { |
103 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 103; | 83 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 103; |
104 pCurrentScreen = SCREEN_CHEST_INVENTORY; | 84 pCurrentScreen = SCREEN_CHEST_INVENTORY; |
105 //goto LABEL_28; | |
106 uActiveCharacter = uPlayerID; | 85 uActiveCharacter = uPlayerID; |
107 return; | 86 return; |
108 } | 87 } |
109 //LABEL_27: | |
110 if ( pPlayers[uPlayerID]->uTimeToRecovery ) | 88 if ( pPlayers[uPlayerID]->uTimeToRecovery ) |
111 return; | 89 return; |
112 //goto LABEL_28; | |
113 uActiveCharacter = uPlayerID; | 90 uActiveCharacter = uPlayerID; |
114 return; | 91 return; |
115 } | 92 } |
116 if ( pCurrentScreen != SCREEN_HOUSE ) | 93 if ( pCurrentScreen != SCREEN_HOUSE ) |
117 { | 94 { |
118 if ( pCurrentScreen == SCREEN_E ) | 95 if ( pCurrentScreen == SCREEN_E ) |
119 { | 96 { |
120 //LABEL_28: | |
121 uActiveCharacter = uPlayerID; | 97 uActiveCharacter = uPlayerID; |
122 return; | 98 return; |
123 } | 99 } |
124 if ( pCurrentScreen != SCREEN_CHEST_INVENTORY ) | 100 if ( pCurrentScreen != SCREEN_CHEST_INVENTORY ) |
125 { | 101 { |
127 uActiveCharacter = uPlayerID; | 103 uActiveCharacter = uPlayerID; |
128 if ( pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] == 102 ) | 104 if ( pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] == 102 ) |
129 FillAwardsData(); | 105 FillAwardsData(); |
130 return; | 106 return; |
131 } | 107 } |
132 //goto LABEL_23; | |
133 viewparams->bRedrawGameUI = true; | 108 viewparams->bRedrawGameUI = true; |
134 if ( uActiveCharacter == uPlayerID ) | 109 if ( uActiveCharacter == uPlayerID ) |
135 { | 110 { |
136 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 103; | 111 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 103; |
137 pCurrentScreen = SCREEN_CHEST_INVENTORY; | 112 pCurrentScreen = SCREEN_CHEST_INVENTORY; |
138 //goto LABEL_28; | |
139 uActiveCharacter = uPlayerID; | 113 uActiveCharacter = uPlayerID; |
140 return; | 114 return; |
141 } | 115 } |
142 //LABEL_27: | |
143 if ( pPlayers[uPlayerID]->uTimeToRecovery ) | 116 if ( pPlayers[uPlayerID]->uTimeToRecovery ) |
144 return; | 117 return; |
145 //goto LABEL_28; | |
146 uActiveCharacter = uPlayerID; | 118 uActiveCharacter = uPlayerID; |
147 return; | 119 return; |
148 } | 120 } |
149 if ( window_SpeakInHouse->receives_keyboard_input_2 == WINDOW_INPUT_IN_PROGRESS) | 121 if ( window_SpeakInHouse->receives_keyboard_input_2 == WINDOW_INPUT_IN_PROGRESS) |
150 return; | 122 return; |
151 viewparams->bRedrawGameUI = true; | 123 viewparams->bRedrawGameUI = true; |
152 if ( uActiveCharacter != uPlayerID ) | 124 if ( uActiveCharacter != uPlayerID ) |
153 //goto LABEL_28; | |
154 uActiveCharacter = uPlayerID; | 125 uActiveCharacter = uPlayerID; |
155 return; | 126 return; |
156 if (dialog_menu_id == HOUSE_DIALOGUE_SHOP_BUY_STANDARD || dialog_menu_id == HOUSE_DIALOGUE_SHOP_6) | 127 if (dialog_menu_id == HOUSE_DIALOGUE_SHOP_BUY_STANDARD || dialog_menu_id == HOUSE_DIALOGUE_SHOP_6) |
157 { | 128 { |
158 __debugbreak(); // fix indexing | 129 __debugbreak(); // fix indexing |
159 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 103; | 130 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 103; |
160 v5 = 14; | 131 pGUIWindow_CurrentMenu = CharacterUI_Initialize(14); |
161 //goto LABEL_22; | |
162 pGUIWindow_CurrentMenu = CharacterUI_Initialize(v5); | |
163 return; | 132 return; |
164 } | 133 } |
165 } | 134 } |
166 // 4E28F8: using guessed type int pCurrentScreen; | 135 // 4E28F8: using guessed type int pCurrentScreen; |
167 // F8B19C: using guessed type int dword_F8B19C; | 136 // F8B19C: using guessed type int dword_F8B19C; |
168 | 137 |
169 //----- (00416B01) -------------------------------------------------------- | 138 //----- (00416B01) -------------------------------------------------------- |
170 void GameUI_DrawNPCPopup(void *_this)//PopupWindowForBenefitAndJoinText | 139 void GameUI_DrawNPCPopup(void *_this)//PopupWindowForBenefitAndJoinText |
171 { | 140 { |
172 int v1; // edi@2 | 141 int v1; // edi@2 |
173 int v2; // ecx@2 | 142 NPCData *pNPC; // eax@16 |
174 NPCData *v3; // eax@2 | 143 const CHAR *pText; // eax@18 |
175 NPCData *v4; // esi@7 | |
176 NPCData *v5; // eax@16 | |
177 NPCData *v6; // esi@16 | |
178 const CHAR *v7; // eax@18 | |
179 unsigned int v8; // eax@25 | |
180 unsigned int v9; // eax@25 | |
181 const char *v10; // ST14_4@26 | |
182 char *v11; // esi@26 | 144 char *v11; // esi@26 |
183 const char *v12; // ST18_4@27 | 145 GUIWindow popup_window; // [sp+Ch] [bp-60h]@23 |
184 unsigned __int16 v13; // ax@28 | |
185 char *v14; // eax@28 | |
186 GUIWindow a1; // [sp+Ch] [bp-60h]@23 | |
187 int a2; // [sp+60h] [bp-Ch]@16 | 146 int a2; // [sp+60h] [bp-Ch]@16 |
188 void *v17; // [sp+64h] [bp-8h]@1 | |
189 LPCSTR lpsz; // [sp+68h] [bp-4h]@6 | 147 LPCSTR lpsz; // [sp+68h] [bp-4h]@6 |
190 | 148 |
191 v17 = _this; | |
192 if ( bNoNPCHiring != 1 ) | 149 if ( bNoNPCHiring != 1 ) |
193 { | 150 { |
194 v1 = 0; | 151 v1 = 0; |
195 v2 = 0; | |
196 v3 = pParty->pHirelings; | |
197 /*do | 152 /*do |
198 { | 153 { |
199 if ( v3->pName ) | 154 if ( v3->pName ) |
200 pTmpBuf[v1++] = v2; | 155 pTmpBuf[v1++] = v2; |
201 ++v3; | 156 ++v3; |
231 pTmpBuf[v1++] = i + 2; | 186 pTmpBuf[v1++] = i + 2; |
232 } | 187 } |
233 } | 188 } |
234 } | 189 } |
235 } | 190 } |
236 if ( (signed int)((char *)v17 + (unsigned __int8)pParty->field_709) < v1 ) | 191 if ( (signed int)((char *)_this + (unsigned __int8)pParty->field_709) < v1 ) |
237 { | 192 { |
238 sDialogue_SpeakingActorNPC_ID = -1 - (unsigned __int8)pParty->field_709 - (int)v17; | 193 sDialogue_SpeakingActorNPC_ID = -1 - (unsigned __int8)pParty->field_709 - (int)_this; |
239 v5 = GetNewNPCData(sDialogue_SpeakingActorNPC_ID, &a2); | 194 pNPC = GetNewNPCData(sDialogue_SpeakingActorNPC_ID, &a2); |
240 v6 = v5; | 195 if ( pNPC ) |
241 if ( v5 ) | |
242 { | 196 { |
243 if ( a2 == 57 ) | 197 if ( a2 == 57 ) |
244 v7 = pNPCTopics[512].pText; // Baby dragon | 198 pText = pNPCTopics[512].pText; // Baby dragon |
245 else | 199 else |
246 v7 = (const CHAR *)pNPCStats->pProfessions[v5->uProfession].pBenefits; | 200 pText = (const CHAR *)pNPCStats->pProfessions[pNPC->uProfession].pBenefits; |
247 lpsz = v7; | 201 lpsz = pText; |
248 if ( !v7 ) | 202 if ( !pText ) |
249 { | 203 { |
250 lpsz = (LPCSTR)pNPCStats->pProfessions[v5->uProfession].pJoinText; | 204 lpsz = (LPCSTR)pNPCStats->pProfessions[pNPC->uProfession].pJoinText; |
251 if ( !lpsz ) | 205 if ( !lpsz ) |
252 lpsz = ""; | 206 lpsz = ""; |
253 } | 207 } |
254 a1.Hint = 0; | 208 popup_window.Hint = 0; |
255 a1.uFrameX = 38; | 209 popup_window.uFrameX = 38; |
256 a1.uFrameY = 60; | 210 popup_window.uFrameY = 60; |
257 a1.uFrameWidth = 276; | 211 popup_window.uFrameWidth = 276; |
258 a1.uFrameZ = 313; | 212 popup_window.uFrameZ = 313; |
259 a1.uFrameHeight = pFontArrus->CalcTextHeight(lpsz, &a1, 0, 0) | 213 popup_window.uFrameHeight = pFontArrus->CalcTextHeight(lpsz, &popup_window, 0, 0) + 2 * LOBYTE(pFontArrus->uFontHeight) + 24; |
260 + 2 * LOBYTE(pFontArrus->uFontHeight) | 214 if ( (signed int)popup_window.uFrameHeight < 130 ) |
261 + 24; | 215 popup_window.uFrameHeight = 130; |
262 if ( (signed int)a1.uFrameHeight < 130 ) | 216 popup_window.uFrameWidth = 400; |
263 a1.uFrameHeight = 130; | 217 popup_window.uFrameZ = popup_window.uFrameX + 399; |
264 a1.uFrameWidth = 400; | 218 popup_window.DrawMessageBox(0); |
265 a1.uFrameZ = a1.uFrameX + 399; | 219 sprintfex(pTmpBuf2.data(), "NPC%03d", pNPC->uPortraitID); |
266 a1.DrawMessageBox(0); | 220 pRenderer->DrawTextureIndexed(popup_window.uFrameX + 22, popup_window.uFrameY + 36, |
267 sprintfex(pTmpBuf2.data(), "NPC%03d", v6->uPortraitID); | 221 (Texture *)(pIcons_LOD->LoadTexture(pTmpBuf2.data(), TEXTURE_16BIT_PALETTE) != -1 |
268 v8 = pIcons_LOD->LoadTexture(pTmpBuf2.data(), TEXTURE_16BIT_PALETTE); | 222 ? &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(pTmpBuf2.data(), TEXTURE_16BIT_PALETTE)] : 0)); |
269 pRenderer->DrawTextureIndexed( | 223 if ( pNPC->uProfession ) |
270 a1.uFrameX + 22, | 224 { |
271 a1.uFrameY + 36, | |
272 (Texture *)(v8 != -1 ? &pIcons_LOD->pTextures[v8] : 0)); | |
273 v9 = v6->uProfession; | |
274 if ( v9 ) | |
275 { | |
276 v10 = v6->pName; | |
277 v11 = pTmpBuf.data(); | 225 v11 = pTmpBuf.data(); |
278 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[429], v10, aNPCProfessionNames[v9]); | 226 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[429], pNPC->pName, aNPCProfessionNames[pNPC->uProfession]); |
279 } | 227 } |
280 else | 228 else |
281 { | 229 { |
282 v12 = v6->pName; | |
283 v11 = pTmpBuf.data(); | 230 v11 = pTmpBuf.data(); |
284 strcpy(pTmpBuf.data(), v12); | 231 strcpy(pTmpBuf.data(), pNPC->pName); |
285 } | 232 } |
286 v13 = TargetColor(0xFFu, 0xFFu, 0x9Bu); | 233 popup_window.DrawTitleText(pFontArrus, 0, 12, TargetColor(0xFFu, 0xFFu, 0x9Bu), v11, 3); |
287 a1.DrawTitleText(pFontArrus, 0, 0xCu, v13, v11, 3u); | 234 popup_window.uFrameWidth -= 24; |
288 a1.uFrameWidth -= 24; | 235 popup_window.uFrameZ = popup_window.uFrameX + popup_window.uFrameWidth - 1; |
289 a1.uFrameZ = a1.uFrameX + a1.uFrameWidth - 1; | 236 popup_window.DrawText(pFontArrus, 100, 36, 0, BuildDialogueString((char *)lpsz, uActiveCharacter - 1, 0, 0, 0, 0), 0, 0, 0); |
290 v14 = BuildDialogueString((char *)lpsz, uActiveCharacter - 1, 0, 0, 0, 0); | |
291 a1.DrawText(pFontArrus, 100, 36, 0, v14, 0, 0, 0); | |
292 } | 237 } |
293 } | 238 } |
294 } | 239 } |
295 } | 240 } |
296 | |
297 | |
298 | 241 |
299 //----- (00445D4A) -------------------------------------------------------- | 242 //----- (00445D4A) -------------------------------------------------------- |
300 void GameUI_InitializeDialogue(Actor *actor, int bPlayerSaysHello) | 243 void GameUI_InitializeDialogue(Actor *actor, int bPlayerSaysHello) |
301 { | 244 { |
302 NPCData *pNPCInfo; // ebp@1 | 245 NPCData *pNPCInfo; // ebp@1 |
401 //----- (00445350) -------------------------------------------------------- | 344 //----- (00445350) -------------------------------------------------------- |
402 void GameUI_DrawDialogue() | 345 void GameUI_DrawDialogue() |
403 { | 346 { |
404 NPCData *pNPC; // ebx@2 | 347 NPCData *pNPC; // ebx@2 |
405 int pGreetType; // eax@2 | 348 int pGreetType; // eax@2 |
406 //unsigned __int16 v2; // di@2 | 349 int pTextHeight; // esi@39 |
407 //unsigned int v3; // eax@2 | 350 GUIButton *pButton; // eax@43 |
408 char *v4; // esi@3 | |
409 //int v5; // eax@11 | |
410 //char *v6; // ecx@13 | |
411 //char *v7; // eax@16 | |
412 //unsigned int v8; // edi@19 | |
413 //char *v9; // ecx@27 | |
414 char *v10; // eax@29 | |
415 //int v11; // eax@30 | |
416 int v12; // esi@39 | |
417 char *v13; // eax@41 | |
418 GUIButton *v14; // eax@43 | |
419 //GUIButton *v15; // edi@43 | |
420 signed int v16; // eax@44 | |
421 //unsigned int v23; // eax@53 | |
422 //const char *v24; // eax@59 | |
423 //unsigned __int16 v30; // cx@83 | |
424 int v31; // ecx@86 | |
425 int v32; // ebx@93 | 351 int v32; // ebx@93 |
426 //unsigned int v33; // eax@93 | |
427 GUIWindow *v34; // ecx@93 | |
428 int v35; // esi@93 | 352 int v35; // esi@93 |
429 int i; // eax@93 | |
430 GUIButton *v37; // eax@94 | |
431 int v38; // eax@95 | 353 int v38; // eax@95 |
432 signed int v39; // esi@99 | 354 signed int v39; // esi@99 |
433 signed int v40; // eax@102 | 355 signed int v40; // eax@102 |
434 unsigned int v41; // ebx@102 | 356 unsigned int v41; // ebx@102 |
435 int v42; // edi@102 | 357 int v42; // edi@102 |
436 GUIButton *v43; // esi@103 | |
437 int v44; // eax@104 | |
438 unsigned int v45; // ecx@104 | 358 unsigned int v45; // ecx@104 |
439 unsigned __int16 *v46; // edx@104 | 359 unsigned __int16 pTextColor; // ax@104 |
440 unsigned __int16 v47; // ax@104 | 360 GUIWindow window; // [sp+ACh] [bp-68h]@42 |
441 GUIWindow pWindow; // [sp+4h] [bp-110h]@39 | |
442 int v49; // [sp+Ch] [bp-108h]@39 | |
443 int v50; // [sp+14h] [bp-100h]@39 | |
444 GUIWindow v51; // [sp+58h] [bp-BCh]@2 | |
445 GUIWindow v52; // [sp+ACh] [bp-68h]@42 | |
446 char *Str; // [sp+100h] [bp-14h]@104 | 361 char *Str; // [sp+100h] [bp-14h]@104 |
447 //int v54; // [sp+104h] [bp-10h]@2 | |
448 //unsigned __int16 *v55; // [sp+108h] [bp-Ch]@82 | |
449 GUIFont *pOutString; // [sp+10Ch] [bp-8h]@39 | 362 GUIFont *pOutString; // [sp+10Ch] [bp-8h]@39 |
450 char *pInString=NULL; // [sp+110h] [bp-4h]@32 | 363 char *pInString=NULL; // [sp+110h] [bp-4h]@32 |
451 | 364 |
452 if ( !pDialogueWindow ) | 365 if ( !pDialogueWindow ) |
453 return; | 366 return; |
454 | 367 |
455 memcpy(&v51, pDialogueWindow, sizeof(v51)); | 368 // Window title( )---- |
369 memcpy(&window, pDialogueWindow, sizeof(window)); | |
456 pNPC = GetNPCData(sDialogue_SpeakingActorNPC_ID); | 370 pNPC = GetNPCData(sDialogue_SpeakingActorNPC_ID); |
457 pGreetType = GetGreetType(sDialogue_SpeakingActorNPC_ID); | 371 pGreetType = GetGreetType(sDialogue_SpeakingActorNPC_ID); |
458 v51.uFrameWidth -= 10; | 372 window.uFrameWidth -= 10; |
459 v51.uFrameZ -= 10; | 373 window.uFrameZ -= 10; |
460 //v54 = v1; | |
461 //TargetColor(0xFFu, 0xFFu, 0xFFu); | |
462 //TargetColor(0xE1u, 0xCDu, 0x23u); | |
463 //v2 = TargetColor(0x15u, 0x99u, 0xE9u); | |
464 pRenderer->DrawTextureIndexed(477, 0, pTexture_Dialogue_Background); | 374 pRenderer->DrawTextureIndexed(477, 0, pTexture_Dialogue_Background); |
465 pRenderer->DrawTextureTransparent(468, 0, (Texture *)(uTextureID_right_panel_loop != -1 ? &pIcons_LOD->pTextures[uTextureID_right_panel_loop] : 0)); | 375 pRenderer->DrawTextureTransparent(468, 0, (Texture *)(uTextureID_right_panel_loop != -1 ? &pIcons_LOD->pTextures[uTextureID_right_panel_loop] : 0)); |
466 pRenderer->DrawTextureIndexed(pNPCPortraits_x[0][0] - 4, pNPCPortraits_y[0][0] - 4, (Texture *)(uTextureID_50795C != -1 ? &pIcons_LOD->pTextures[uTextureID_50795C] : 0)); | 376 pRenderer->DrawTextureIndexed(pNPCPortraits_x[0][0] - 4, pNPCPortraits_y[0][0] - 4, (Texture *)(uTextureID_50795C != -1 ? &pIcons_LOD->pTextures[uTextureID_50795C] : 0)); |
467 pRenderer->DrawTextureIndexed(pNPCPortraits_x[0][0], pNPCPortraits_y[0][0], pDialogueNPCPortraits[0]); | 377 pRenderer->DrawTextureIndexed(pNPCPortraits_x[0][0], pNPCPortraits_y[0][0], pDialogueNPCPortraits[0]); |
468 | 378 |
472 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[429], pNPC->pName, aNPCProfessionNames[pNPC->uProfession]);//^Pi[%s] %s | 382 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[429], pNPC->pName, aNPCProfessionNames[pNPC->uProfession]);//^Pi[%s] %s |
473 } | 383 } |
474 else | 384 else |
475 strcpy(pTmpBuf.data(), pNPC->pName); | 385 strcpy(pTmpBuf.data(), pNPC->pName); |
476 | 386 |
477 v51.DrawTitleText(pFontArrus, 483, 112, ui_game_dialogue_npc_name_color, pTmpBuf.data(), 3); | 387 window.DrawTitleText(pFontArrus, 483, 112, ui_game_dialogue_npc_name_color, pTmpBuf.data(), 3); |
478 pParty->GetPartyFame(); | 388 pParty->GetPartyFame(); |
479 | 389 |
480 pInString = nullptr; | 390 pInString = nullptr; |
481 switch (uDialogueType) | 391 switch (uDialogueType) |
482 { | 392 { |
530 pInString = pNPCStats->pNPCGreetings[pNPC->greet - 1].pGreeting1; | 440 pInString = pNPCStats->pNPCGreetings[pNPC->greet - 1].pGreeting1; |
531 } | 441 } |
532 } | 442 } |
533 else if (pGreetType == 2)//HiredNPC_greet | 443 else if (pGreetType == 2)//HiredNPC_greet |
534 { | 444 { |
535 auto prof = pNPCStats->pProfessions + pNPC->uProfession - 1; | 445 auto prof = pNPCStats->pProfessions + pNPC->uProfession; |
536 | 446 |
537 if (pNPC->Hired()) | 447 if (pNPC->Hired()) |
538 pInString = BuildDialogueString(prof->pDismissText, uActiveCharacter - 1, 0, 0, 0, 0); | 448 pInString = BuildDialogueString(prof->pDismissText, uActiveCharacter - 1, 0, 0, 0, 0); |
539 else | 449 else |
540 pInString = BuildDialogueString(prof->pJoinText, uActiveCharacter - 1, 0, 0, 0, 0); | 450 pInString = BuildDialogueString(prof->pJoinText, uActiveCharacter - 1, 0, 0, 0, 0); |
541 } | 451 } |
542 break; | 452 break; |
543 } | 453 } |
544 | 454 |
455 // Message window( )---- | |
545 if (pInString) | 456 if (pInString) |
546 { | 457 { |
547 pWindow.uFrameWidth = game_viewport_width; | 458 window.uFrameWidth = game_viewport_width; |
548 pWindow.uFrameZ = 452; | 459 window.uFrameZ = 452; |
549 auto font = pFontArrus; | 460 auto font = pFontArrus; |
550 v12 = pFontArrus->CalcTextHeight(pInString, &pWindow, 13, 0) + 7; | 461 pTextHeight = pFontArrus->CalcTextHeight(pInString, &window, 13, 0) + 7; |
551 if ( 352 - v12 < 8 ) | 462 if ( 352 - pTextHeight < 8 ) |
552 { | 463 { |
553 font = pFontCreate; | 464 font = pFontCreate; |
554 v12 = pFontCreate->CalcTextHeight(pInString, &pWindow, 13, 0) + 7; | 465 pTextHeight = pFontCreate->CalcTextHeight(pInString, &window, 13, 0) + 7; |
555 } | 466 } |
556 if (uTextureID_Leather != -1) | 467 if (uTextureID_Leather != -1) |
557 pRenderer->_4A6A68(8, 352 - v12, &pIcons_LOD->pTextures[uTextureID_Leather], pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight - v12); | 468 pRenderer->GetLeather(8, 352 - pTextHeight, &pIcons_LOD->pTextures[uTextureID_Leather], pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight - pTextHeight); |
558 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428); | 469 pRenderer->DrawTextureIndexed(8, 347 - pTextHeight, pTexture_591428); |
559 v13 = FitTextInAWindow(pInString, font, &pWindow, 0xDu, 0); | 470 pDialogueWindow->DrawText(font, 13, 354 - pTextHeight, 0, FitTextInAWindow(pInString, font, &window, 13, 0), 0, 0, 0); |
560 pDialogueWindow->DrawText(font, 13, 354 - v12, 0, v13, 0, 0, 0); | 471 } |
561 } | 472 // Right panel( )------- |
562 | 473 memcpy(&window, pDialogueWindow, sizeof(window)); |
563 | 474 window.uFrameX = 483; |
564 memcpy(&v52, pDialogueWindow, sizeof(v52)); | 475 window.uFrameWidth = 148; |
565 v52.uFrameX = 483; | 476 window.uFrameZ = 334; |
566 v52.uFrameWidth = 148; | 477 for (int i = window.pStartingPosActiveItem; i < window.pStartingPosActiveItem + window.pNumPresenceButton; ++i) |
567 v52.uFrameZ = 334; | 478 { |
568 for (int i = v52.pStartingPosActiveItem; | 479 pButton = window.GetControl(i); |
569 i < v52.pStartingPosActiveItem + v52.pNumPresenceButton; ++i) | 480 if ( !pButton ) |
570 { | |
571 v14 = v52.GetControl(i); | |
572 //v15 = v14; | |
573 if ( !v14 ) | |
574 break; | 481 break; |
575 v16 = v14->msg_param; | 482 |
576 | 483 if ( pButton->msg_param > 88 ) |
577 if ( v16 > 88 ) | 484 pButton->pButtonName[0] = 0; |
578 v14->pButtonName[0] = 0; | 485 else if (pButton->msg_param == 88) |
579 else if (v16 == 88) | 486 strcpy(pButton->pButtonName, pGlobalTXT_LocalizationStrings[581]); // Lord |
580 strcpy(v14->pButtonName, pGlobalTXT_LocalizationStrings[581]); // Lord | 487 else if (pButton->msg_param == 87) |
581 else if (v16 == 87) | 488 strcpy(pButton->pButtonName, pGlobalTXT_LocalizationStrings[580]); // Knight |
582 strcpy(v14->pButtonName, pGlobalTXT_LocalizationStrings[580]); // Knight | 489 else if (pButton->msg_param == 86) |
583 else if (v16 == 86) | 490 strcpy(pButton->pButtonName, pGlobalTXT_LocalizationStrings[579]); // Squire |
584 strcpy(v14->pButtonName, pGlobalTXT_LocalizationStrings[579]); // Squire | 491 else if (pButton->msg_param == 85) |
585 else if (v16 == 85) | 492 strcpy(pButton->pButtonName, pGlobalTXT_LocalizationStrings[578]); // Page |
586 strcpy(v14->pButtonName, pGlobalTXT_LocalizationStrings[578]); // Page | 493 else if (pButton->msg_param == 77) |
587 else if (v16 == 77) | 494 strcpy(pButton->pButtonName, pGlobalTXT_LocalizationStrings[407]); // Details |
588 strcpy(v14->pButtonName, pGlobalTXT_LocalizationStrings[407]); // Details | 495 else if (pButton->msg_param == 76) |
589 else if (v16 == 76) | |
590 { | 496 { |
591 if (pNPC->Hired()) | 497 if (pNPC->Hired()) |
592 sprintf(v14->pButtonName, (const char*)pGlobalTXT_LocalizationStrings[408], pNPC->pName); // Release %s | 498 sprintf(pButton->pButtonName, (const char*)pGlobalTXT_LocalizationStrings[408], pNPC->pName); // Release %s |
593 else | 499 else |
594 strcpy(v14->pButtonName, pGlobalTXT_LocalizationStrings[406]); // Hire | 500 strcpy(pButton->pButtonName, pGlobalTXT_LocalizationStrings[406]); // Hire |
595 } | 501 } |
596 else if (v16 == 24) | 502 else if (pButton->msg_param == 24) |
597 { | 503 { |
598 __debugbreak(); // learn conditions of this event | 504 __debugbreak(); // learn conditions of this event |
599 auto topic = pNPCTopics[pNPC->evt_F - 1].pTopic;//(&dword_721660)[8 * v23]; | 505 auto topic = pNPCTopics[pNPC->evt_F - 1].pTopic;//(&dword_721660)[8 * v23]; |
600 if (!topic) | 506 if (!topic) |
601 { | 507 { |
602 v14->pButtonName[0] = 0; | 508 pButton->pButtonName[0] = 0; |
603 v14->msg_param = 0; | 509 pButton->msg_param = 0; |
604 } | 510 } |
605 else | 511 else |
606 strcpy(v14->pButtonName, topic); | 512 strcpy(pButton->pButtonName, topic); |
607 } | 513 } |
608 else if (v16 == 9) | 514 else if (pButton->msg_param == 9) |
609 strcpy(v14->pButtonName, GetProfessionActionText(pNPC->uProfession)); | 515 strcpy(pButton->pButtonName, GetProfessionActionText(pNPC->uProfession)); |
610 else if (v16 == 19) | 516 else if (pButton->msg_param == 19) |
611 { | 517 { |
612 // __debugbreak(); // learn conditions of this event Scavenger Hunt | 518 // __debugbreak(); // learn conditions of this event Scavenger Hunt |
613 auto topic = pNPCTopics[pNPC->evt_A - 1].pTopic;//(&dword_721660)[8 * v23]; | 519 auto topic = pNPCTopics[pNPC->evt_A - 1].pTopic;//(&dword_721660)[8 * v23]; |
614 if (!topic) | 520 if (!topic) |
615 { | 521 { |
616 v14->pButtonName[0] = 0; | 522 pButton->pButtonName[0] = 0; |
617 v14->msg_param = 0; | 523 pButton->msg_param = 0; |
618 } | 524 } |
619 else strcpy(v14->pButtonName, topic); | 525 else strcpy(pButton->pButtonName, topic); |
620 } | 526 } |
621 else if (v16 == 20) | 527 else if (pButton->msg_param == 20) |
622 { | 528 { |
623 //__debugbreak(); // learn conditions of this event instruments | 529 //__debugbreak(); // learn conditions of this event instruments |
624 auto topic = pNPCTopics[pNPC->evt_B - 1].pTopic;//(&dword_721660)[8 * v23]; | 530 auto topic = pNPCTopics[pNPC->evt_B - 1].pTopic;//(&dword_721660)[8 * v23]; |
625 if (!topic) | 531 if (!topic) |
626 { | 532 { |
627 v14->pButtonName[0] = 0; | 533 pButton->pButtonName[0] = 0; |
628 v14->msg_param = 0; | 534 pButton->msg_param = 0; |
629 } | 535 } |
630 else strcpy(v14->pButtonName, topic); | 536 else strcpy(pButton->pButtonName, topic); |
631 } | 537 } |
632 else if (v16 == 21) | 538 else if (pButton->msg_param == 21) |
633 { | 539 { |
634 //__debugbreak(); // learn conditions of this event | 540 //__debugbreak(); // learn conditions of this event |
635 auto topic = pNPCTopics[pNPC->evt_C - 1].pTopic;//(&dword_721660)[8 * v23]; | 541 auto topic = pNPCTopics[pNPC->evt_C - 1].pTopic;//(&dword_721660)[8 * v23]; |
636 if (!topic) | 542 if (!topic) |
637 { | 543 { |
638 v14->pButtonName[0] = 0; | 544 pButton->pButtonName[0] = 0; |
639 v14->msg_param = 0; | 545 pButton->msg_param = 0; |
640 } | 546 } |
641 else strcpy(v14->pButtonName, topic); | 547 else strcpy(pButton->pButtonName, topic); |
642 } | 548 } |
643 else if (v16 == 22) | 549 else if (pButton->msg_param == 22) |
644 { | 550 { |
645 //__debugbreak(); // learn conditions of this event | 551 //__debugbreak(); // learn conditions of this event |
646 auto topic = pNPCTopics[pNPC->evt_D - 1].pTopic;//(&dword_721660)[8 * v23]; | 552 auto topic = pNPCTopics[pNPC->evt_D - 1].pTopic;//(&dword_721660)[8 * v23]; |
647 if (!topic) | 553 if (!topic) |
648 { | 554 { |
649 v14->pButtonName[0] = 0; | 555 pButton->pButtonName[0] = 0; |
650 v14->msg_param = 0; | 556 pButton->msg_param = 0; |
651 } | 557 } |
652 else strcpy(v14->pButtonName, topic); | 558 else strcpy(pButton->pButtonName, topic); |
653 } | 559 } |
654 else if (v16 == 23) | 560 else if (pButton->msg_param == 23) |
655 { | 561 { |
656 //__debugbreak(); // learn conditions of this event | 562 //__debugbreak(); // learn conditions of this event |
657 auto topic = pNPCTopics[pNPC->evt_E - 1].pTopic;//(&dword_721660)[8 * v23]; | 563 auto topic = pNPCTopics[pNPC->evt_E - 1].pTopic;//(&dword_721660)[8 * v23]; |
658 if (!topic) | 564 if (!topic) |
659 { | 565 { |
660 v14->pButtonName[0] = 0; | 566 pButton->pButtonName[0] = 0; |
661 v14->msg_param = 0; | 567 pButton->msg_param = 0; |
662 } | 568 } |
663 else strcpy(v14->pButtonName, topic); | 569 else strcpy(pButton->pButtonName, topic); |
664 } | 570 } |
665 else if (v16 == 13) | 571 else if (pButton->msg_param == 13) |
666 { | 572 { |
667 if (pNPC->Hired()) | 573 if (pNPC->Hired()) |
668 sprintf(v14->pButtonName, pGlobalTXT_LocalizationStrings[408], pNPC->pName); // Release %s | 574 sprintf(pButton->pButtonName, pGlobalTXT_LocalizationStrings[408], pNPC->pName); // Release %s |
669 else | 575 else |
670 strcpy(v14->pButtonName, pGlobalTXT_LocalizationStrings[122]); // Join | 576 strcpy(pButton->pButtonName, pGlobalTXT_LocalizationStrings[122]); // Join |
671 } | 577 } |
672 else | 578 else |
673 v14->pButtonName[0] = 0; | 579 pButton->pButtonName[0] = 0; |
674 | |
675 | 580 |
676 if (pParty->field_7B5_in_arena_quest && pParty->field_7B5_in_arena_quest != -1) | 581 if (pParty->field_7B5_in_arena_quest && pParty->field_7B5_in_arena_quest != -1) |
677 { | 582 { |
678 int num_dead_actors = 0; | 583 int num_dead_actors = 0; |
679 pInString = 0; | 584 pInString = 0; |
680 for (uint i = 0; i < uNumActors; ++i) | 585 for ( uint i = 0; i < uNumActors; ++i ) |
681 { | 586 { |
682 if (pActors[i].uAIState == Dead || pActors[i].uAIState == Removed || | 587 if (pActors[i].uAIState == Dead || pActors[i].uAIState == Removed || pActors[i].uAIState == Disabled) |
683 pActors[i].uAIState == Disabled) | |
684 ++num_dead_actors; | 588 ++num_dead_actors; |
685 else | 589 else |
686 { | 590 { |
687 int sumonner_type = PID_TYPE(pActors[i].uSummonerID); | 591 int sumonner_type = PID_TYPE(pActors[i].uSummonerID); |
688 if (sumonner_type == OBJECT_Player) | 592 if (sumonner_type == OBJECT_Player) |
689 ++num_dead_actors; | 593 ++num_dead_actors; |
690 } | 594 } |
691 } | 595 } |
692 if (num_dead_actors == uNumActors) | 596 if (num_dead_actors == uNumActors) |
693 strcpy(v14->pButtonName, pGlobalTXT_LocalizationStrings[658]); // Collect Prize | 597 strcpy(pButton->pButtonName, pGlobalTXT_LocalizationStrings[658]); // Collect Prize |
694 } | 598 } |
695 } | 599 } |
696 | 600 |
697 | 601 // Install Buttons( )-------- |
698 v32 = 0; | 602 v32 = 0; |
699 v34 = pDialogueWindow; | |
700 //v54 = v33; | |
701 v35 = pDialogueWindow->pStartingPosActiveItem; | 603 v35 = pDialogueWindow->pStartingPosActiveItem; |
702 for ( i = v35 + pDialogueWindow->pNumPresenceButton; v35 < i; i = pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem ) | 604 for ( uint i = v35 + pDialogueWindow->pNumPresenceButton; v35 < i; i = pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem ) |
703 { | 605 { |
704 v37 = v34->GetControl(v35); | 606 pButton = pDialogueWindow->GetControl(v35); |
705 if ( !v37 ) | 607 if ( !pButton ) |
706 { | |
707 v34 = pDialogueWindow; | |
708 break; | 608 break; |
709 } | 609 v38 = pFontArrus->CalcTextHeight(pButton->pButtonName, &window, 0, 0); |
710 v38 = pFontArrus->CalcTextHeight(v37->pButtonName, &v52, 0, 0); | |
711 v34 = pDialogueWindow; | |
712 v32 += v38; | 610 v32 += v38; |
713 ++v35; | 611 ++v35; |
714 } | 612 } |
715 v39 = v34->pNumPresenceButton; | 613 v39 = pDialogueWindow->pNumPresenceButton; |
716 if ( v39 ) | 614 if ( v39 ) |
717 { | 615 { |
718 pOutString = (GUIFont *)((174 - v32) / v39); | 616 pOutString = (GUIFont *)((174 - v32) / v39); |
719 if ( (174 - v32) / v39 > 32 ) | 617 if ( (174 - v32) / v39 > 32 ) |
720 pOutString = (GUIFont *)32; | 618 pOutString = (GUIFont *)32; |
721 int v55 = 1; | 619 int v55 = 1; |
722 v40 = 174 - (int)pOutString * v39 - v32; | 620 v40 = 174 - (int)pOutString * v39 - v32; |
723 v41 = v34->pStartingPosActiveItem; | 621 v41 = pDialogueWindow->pStartingPosActiveItem; |
724 v42 = v40 / 2 - (signed int)pOutString / 2 + 138; | 622 v42 = v40 / 2 - (signed int)pOutString / 2 + 138; |
725 if ( (signed int)v41 < (signed int)(v41 + v39) ) | 623 if ( (signed int)v41 < (signed int)(v41 + v39) ) |
726 { | 624 { |
727 do | 625 do |
728 { | 626 { |
729 v43 = v34->GetControl(v41); | 627 pButton = pDialogueWindow->GetControl(v41); |
730 if ( !v43 ) | 628 if ( !pButton ) |
731 break; | 629 break; |
732 v43->uY = (unsigned int)((char *)pOutString + v42); | 630 pButton->uY = (unsigned int)((char *)pOutString + v42); |
733 Str = v43->pButtonName; | 631 Str = pButton->pButtonName; |
734 v44 = pFontArrus->CalcTextHeight(v43->pButtonName, &v52, 0, 0); | 632 pTextHeight = pFontArrus->CalcTextHeight(pButton->pButtonName, &window, 0, 0); |
735 v45 = v43->uY; | 633 v45 = pButton->uY; |
736 v46 = (unsigned short *)v55; | 634 pButton->uHeight = pTextHeight; |
737 v43->uHeight = v44; | 635 v42 = v45 + pTextHeight - 1; |
738 v42 = v45 + v44 - 1; | 636 pButton->uW = v42; |
739 v43->uW = v42; | 637 pTextColor = ui_game_dialogue_option_highlight_color; |
740 v47 = ui_game_dialogue_option_highlight_color; | 638 if ( pDialogueWindow->pCurrentPosActiveItem != v55 ) |
741 if ( (unsigned __int16 *)pDialogueWindow->pCurrentPosActiveItem != v46 ) | 639 pTextColor = ui_game_dialogue_option_normal_color; |
742 v47 = ui_game_dialogue_option_normal_color; | 640 window.DrawTitleText(pFontArrus, 0, v45, pTextColor, Str, 3); |
743 v52.DrawTitleText(pFontArrus, 0, v45, v47, Str, 3u); | |
744 v34 = pDialogueWindow; | |
745 ++v55; | 641 ++v55; |
746 ++v41; | 642 ++v41; |
747 } | 643 } |
748 while ( (signed int)v41 < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem ); | 644 while ( (signed int)v41 < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem ); |
749 } | 645 } |
750 } | 646 } |
751 pRenderer->DrawTextureIndexed(471, 445, pIcons_LOD->GetTexture(uExitCancelTextureId)); | 647 pRenderer->DrawTextureIndexed(471, 445, pIcons_LOD->GetTexture(uExitCancelTextureId)); |
752 } | 648 } |
753 | |
754 | |
755 | 649 |
756 //----- (00444FBE) -------------------------------------------------------- | 650 //----- (00444FBE) -------------------------------------------------------- |
757 void GameUI_DrawBranchlessDialogue() | 651 void GameUI_DrawBranchlessDialogue() |
758 { | 652 { |
759 //GUIFont *v0; // esi@1 | 653 int pTextHeight; // esi@4 |
760 int v1; // esi@4 | |
761 char *v2; // eax@6 | |
762 int v3; // edi@12 | |
763 char Str[200]; // [sp+Ch] [bp-120h]@12 | 654 char Str[200]; // [sp+Ch] [bp-120h]@12 |
764 GUIWindow v5; // [sp+D4h] [bp-58h]@4 | 655 GUIWindow BranchlessDlg_window; // [sp+D4h] [bp-58h]@4 |
765 GUIFont *pFont; // [sp+128h] [bp-4h]@1 | 656 GUIFont *pFont; // [sp+128h] [bp-4h]@1 |
766 | 657 |
767 pFont = pFontArrus; | 658 pFont = pFontArrus; |
768 if ( current_npc_text && !byte_5B0938[0] ) | 659 if ( current_npc_text && !byte_5B0938[0] ) |
769 strcpy(byte_5B0938.data(), current_npc_text); | 660 strcpy(byte_5B0938.data(), current_npc_text); |
770 v5.uFrameWidth = game_viewport_width; | 661 BranchlessDlg_window.uFrameWidth = game_viewport_width; |
771 v5.uFrameZ = 452; | 662 BranchlessDlg_window.uFrameZ = 452; |
772 v1 = pFontArrus->CalcTextHeight(byte_5B0938.data(), &v5, 12, 0) + 7; | 663 pTextHeight = pFontArrus->CalcTextHeight(byte_5B0938.data(), &BranchlessDlg_window, 12, 0) + 7; |
773 if ( 352 - v1 < 8 ) | 664 if ( 352 - pTextHeight < 8 ) |
774 { | 665 { |
775 pFont = pFontCreate; | 666 pFont = pFontCreate; |
776 v1 = pFontCreate->CalcTextHeight(byte_5B0938.data(), &v5, 12, 0) + 7; | 667 pTextHeight = pFontCreate->CalcTextHeight(byte_5B0938.data(), &BranchlessDlg_window, 12, 0) + 7; |
777 } | 668 } |
778 pRenderer->_4A6A68(8, 352 - v1, | 669 pRenderer->GetLeather(8, 352 - pTextHeight, pIcons_LOD->GetTexture(uTextureID_Leather), pIcons_LOD->GetTexture(uTextureID_Leather)->uTextureHeight - pTextHeight); |
779 pIcons_LOD->GetTexture(uTextureID_Leather), | 670 pRenderer->DrawTextureIndexed(8, 347 - pTextHeight, pTexture_591428); |
780 pIcons_LOD->GetTexture(uTextureID_Leather)->uTextureHeight - v1); | 671 pGUIWindow2->DrawText(pFont, 12, 354 - pTextHeight, 0, FitTextInAWindow(byte_5B0938.data(), pFont, &BranchlessDlg_window, 12, 0), 0, 0, 0); |
781 pRenderer->DrawTextureIndexed(8, 347 - v1, pTexture_591428); | |
782 v2 = FitTextInAWindow(byte_5B0938.data(), pFont, &v5, 0xCu, 0); | |
783 pGUIWindow2->DrawText(pFont, 12, 354 - v1, 0, v2, 0, 0, 0); | |
784 pRenderer->DrawTextureRGB(0, 0x160u, pTexture_StatusBar); | 672 pRenderer->DrawTextureRGB(0, 0x160u, pTexture_StatusBar); |
785 if ( pGUIWindow2->receives_keyboard_input_2 != WINDOW_INPUT_IN_PROGRESS) | 673 if ( pGUIWindow2->receives_keyboard_input_2 != WINDOW_INPUT_IN_PROGRESS) |
786 { | 674 { |
787 if ( pGUIWindow2->receives_keyboard_input_2 == WINDOW_INPUT_CONFIRMED) | 675 if ( pGUIWindow2->receives_keyboard_input_2 == WINDOW_INPUT_CONFIRMED) |
788 { | 676 { |
789 pGUIWindow2->receives_keyboard_input_2 = WINDOW_INPUT_NONE; | 677 pGUIWindow2->receives_keyboard_input_2 = WINDOW_INPUT_NONE; |
790 strcpy(GameUI_Footer_TimedString.data(), (const char *)pKeyActionMap->pPressedKeysBuffer); | 678 strcpy(GameUI_Footer_TimedString.data(), (const char *)pKeyActionMap->pPressedKeysBuffer); |
791 LABEL_16: | |
792 sub_4452BB(); | 679 sub_4452BB(); |
793 return; | 680 return; |
794 } | 681 } |
795 if ( pGUIWindow2->receives_keyboard_input_2 != WINDOW_INPUT_CANCELLED) | 682 if ( pGUIWindow2->receives_keyboard_input_2 != WINDOW_INPUT_CANCELLED) |
796 return; | 683 return; |
797 pGUIWindow2->receives_keyboard_input_2 = WINDOW_INPUT_NONE; | 684 pGUIWindow2->receives_keyboard_input_2 = WINDOW_INPUT_NONE; |
798 LABEL_15: | |
799 memset(GameUI_Footer_TimedString.data(), 0, 0xC8u); | 685 memset(GameUI_Footer_TimedString.data(), 0, 0xC8u); |
800 goto LABEL_16; | 686 sub_4452BB(); |
687 return; | |
801 } | 688 } |
802 if ( pGUIWindow2->ptr_1C == (void *)26 ) | 689 if ( pGUIWindow2->ptr_1C == (void *)26 ) |
803 { | 690 { |
804 sprintf(Str, "%s %s", GameUI_Footer_TimedString, pKeyActionMap->pPressedKeysBuffer); | 691 sprintf(Str, "%s %s", GameUI_Footer_TimedString, pKeyActionMap->pPressedKeysBuffer); |
805 v3 = pFontLucida->GetLineWidth(Str); | |
806 pGUIWindow2->DrawText(pFontLucida, 13, 357, 0, Str, 0, 0, 0); | 692 pGUIWindow2->DrawText(pFontLucida, 13, 357, 0, Str, 0, 0, 0); |
807 pGUIWindow2->DrawFlashingInputCursor(v3 + 13, 357, pFontLucida); | 693 pGUIWindow2->DrawFlashingInputCursor(pFontLucida->GetLineWidth(Str) + 13, 357, pFontLucida); |
808 return; | 694 return; |
809 } | 695 } |
810 if ( pKeyActionMap->pPressedKeysBuffer[0] ) | 696 if ( pKeyActionMap->pPressedKeysBuffer[0] ) |
811 { | 697 { |
812 pKeyActionMap->SetWindowInputStatus(WINDOW_INPUT_NONE); | 698 pKeyActionMap->SetWindowInputStatus(WINDOW_INPUT_NONE); |
813 goto LABEL_15; | 699 memset(GameUI_Footer_TimedString.data(), 0, 0xC8u); |
700 sub_4452BB(); | |
701 return; | |
814 } | 702 } |
815 } | 703 } |
816 | |
817 | 704 |
818 //----- (004443D5) -------------------------------------------------------- | 705 //----- (004443D5) -------------------------------------------------------- |
819 const char *GameUI_GetMinimapHintText() | 706 const char *GameUI_GetMinimapHintText() |
820 { | 707 { |
821 int v0; // ST20_4@1 | |
822 unsigned int v1; // esi@1 | |
823 signed int v2; // ebx@1 | |
824 double v3; // st7@1 | 708 double v3; // st7@1 |
825 int v4; // esi@3 | |
826 int v5; // edi@4 | |
827 int v6; // eax@4 | |
828 int v7; // eax@4 | 709 int v7; // eax@4 |
829 BSPModel *v8; // ecx@4 | 710 ODMFace *pFace; // eax@6 |
830 unsigned __int8 v9; // zf@5 | |
831 char v10; // sf@5 | |
832 unsigned __int8 v11; // of@5 | |
833 ODMFace *v12; // eax@6 | |
834 __int16 v13; // cx@6 | |
835 const char *v14; // eax@8 | 711 const char *v14; // eax@8 |
836 const char *v15; // edi@8 | |
837 char *result; // eax@12 | 712 char *result; // eax@12 |
838 unsigned int v17; // eax@14 | 713 unsigned int pMapID; // eax@14 |
839 unsigned int v18; // [sp+Ch] [bp-20h]@1 | |
840 int v19; // [sp+10h] [bp-1Ch]@1 | 714 int v19; // [sp+10h] [bp-1Ch]@1 |
841 int v20; // [sp+14h] [bp-18h]@1 | 715 int v20; // [sp+14h] [bp-18h]@1 |
842 char *v21; // [sp+18h] [bp-14h]@1 | |
843 unsigned int pY; // [sp+1Ch] [bp-10h]@1 | 716 unsigned int pY; // [sp+1Ch] [bp-10h]@1 |
844 int v23; // [sp+20h] [bp-Ch]@1 | 717 unsigned int pX; // [sp+28h] [bp-4h]@1 |
845 int v24; // [sp+24h] [bp-8h]@1 | 718 |
846 int pX; // [sp+28h] [bp-4h]@1 | 719 result = 0; |
847 | 720 pMouse->GetClickPos(&pX, &pY); |
848 v24 = pParty->vPosition.x; | 721 v3 = 1.0 / (float)((signed int)viewparams->uMinimapZoom * 0.000015258789); |
849 v0 = pParty->vPosition.y; | 722 v19 = (signed __int64)((double)(pX - 557) * v3 + (double)pParty->vPosition.x); |
850 v1 = pOutdoor->uNumBModels; | 723 v20 = (signed __int64)((double)pParty->vPosition.y - (double)(pY - 74) * v3); |
851 *(float *)&v23 = (double)(signed int)viewparams->uMinimapZoom * 0.000015258789; | 724 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor || pOutdoor->uNumBModels <= 0 ) |
852 v2 = 0; | 725 { |
853 v18 = pOutdoor->uNumBModels; | 726 pMapID = pMapStats->GetMapInfo(pCurrentMapName); |
854 v21 = 0; | 727 if ( pMapID == 0 ) |
855 pMouse->GetClickPos((unsigned int *)&pX, &pY); | |
856 v3 = 1.0 / *(float *)&v23; | |
857 v23 = pX - 557; | |
858 v19 = (signed __int64)((double)(pX - 557) * v3 + (double)v24); | |
859 v20 = (signed __int64)((double)v0 - (double)(signed int)(pY - 74) * v3); | |
860 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor || (*(float *)&v23 = 0.0, (signed int)v1 <= 0) ) | |
861 { | |
862 LABEL_14: | |
863 v17 = pMapStats->GetMapInfo(pCurrentMapName); | |
864 if ( v17 == v2 ) | |
865 result = "No Maze Info for this maze on file!"; | 728 result = "No Maze Info for this maze on file!"; |
866 else | 729 else |
867 result = pMapStats->pInfos[v17].pName; | 730 result = pMapStats->pInfos[pMapID].pName; |
868 } | 731 } |
869 else | 732 else |
870 { | 733 { |
871 v4 = 0; | 734 for ( uint j = 0; j < (signed int)pOutdoor->uNumBModels; ++j ) |
872 while ( 1 ) | 735 { |
873 { | 736 v7 = int_get_vector_length(abs((signed)pOutdoor->pBModels[j].vBoundingCenter.x - v19), |
874 pX = pOutdoor->pBModels[v4].vBoundingCenter.x - v19; | 737 abs((signed)pOutdoor->pBModels[j].vBoundingCenter.y - v20), 0); |
875 pY = pOutdoor->pBModels[v4].vBoundingCenter.y - v20; | 738 if ( v7 < 2 * pOutdoor->pBModels[j].sBoundingRadius ) |
876 v5 = abs((signed)pY); | 739 { |
877 v6 = abs((signed)pX); | 740 if ( pOutdoor->pBModels[j].uNumFaces ) |
878 v7 = int_get_vector_length(v6, v5, v2); | 741 { |
879 v8 = &pOutdoor->pBModels[0]; | 742 for ( uint i = 0; i < (signed int)pOutdoor->pBModels[j].uNumFaces; ++i ) |
880 if ( v7 < 2 * pOutdoor->pBModels[v4].sBoundingRadius ) | |
881 { | |
882 v11 = __OFSUB__(pOutdoor->pBModels[v4].uNumFaces, v2); | |
883 v9 = pOutdoor->pBModels[v4].uNumFaces == v2; | |
884 v10 = ((pOutdoor->pBModels[v4].uNumFaces - v2) & 0x80000000u) != 0; | |
885 v24 = v2; | |
886 if ( !((unsigned __int8)(v10 ^ v11) | v9) ) | |
887 { | |
888 do | |
889 { | 743 { |
890 v12 = &v8[v4].pFaces[v2 / 0x134u]; | 744 pFace = &pOutdoor->pBModels[j].pFaces[i]; |
891 v13 = v12->sCogTriggeredID; | 745 if ( pFace->sCogTriggeredID ) |
892 if ( v13 ) | |
893 { | 746 { |
894 if ( !(BYTE2(v12->uAttributes) & 0x10) ) | 747 if ( !(BYTE2(pFace->uAttributes) & 0x10) ) |
895 { | 748 { |
896 v14 = GetEventHintString(v13); | 749 v14 = GetEventHintString(pFace->sCogTriggeredID); |
897 v15 = v14; | |
898 if ( v14 ) | 750 if ( v14 ) |
899 { | 751 { |
900 if ( _stricmp(v14, "") ) | 752 if ( _stricmp(v14, "") ) |
901 v21 = (char *)v15; | 753 result = (char *)v14; |
902 } | 754 } |
903 } | 755 } |
904 } | 756 } |
905 ++v24; | |
906 v8 = pOutdoor->pBModels; | |
907 v2 += 308; | |
908 } | 757 } |
909 while ( v24 < (signed int)pOutdoor->pBModels[v4].uNumFaces ); | 758 } |
910 } | 759 if ( result ) |
911 result = v21; | 760 return result; |
912 v2 = 0; | 761 } |
913 if ( v21 ) | 762 } |
914 break; | 763 pMapID = pMapStats->GetMapInfo(pCurrentMapName); |
915 } | 764 if ( pMapID == 0 ) |
916 ++v23; | 765 result = "No Maze Info for this maze on file!"; |
917 ++v4; | 766 else |
918 if ( v23 >= (signed int)v18 ) | 767 result = pMapStats->pInfos[pMapID].pName; |
919 goto LABEL_14; | 768 return result; |
920 } | |
921 } | 769 } |
922 return result; | 770 return result; |
923 } | 771 } |
924 | |
925 | |
926 | |
927 | |
928 | 772 |
929 //----- (0041D3B7) -------------------------------------------------------- | 773 //----- (0041D3B7) -------------------------------------------------------- |
930 void GameUI_CharacterQuickRecord_Draw(GUIWindow *window, Player *player) | 774 void GameUI_CharacterQuickRecord_Draw(GUIWindow *window, Player *player) |
931 { | 775 { |
932 //Player *pPlayer; // esi@1 | |
933 int v6; // eax@5 | |
934 int v7; // ebx@5 | |
935 //unsigned int v8; // ecx@5 | |
936 int v9; // ebx@5 | |
937 //unsigned int v10; // eax@5 | |
938 //int v11; // eax@5 | |
939 //unsigned int v12; // ecx@5 | |
940 Texture *v13; // eax@6 | 776 Texture *v13; // eax@6 |
941 unsigned int v14; // eax@12 | |
942 PlayerFrame *v15; // eax@12 | 777 PlayerFrame *v15; // eax@12 |
943 //unsigned int v16; // eax@15 | 778 unsigned int pTextColor; // eax@15 |
944 unsigned int v20; // eax@15 | |
945 unsigned int v24; // eax@15 | |
946 unsigned int v25; // eax@15 | |
947 unsigned __int8 v28; // al@15 | |
948 char *v29; // eax@16 | 779 char *v29; // eax@16 |
949 __int64 v35; // ST38_8@22 | |
950 int v36; // esi@22 | 780 int v36; // esi@22 |
951 unsigned int v38; // eax@22 | |
952 char *v39; // eax@24 | 781 char *v39; // eax@24 |
953 signed int uFramesetID; // [sp+20h] [bp-8h]@9 | 782 signed int uFramesetID; // [sp+20h] [bp-8h]@9 |
954 int uFramesetIDa; // [sp+20h] [bp-8h]@18 | 783 int uFramesetIDa; // [sp+20h] [bp-8h]@18 |
955 | 784 |
956 uint numActivePlayerBuffs = 0; | 785 uint numActivePlayerBuffs = 0; |
957 for (uint i = 0; i < 24; ++i) | 786 for (uint i = 0; i < 24; ++i) |
958 if (player->pPlayerBuffs[i].uExpireTime > 0) | 787 if (player->pPlayerBuffs[i].uExpireTime > 0) |
959 ++numActivePlayerBuffs; | 788 ++numActivePlayerBuffs; |
960 | 789 |
961 v6 = pFontArrus->uFontHeight + 162; | 790 window->uFrameHeight = ((pFontArrus->uFontHeight + 162) + ((numActivePlayerBuffs - 1) * pFontArrus->uFontHeight)); |
962 v7 = (numActivePlayerBuffs - 1) * pFontArrus->uFontHeight; | |
963 v9 = v6 + v7; | |
964 window->uFrameHeight = v9; | |
965 window->uFrameZ = window->uFrameWidth + window->uFrameX - 1; | 791 window->uFrameZ = window->uFrameWidth + window->uFrameX - 1; |
966 window->uFrameW = v9 + window->uFrameY - 1; | 792 window->uFrameW = ((pFontArrus->uFontHeight + 162) + ((numActivePlayerBuffs - 1) * pFontArrus->uFontHeight)) + window->uFrameY - 1; |
967 window->DrawMessageBox(0); | 793 window->DrawMessageBox(0); |
968 | 794 |
969 if (player->IsEradicated()) | 795 if (player->IsEradicated()) |
970 v13 = pTexture_PlayerFaceEradicated; | 796 v13 = pTexture_PlayerFaceEradicated; |
971 else if (player->IsDead()) | 797 else if (player->IsDead()) |
974 { | 800 { |
975 uFramesetID = pPlayerFrameTable->GetFrameIdByExpression(player->expression); | 801 uFramesetID = pPlayerFrameTable->GetFrameIdByExpression(player->expression); |
976 if ( !uFramesetID ) | 802 if ( !uFramesetID ) |
977 uFramesetID = 1; | 803 uFramesetID = 1; |
978 if ( player->expression == CHARACTER_EXPRESSION_21) | 804 if ( player->expression == CHARACTER_EXPRESSION_21) |
979 { | |
980 v15 = pPlayerFrameTable->GetFrameBy_y(&player->_expression21_frameset, &player->_expression21_animtime, pMiscTimer->uTimeElapsed); | 805 v15 = pPlayerFrameTable->GetFrameBy_y(&player->_expression21_frameset, &player->_expression21_animtime, pMiscTimer->uTimeElapsed); |
981 } | |
982 else | 806 else |
983 { | 807 v15 = pPlayerFrameTable->GetFrameBy_x(uFramesetID, pMiscTimer->Time()); |
984 v14 = pMiscTimer->Time(); | |
985 v15 = pPlayerFrameTable->GetFrameBy_x(uFramesetID, v14); | |
986 } | |
987 player->field_1AA2 = v15->uTextureID - 1; | 808 player->field_1AA2 = v15->uTextureID - 1; |
988 v13 = pTextures_PlayerFaces[(unsigned int)window->ptr_1C][v15->uTextureID - 1]; | 809 v13 = pTextures_PlayerFaces[(unsigned int)window->ptr_1C][v15->uTextureID - 1]; |
989 } | 810 } |
990 | 811 |
991 pRenderer->DrawTextureTransparent(window->uFrameX + 24, window->uFrameY + 24, v13); | 812 pRenderer->DrawTextureTransparent(window->uFrameX + 24, window->uFrameY + 24, v13); |
993 sprintfex(pTmpBuf.data(), "\f%05d", ui_character_header_text_color); | 814 sprintfex(pTmpBuf.data(), "\f%05d", ui_character_header_text_color); |
994 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[429], player->pName, pClassNames[player->classType]); // "%s the %s" | 815 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[429], player->pName, pClassNames[player->classType]); // "%s the %s" |
995 strcat(pTmpBuf.data(), pTmpBuf2.data()); | 816 strcat(pTmpBuf.data(), pTmpBuf2.data()); |
996 strcat(pTmpBuf.data(), "\f00000\n"); | 817 strcat(pTmpBuf.data(), "\f00000\n"); |
997 | 818 |
998 v20 = UI_GetHealthManaStringColor(player->sHealth, player->GetMaxHealth()); | 819 pTextColor = UI_GetHealthManaStringColor(player->sHealth, player->GetMaxHealth()); |
999 sprintfex(pTmpBuf2.data(), "%s : \f%05u%d\f00000 / %d\n", | 820 sprintfex(pTmpBuf2.data(), "%s : \f%05u%d\f00000 / %d\n", pGlobalTXT_LocalizationStrings[108], // "Hit Points" |
1000 pGlobalTXT_LocalizationStrings[108], // "Hit Points" | 821 pTextColor, player->sHealth, player->GetMaxHealth()); |
1001 v20, player->sHealth, player->GetMaxHealth()); | |
1002 strcat(pTmpBuf.data(), pTmpBuf2.data()); | 822 strcat(pTmpBuf.data(), pTmpBuf2.data()); |
1003 | 823 |
1004 v24 = UI_GetHealthManaStringColor(player->sMana, player->GetMaxMana()); | 824 pTextColor = UI_GetHealthManaStringColor(player->sMana, player->GetMaxMana()); |
1005 sprintfex(pTmpBuf2.data(), "%s : \f%05u%d\f00000 / %d\n", | 825 sprintfex(pTmpBuf2.data(), "%s : \f%05u%d\f00000 / %d\n", pGlobalTXT_LocalizationStrings[212], // "Spell Points" |
1006 pGlobalTXT_LocalizationStrings[212], // "Spell Points" | 826 pTextColor, player->sMana, player->GetMaxMana()); |
1007 v24, player->sMana, player->GetMaxMana()); | |
1008 strcat(pTmpBuf.data(), pTmpBuf2.data()); | 827 strcat(pTmpBuf.data(), pTmpBuf2.data()); |
1009 | 828 |
1010 v25 = player->GetMajorConditionIdx(); | 829 pTextColor = player->GetMajorConditionIdx(); |
1011 sprintfex(pTmpBuf2.data(), "%s: \f%05d%s\f00000\n", | 830 sprintfex(pTmpBuf2.data(), "%s: \f%05d%s\f00000\n", pGlobalTXT_LocalizationStrings[47], // "Condition |
1012 pGlobalTXT_LocalizationStrings[47], // "Condition | 831 GetConditionDrawColor(pTextColor), aCharacterConditionNames[pTextColor]); |
1013 GetConditionDrawColor(v25), aCharacterConditionNames[v25]); | |
1014 strcat(pTmpBuf.data(), pTmpBuf2.data()); | 832 strcat(pTmpBuf.data(), pTmpBuf2.data()); |
1015 | 833 |
1016 v28 = player->uQuickSpell; | 834 if ( player->uQuickSpell ) |
1017 if ( v28 ) | 835 v29 = pSpellStats->pInfos[player->uQuickSpell].pShortName; |
1018 v29 = pSpellStats->pInfos[v28].pShortName; | |
1019 else | 836 else |
1020 v29 = pGlobalTXT_LocalizationStrings[153]; | 837 v29 = pGlobalTXT_LocalizationStrings[153]; |
1021 sprintfex(pTmpBuf2.data(), "%s: %s", pGlobalTXT_LocalizationStrings[172], v29); // "Quick Spell" | 838 sprintfex(pTmpBuf2.data(), "%s: %s", pGlobalTXT_LocalizationStrings[172], v29); // "Quick Spell" |
1022 strcat(pTmpBuf.data(), pTmpBuf2.data()); | 839 strcat(pTmpBuf.data(), pTmpBuf2.data()); |
1023 | 840 |
1027 for (uint i = 0; i < 24; ++i) | 844 for (uint i = 0; i < 24; ++i) |
1028 { | 845 { |
1029 auto buff = player->pPlayerBuffs + i; | 846 auto buff = player->pPlayerBuffs + i; |
1030 if (buff->uExpireTime > 0) | 847 if (buff->uExpireTime > 0) |
1031 { | 848 { |
1032 v35 = buff->uExpireTime - pParty->uTimePlayed; | |
1033 v36 = uFramesetIDa++ * pFontComic->uFontHeight + 134; | 849 v36 = uFramesetIDa++ * pFontComic->uFontHeight + 134; |
1034 v38 = ui_game_character_record_playerbuff_colors[i]; | 850 window->DrawText(pFontComic, 52, v36, ui_game_character_record_playerbuff_colors[i], aSpellNames[20 + i], 0, 0, 0); |
1035 window->DrawText(pFontComic, 52, v36, v38, aSpellNames[20 + i], 0, 0, 0); | 851 sub_41D20D_buff_remaining_time_string(v36, window, buff->uExpireTime - pParty->uTimePlayed, pFontComic); |
1036 sub_41D20D_buff_remaining_time_string(v36, window, v35, pFontComic); | |
1037 } | 852 } |
1038 } | 853 } |
1039 | 854 |
1040 v39 = ""; | 855 v39 = ""; |
1041 if ( uFramesetIDa == 0 ) | 856 if ( uFramesetIDa == 0 ) |
1042 v39 = pGlobalTXT_LocalizationStrings[153]; // "None" | 857 v39 = pGlobalTXT_LocalizationStrings[153]; // "None" |
1043 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[450], v39); // "Active Spells: %s" | 858 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[450], v39); // "Active Spells: %s" |
1044 window->DrawText(pFontArrus, 14, 114, 0, pTmpBuf.data(), 0, 0, 0); | 859 window->DrawText(pFontArrus, 14, 114, 0, pTmpBuf.data(), 0, 0, 0); |
1045 } | 860 } |
1046 | 861 |
1047 | |
1048 | |
1049 //----- (0041A57E) -------------------------------------------------------- | 862 //----- (0041A57E) -------------------------------------------------------- |
1050 void GameUI_QuickRef_Draw() | 863 void GameUI_QuickRef_Draw() |
1051 { | 864 { |
1052 //unsigned int v0; // ebx@1 | 865 unsigned int pTextColor; // eax@7 |
1053 //unsigned int v1; // eax@1 | 866 unsigned int pX; // [sp+14h] [bp-18h]@2 |
1054 //Player *pPlayer; // ebp@2 | 867 unsigned int pY; // edi@9 |
1055 //int v3; // eax@6 | 868 int pSkillsCount; // ecx@27 |
1056 //int v4; // edi@6 | 869 char *pText; // eax@38 |
1057 unsigned int v5; // eax@7 | 870 int pFontHeight; // [sp+18h] [bp-14h]@1 |
1058 unsigned int v6; // edi@9 | 871 |
1059 unsigned int v7; // edi@11 | |
1060 //signed int v8; // eax@13 | |
1061 unsigned int v9; // eax@13 | |
1062 unsigned int v10; // edi@13 | |
1063 //int v11; // eax@15 | |
1064 unsigned int v12; // eax@15 | |
1065 unsigned int v13; // edi@15 | |
1066 //int v14; // eax@17 | |
1067 //int v15; // ST18_4@17 | |
1068 //int v16; // ebx@17 | |
1069 //int v17; // eax@17 | |
1070 unsigned int v18; // eax@17 | |
1071 unsigned int v19; // edi@17 | |
1072 //int v20; // eax@19 | |
1073 unsigned int v21; // edi@19 | |
1074 char *v22; // eax@21 | |
1075 unsigned int v23; // edi@21 | |
1076 //int v24; // eax@23 | |
1077 unsigned int v25; // edi@23 | |
1078 char *v26; // eax@25 | |
1079 unsigned int v27; // edi@25 | |
1080 int v28; // ecx@27 | |
1081 char *v29; // eax@27 | |
1082 signed int v30; // edx@27 | |
1083 unsigned int v31; // edi@31 | |
1084 unsigned int v32; // edi@33 | |
1085 const char *v33; // ST10_4@35 | |
1086 unsigned int v34; // eax@35 | |
1087 unsigned int v35; // edi@35 | |
1088 //unsigned __int8 v36; // al@37 | |
1089 char *v37; // eax@38 | |
1090 int v38; // eax@41 | |
1091 signed int v39; // edi@42 | |
1092 //char *v40; // eax@45 | |
1093 //unsigned int v41; // eax@45 | |
1094 signed int v43; // [sp+10h] [bp-1Ch]@1 | |
1095 unsigned int v44; // [sp+14h] [bp-18h]@2 | |
1096 int v45; // [sp+18h] [bp-14h]@1 | |
1097 //unsigned int v46; // [sp+1Ch] [bp-10h]@1 | |
1098 //unsigned int v47; // [sp+20h] [bp-Ch]@1 | |
1099 unsigned int v48; // [sp+24h] [bp-8h]@33 | |
1100 //unsigned int v49; // [sp+28h] [bp-4h]@1 | |
1101 | |
1102 //v0 = 0; | |
1103 //v47 = TargetColor(0xFFu, 0xFFu, 0x9Bu); | |
1104 //v49 = TargetColor(0xFFu, 0, 0); | |
1105 //v46 = TargetColor(0, 0xFFu, 0); | |
1106 //v1 = pIcons_LOD->LoadTexture("quikref", TEXTURE_16BIT_PALETTE); | |
1107 pRenderer->DrawTextureIndexed(8, 8, pIcons_LOD->LoadTexturePtr("quikref", TEXTURE_16BIT_PALETTE)); | 872 pRenderer->DrawTextureIndexed(8, 8, pIcons_LOD->LoadTexturePtr("quikref", TEXTURE_16BIT_PALETTE)); |
1108 v43 = 0; | 873 pFontHeight = LOBYTE(pFontArrus->uFontHeight) + 1; |
1109 v45 = LOBYTE(pFontArrus->uFontHeight) + 1; | 874 for ( uint i = 0; i < 4; ++i ) |
1110 do | 875 { |
1111 { | 876 auto player = &pParty->pPlayers[i]; |
1112 auto player = &pParty->pPlayers[v43]; | 877 pX = 94 * i + 89; |
1113 v44 = 94 * v43 + 89; | 878 if ( i == 0 ) |
1114 if ( v43 == 0 ) | 879 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 22, 18, 0, pGlobalTXT_LocalizationStrings[149], 60, 0);//Name |
1115 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, 0x12u, 0, pGlobalTXT_LocalizationStrings[149], 60, 0);//Name | 880 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 94 * i + 89, 18, ui_character_header_text_color, player->pName, 84, 0); |
1116 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 94 * v43 + 89, 0x12u, ui_character_header_text_color, player->pName, 84, 0); | 881 if ( i == 0 ) |
1117 if ( v43 == 0 ) | 882 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 22, 47, 0, pGlobalTXT_LocalizationStrings[131], 60, 0); //. |
1118 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, 0x2Fu, 0, pGlobalTXT_LocalizationStrings[131], 60, 0); //. | 883 sprintf(pTmpBuf.data(), "%lu", player->GetActualLevel()); |
1119 sprintf(pTmpBuf.data(), "%lu", player->GetActualLevel()); | 884 if ( player->GetActualLevel() <= player->GetBaseLevel()) |
1120 if ( player->GetActualLevel() <= player->GetBaseLevel()) | 885 pTextColor = player->GetExperienceDisplayColor(); |
1121 v5 = player->GetExperienceDisplayColor(); | 886 else |
1122 else | 887 pTextColor = ui_character_bonus_text_color; |
1123 v5 = ui_character_bonus_text_color; | 888 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, pX, 47, pTextColor, pTmpBuf.data(), 84, 0); |
1124 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, 0x2Fu, v5, pTmpBuf.data(), 84, 0); | 889 pY = pFontHeight + 47; |
1125 v6 = v45 + 47; | 890 if ( i == 0 ) |
1126 if ( v43 == 0 ) | 891 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 22, pFontHeight + 47, 0, pGlobalTXT_LocalizationStrings[41], 60, 0);// |
1127 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v45 + 47, 0, pGlobalTXT_LocalizationStrings[41], 60, 0);// | 892 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, pX, pY, 0, pClassNames[player->classType], 84, 0); |
1128 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v6, 0, pClassNames[player->classType], 84, 0); | 893 pY = pFontHeight + pY; |
1129 v7 = v45 + v6; | 894 if ( i == 0 ) |
1130 if ( v43 == 0 ) | 895 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 22, pY, 0, pGlobalTXT_LocalizationStrings[107], 60, 0);//. |
1131 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v7, 0, pGlobalTXT_LocalizationStrings[107], 60, 0);//. | 896 sprintf(pTmpBuf.data(), "%d", player->sHealth); |
1132 sprintf(pTmpBuf.data(), "%d", player->sHealth); | 897 pTextColor = UI_GetHealthManaStringColor(player->sHealth, player->GetMaxHealth()); |
1133 v9 = UI_GetHealthManaStringColor(player->sHealth, player->GetMaxHealth()); | 898 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, pX, pY, pTextColor, pTmpBuf.data(), 84, 0); |
1134 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v7, v9, pTmpBuf.data(), 84, 0); | 899 pY = pFontHeight + pY; |
1135 v10 = v45 + v7; | 900 if ( i == 0 ) |
1136 if ( v43 == 0 ) | 901 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 22, pY, 0, pGlobalTXT_LocalizationStrings[209], 60, 0);// |
1137 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v10, 0, pGlobalTXT_LocalizationStrings[209], 60, 0);// | 902 sprintf(pTmpBuf.data(), "%d", player->sMana); |
1138 sprintf(pTmpBuf.data(), "%d", player->sMana); | 903 pTextColor = UI_GetHealthManaStringColor(player->sMana, player->GetMaxMana()); |
1139 v12 = UI_GetHealthManaStringColor(player->sMana, player->GetMaxMana()); | 904 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, pX, pY, pTextColor, pTmpBuf.data(), 84, 0); |
1140 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v10, v12, pTmpBuf.data(), 84, 0); | 905 pY = pFontHeight + pY; |
1141 v13 = v45 + v10; | 906 if ( i == 0 ) |
1142 if ( v43 == 0 ) | 907 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 22, pY, 0, pGlobalTXT_LocalizationStrings[0], 60, 0);// |
1143 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v13, 0, pGlobalTXT_LocalizationStrings[0], 60, 0);// | 908 sprintf(pTmpBuf.data(), "%d", player->GetActualAC()); |
1144 sprintf(pTmpBuf.data(), "%d", player->GetActualAC()); | 909 pTextColor = UI_GetHealthManaStringColor(player->GetActualAC(), player->GetBaseAC()); |
1145 v18 = UI_GetHealthManaStringColor(player->GetActualAC(), player->GetBaseAC()); | 910 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, pX, pY, pTextColor, pTmpBuf.data(), 84, 0); |
1146 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v13, v18, pTmpBuf.data(), 84, 0); | 911 pY = pFontHeight + pY; |
1147 v19 = v45 + v13; | 912 if ( !i ) |
1148 if ( !v43 ) | 913 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 22, pY, 0, pGlobalTXT_LocalizationStrings[18], 60, 0);// |
1149 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v19, 0, pGlobalTXT_LocalizationStrings[18], 60, 0);// | 914 sprintf(pTmpBuf.data(), "%+d", player->GetActualAttack(0)); |
1150 sprintf(pTmpBuf.data(), "%+d", player->GetActualAttack(0)); | 915 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, pX, pY, 0, pTmpBuf.data(), 84, 0); |
1151 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v19, 0, pTmpBuf.data(), 84, 0); | 916 pY = pFontHeight + pY; |
1152 v21 = v45 + v19; | 917 if ( !i ) |
1153 if ( !v43 ) | 918 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 22, pY, 0, pGlobalTXT_LocalizationStrings[66], 60, 0);//. |
1154 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v21, 0, pGlobalTXT_LocalizationStrings[66], 60, 0);//. | 919 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, pX, pY, 0, player->GetMeleeDamageString(), 84, 0); |
1155 v22 = player->GetMeleeDamageString(); | 920 pY = pFontHeight + pY; |
1156 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v21, 0, v22, 84, 0); | 921 if ( !i ) |
1157 v23 = v45 + v21; | 922 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 22, pY, 0, pGlobalTXT_LocalizationStrings[203], 60, 0);// |
1158 if ( !v43 ) | 923 sprintf(pTmpBuf.data(), "%+d", player->GetRangedAttack()); |
1159 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v23, 0, pGlobalTXT_LocalizationStrings[203], 60, 0);// | 924 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, pX, pY, 0, pTmpBuf.data(), 84, 0); |
1160 sprintf(pTmpBuf.data(), "%+d", player->GetRangedAttack()); | 925 pY = pFontHeight + pY; |
1161 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v23, 0, pTmpBuf.data(), 84, 0); | 926 if ( !i ) |
1162 v25 = v45 + v23; | 927 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 22, pY, 0, pGlobalTXT_LocalizationStrings[66], 60, 0);//. |
1163 if ( !v43 ) | 928 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, pX, pY, 0, player->GetRangedDamageString(), 84, 0); |
1164 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v25, 0, pGlobalTXT_LocalizationStrings[66], 60, 0);//. | 929 pY = pFontHeight + pY; |
1165 v26 = player->GetRangedDamageString(); | 930 if ( !i ) |
1166 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v25, 0, v26, 84, 0); | 931 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 22, pY, 0, pGlobalTXT_LocalizationStrings[205], 60, 0);// |
1167 v27 = v45 + v25; | 932 pSkillsCount = 0; |
1168 if ( !v43 ) | 933 for ( uint j = 0; j <= 36; ++j ) |
1169 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v27, 0, pGlobalTXT_LocalizationStrings[205], 60, 0);// | 934 { |
1170 v28 = 0; | 935 if ( player->pActiveSkills[j] ) |
1171 v29 = (char *)player->pActiveSkills; | 936 ++pSkillsCount; |
1172 v30 = 36; | 937 } |
1173 do | 938 sprintf(pTmpBuf.data(), "%lu", pSkillsCount); |
1174 { | 939 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, pX, pY, 0, pTmpBuf.data(), 84, 0); |
1175 if ( *(short *)v29 ) | 940 pY = pFontHeight + pY; |
1176 ++v28; | 941 if ( !i ) |
1177 v29 += 2; | 942 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 22, pY, 0, pGlobalTXT_LocalizationStrings[168], 60, 0);// |
1178 --v30; | 943 sprintf(pTmpBuf.data(), "%lu", player->uSkillPoints); |
1179 } | 944 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, pX, pY, player->uSkillPoints ? ui_character_bonus_text_color : ui_character_default_text_color, pTmpBuf.data(), 84, 0); |
1180 while ( v30 ); | 945 pY = pFontHeight + pY; |
1181 sprintf(pTmpBuf.data(), "%lu", v28); | 946 if ( !i ) |
1182 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v27, 0, pTmpBuf.data(), 84, 0); | 947 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 22, pY, 0, pGlobalTXT_LocalizationStrings[45], 60, 0);//. |
1183 v31 = v45 + v27; | 948 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, pX, pY, pTextColor, aCharacterConditionNames[player->GetMajorConditionIdx()], 84, 0); |
1184 if ( !v43 ) | 949 pY = pFontHeight + pY; |
1185 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v31, 0, pGlobalTXT_LocalizationStrings[168], 60, 0);// | 950 if ( !i ) |
1186 sprintf(pTmpBuf.data(), "%lu", player->uSkillPoints); | 951 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 22, pY, 0, pGlobalTXT_LocalizationStrings[170], 60, 0);//.. |
1187 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v31, player->uSkillPoints ? ui_character_bonus_text_color : ui_character_default_text_color, pTmpBuf.data(), 84, 0); | 952 if (player->uQuickSpell) |
1188 v32 = v45 + v31; | 953 pText = pSpellStats->pInfos[player->uQuickSpell].pShortName; |
1189 v48 = player->GetMajorConditionIdx(); | 954 else |
1190 if ( !v43 ) | 955 pText = pGlobalTXT_LocalizationStrings[153];// |
1191 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v32, 0, pGlobalTXT_LocalizationStrings[45], 60, 0);//. | 956 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, pX, pY, 0, pText, 84, 0); |
1192 v33 = aCharacterConditionNames[v48]; | 957 } |
1193 v34 = GetConditionDrawColor(v48); | 958 |
1194 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v32, v34, v33, 84, 0); | 959 if ( GetPartyReputation() >= 0 ) |
1195 v35 = v45 + v32; | 960 { |
1196 if ( !v43 ) | 961 if ( GetPartyReputation() <= 5 ) |
1197 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v35, 0, pGlobalTXT_LocalizationStrings[170], 60, 0);//.. | 962 pTextColor = ui_character_default_text_color; |
1198 if (player->uQuickSpell) | 963 else |
1199 v37 = pSpellStats->pInfos[player->uQuickSpell].pShortName; | 964 pTextColor = ui_character_bonus_text_color_neg; |
1200 else | 965 } |
1201 v37 = pGlobalTXT_LocalizationStrings[153];// | 966 else |
1202 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v35, 0, v37, 84, 0); | 967 pTextColor = ui_character_bonus_text_color; |
1203 ++v43; | 968 |
1204 } | 969 sprintf(pTmpBuf.data(), "%s: \f%05d%s\f00000", pGlobalTXT_LocalizationStrings[180], pTextColor, GetReputationString(GetPartyReputation()));//Reputation |
1205 while ( v43 < 4 ); | 970 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 22, 323, 0, pTmpBuf.data(), 0, 0, 0); |
1206 | 971 sprintf(pTmpBuf.data(), "\r261%s: %d", pGlobalTXT_LocalizationStrings[84], pParty->GetPartyFame());// Fame |
1207 v38 = GetPartyReputation(); | 972 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 0, 323, 0, pTmpBuf.data(), 0, 0, 0); |
1208 if ( v38 >= 0 ) | |
1209 { | |
1210 if ( v38 <= 5 ) | |
1211 v39 = ui_character_default_text_color; | |
1212 else | |
1213 v39 = ui_character_bonus_text_color_neg; | |
1214 } | |
1215 else | |
1216 v39 = ui_character_bonus_text_color; | |
1217 | |
1218 sprintf(pTmpBuf.data(), "%s: \f%05d%s\f00000", pGlobalTXT_LocalizationStrings[180], v39, GetReputationString(v38));//Reputation | |
1219 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 22, 323, 0, pTmpBuf.data(), 0, 0, 0); | |
1220 | |
1221 sprintf(pTmpBuf.data(), "\r261%s: %d", pGlobalTXT_LocalizationStrings[84], pParty->GetPartyFame());// Fame | |
1222 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 0, 323, 0, pTmpBuf.data(), 0, 0, 0); | |
1223 } | 973 } |
1224 | |
1225 | |
1226 | 974 |
1227 //----- (0041AD6E) -------------------------------------------------------- | 975 //----- (0041AD6E) -------------------------------------------------------- |
1228 void GameUI_DrawRightPanelItems() | 976 void GameUI_DrawRightPanelItems() |
1229 { | 977 { |
1230 if (GameUI_RightPanel_BookFlashTimer > pParty->uTimePlayed) | 978 if (GameUI_RightPanel_BookFlashTimer > pParty->uTimePlayed) |
1263 sprintf(pTmpBuf.data(), "\r028%lu", pParty->uNumGold); | 1011 sprintf(pTmpBuf.data(), "\r028%lu", pParty->uNumGold); |
1264 pPrimaryWindow->DrawText(pFontSmallnum, 0, v2, uGameUIFontMain, pTmpBuf.data(), 0, 0, uGameUIFontShadow); | 1012 pPrimaryWindow->DrawText(pFontSmallnum, 0, v2, uGameUIFontMain, pTmpBuf.data(), 0, 0, uGameUIFontShadow); |
1265 } | 1013 } |
1266 } | 1014 } |
1267 | 1015 |
1268 | |
1269 //----- (0041B0C9) -------------------------------------------------------- | 1016 //----- (0041B0C9) -------------------------------------------------------- |
1270 void GameUI_DrawLifeManaBars() | 1017 void GameUI_DrawLifeManaBars() |
1271 { | 1018 { |
1272 double v3; // st7@3 | 1019 double v3; // st7@3 |
1273 double v7; // st7@25 | 1020 double v7; // st7@25 |
1274 Texture *v9; // [sp-4h] [bp-30h]@10 | 1021 Texture *pTextureHealth; // [sp-4h] [bp-30h]@10 |
1275 Texture *v10; // [sp+Ch] [bp-20h]@1 | 1022 Texture *pTextureMana; // [sp+Ch] [bp-20h]@1 |
1276 | 1023 |
1277 | 1024 pTextureMana = pIcons_LOD->GetTexture(uTextureID_BarBlue); |
1278 v10 = pIcons_LOD->GetTexture(uTextureID_BarBlue); | |
1279 | |
1280 for (uint i = 0; i < 4; ++i) | 1025 for (uint i = 0; i < 4; ++i) |
1281 { | 1026 { |
1282 auto player = pParty->pPlayers + i; | 1027 if (pParty->pPlayers[i].sHealth > 0) |
1283 | 1028 { |
1284 if (player->sHealth > 0) | |
1285 { | |
1286 int v17 = 0; | 1029 int v17 = 0; |
1287 if (i == 2 || i == 3) | 1030 if (i == 2 || i == 3) |
1288 v17 = 2; | 1031 v17 = 2; |
1289 | 1032 v3 = (double)pParty->pPlayers[i].sHealth / (double)pParty->pPlayers[i].GetMaxHealth(); |
1290 v3 = (double)player->sHealth / (double)player->GetMaxHealth(); | |
1291 if( v3 > 0.5 ) | 1033 if( v3 > 0.5 ) |
1292 { | 1034 { |
1293 if ( v3 > 1.0 ) | 1035 if ( v3 > 1.0 ) |
1294 v3 = 1.0; | 1036 v3 = 1.0; |
1295 v9 = pIcons_LOD->GetTexture(uTextureID_BarGreen); | 1037 pTextureHealth = pIcons_LOD->GetTexture(uTextureID_BarGreen); |
1296 } | 1038 } |
1297 else if ( v3 > 0.25 ) | 1039 else if ( v3 > 0.25 ) |
1298 v9 = pIcons_LOD->GetTexture(uTextureID_BarYellow); | 1040 pTextureHealth = pIcons_LOD->GetTexture(uTextureID_BarYellow); |
1299 else if ( v3 > 0.0 ) | 1041 else if ( v3 > 0.0 ) |
1300 v9 = pIcons_LOD->GetTexture(uTextureID_BarRed); | 1042 pTextureHealth = pIcons_LOD->GetTexture(uTextureID_BarRed); |
1301 | 1043 if( v3 > 0.0 ) |
1302 | 1044 { |
1303 if( v3 > 0.0 ) | 1045 pRenderer->SetTextureClipRect(v17 + pHealthBarPos[i], (signed __int64)((1.0 - v3) * pTextureHealth->uTextureHeight) + 402, |
1304 { | 1046 v17 + pHealthBarPos[i] + pTextureHealth->uTextureWidth, pTextureHealth->uTextureHeight + 402); |
1305 pRenderer->SetTextureClipRect(v17 + pHealthBarPos[i], | 1047 pRenderer->DrawTextureIndexed(v17 + pHealthBarPos[i], 402, pTextureHealth); |
1306 (signed __int64)((1.0 - v3) * v9->uTextureHeight) + 402, | 1048 pRenderer->ResetTextureClipRect(); |
1307 v17 + pHealthBarPos[i] + v9->uTextureWidth, | 1049 } |
1308 v9->uTextureHeight + 402); | 1050 } |
1309 | 1051 if (pParty->pPlayers[i].sMana > 0) |
1310 pRenderer->DrawTextureIndexed(v17 + pHealthBarPos[i], 402, v9); | 1052 { |
1311 pRenderer->ResetTextureClipRect(); | 1053 v7 = pParty->pPlayers[i].sMana / (double)pParty->pPlayers[i].GetMaxMana(); |
1312 } | |
1313 } | |
1314 | |
1315 | |
1316 if (player->sMana > 0) | |
1317 { | |
1318 v7 = player->sMana / (double)player->GetMaxMana(); | |
1319 if ( v7 > 1.0 ) | 1054 if ( v7 > 1.0 ) |
1320 v7 = 1.0; | 1055 v7 = 1.0; |
1321 | |
1322 int v17 = 0; | 1056 int v17 = 0; |
1323 if (i == 2) | 1057 if (i == 2) |
1324 v17 = 1; | 1058 v17 = 1; |
1325 | 1059 pRenderer->SetTextureClipRect(v17 + pManaBarPos[i], (signed __int64)((1.0 - v7) * pTextureMana->uTextureHeight) + 402, |
1326 pRenderer->SetTextureClipRect(v17 + pManaBarPos[i], | 1060 v17 + pManaBarPos[i] + pTextureMana->uTextureWidth, pTextureMana->uTextureHeight + 402); |
1327 (signed __int64)((1.0 - v7) * v10->uTextureHeight) + 402, | 1061 pRenderer->DrawTextureIndexed(v17 + pManaBarPos[i], 402, pTextureMana); |
1328 v17 + pManaBarPos[i] + v10->uTextureWidth, | |
1329 v10->uTextureHeight + 402); | |
1330 pRenderer->DrawTextureIndexed(v17 + pManaBarPos[i], 402, v10); | |
1331 pRenderer->ResetTextureClipRect(); | 1062 pRenderer->ResetTextureClipRect(); |
1332 } | 1063 } |
1333 } | 1064 } |
1334 } | 1065 } |
1335 | 1066 |
1336 //----- (0041B3B6) -------------------------------------------------------- | 1067 //----- (0041B3B6) -------------------------------------------------------- |
1337 void GameUI_DrawRightPanel() | 1068 void GameUI_DrawRightPanel() |
1338 { | 1069 { |
1339 pRenderer->DrawTextureTransparent(pViewport->uViewportBR_X, 0, | 1070 pRenderer->DrawTextureTransparent(pViewport->uViewportBR_X, 0, pIcons_LOD->GetTexture(uTextureID_right_panel)); |
1340 pIcons_LOD->GetTexture(uTextureID_right_panel)); | |
1341 } | 1071 } |
1342 | 1072 |
1343 //----- (0041B3E2) -------------------------------------------------------- | 1073 //----- (0041B3E2) -------------------------------------------------------- |
1344 void GameUI_DrawRightPanelFrames() | 1074 void GameUI_DrawRightPanelFrames() |
1345 { | 1075 { |
1349 pRenderer->DrawTextureRGB(0, 352, pTexture_BottomFrame); | 1079 pRenderer->DrawTextureRGB(0, 352, pTexture_BottomFrame); |
1350 GameUI_DrawFoodAndGold(); | 1080 GameUI_DrawFoodAndGold(); |
1351 GameUI_DrawRightPanelItems(); | 1081 GameUI_DrawRightPanelItems(); |
1352 } | 1082 } |
1353 | 1083 |
1354 | |
1355 //----- (0041C047) -------------------------------------------------------- | 1084 //----- (0041C047) -------------------------------------------------------- |
1356 void GameUI_Footer_2() | 1085 void GameUI_Footer_2() |
1357 { | 1086 { |
1358 char *v1; // edx@2 | 1087 char *v1; // edx@2 |
1359 int v5; // eax@5 | 1088 int v5; // eax@5 |
1360 | 1089 |
1361 pRenderer->DrawTextureRGB(0, 352, pTexture_StatusBar); | 1090 pRenderer->DrawTextureRGB(0, 352, pTexture_StatusBar); |
1362 if (GameUI_Footer_TimeLeft) | 1091 if (GameUI_Footer_TimeLeft) |
1363 v1 = GameUI_Footer_TimedString.data(); | 1092 v1 = GameUI_Footer_TimedString.data(); |
1364 else | 1093 else |
1373 } | 1102 } |
1374 | 1103 |
1375 //----- (0041C0B8) -------------------------------------------------------- | 1104 //----- (0041C0B8) -------------------------------------------------------- |
1376 void GameUI_SetFooterString(const char *pStr) | 1105 void GameUI_SetFooterString(const char *pStr) |
1377 { | 1106 { |
1378 const char *v1; // esi@1 | 1107 const char *v1; // esi@1 |
1379 int i; // eax@7 | 1108 |
1380 int j; // eax@11 | 1109 v1 = pStr; |
1381 | 1110 if ( pStr && strcmp(pStr, "test") && !IsBadStringPtrA(pStr, 1) && (*v1 || GameUI_Footer_TimeLeft) ) |
1382 v1 = pStr; | 1111 { |
1383 if ( pStr && strcmp(pStr, "test") && !IsBadStringPtrA(v1, 1) && (*v1 || GameUI_Footer_TimeLeft) ) | 1112 if ( GameUI_Footer_TimeLeft ) |
1384 { | 1113 { |
1385 if ( GameUI_Footer_TimeLeft ) | 1114 for ( int i = pFontLucida->GetLineWidth(GameUI_Footer_TimedString.data()); i > 450; i = pFontLucida->GetLineWidth(GameUI_Footer_TimedString.data()) ) |
1386 { | 1115 GameUI_Footer_TimedString[strlen(GameUI_Footer_TimedString.data()) - 1] = 0; |
1387 for ( i = pFontLucida->GetLineWidth(GameUI_Footer_TimedString.data()); | 1116 } |
1388 i > 450; | 1117 else |
1389 i = pFontLucida->GetLineWidth(GameUI_Footer_TimedString.data()) ) | 1118 { |
1390 GameUI_Footer_TimedString[strlen(GameUI_Footer_TimedString.data()) - 1] = 0; | 1119 strcpy(pFooterString.data(), v1); |
1391 } | 1120 for ( int j = pFontLucida->GetLineWidth(pFooterString.data()); j > 450; j = pFontLucida->GetLineWidth(pFooterString.data()) ) |
1392 else | 1121 pFooterString[strlen(pFooterString.data()) - 1] = 0; |
1393 { | 1122 } |
1394 strcpy(pFooterString.data(), v1); | 1123 } |
1395 for ( j = pFontLucida->GetLineWidth(pFooterString.data()); | 1124 } |
1396 j > 450; | |
1397 j = pFontLucida->GetLineWidth(pFooterString.data()) ) | |
1398 pFooterString[strlen(pFooterString.data()) - 1] = 0; | |
1399 } | |
1400 } | |
1401 } | |
1402 | 1125 |
1403 //----- (0041C179) -------------------------------------------------------- | 1126 //----- (0041C179) -------------------------------------------------------- |
1404 void GameUI_Footer() | 1127 void GameUI_Footer() |
1405 { | 1128 { |
1406 //unsigned int v0; // ebp@1 | 1129 char *v1; // edi@5 |
1407 char *v1; // edi@5 | 1130 int v2; // eax@5 |
1408 int v2; // eax@5 | 1131 int v6; // eax@9 |
1409 unsigned int v3; // esi@5 | 1132 char v9; // zf@12 |
1410 size_t v4; // eax@6 | 1133 |
1411 GUIFont *v5; // ecx@6 | 1134 if ( pFooterString[0] || GameUI_Footer_TimeLeft || bForceDrawFooter ) |
1412 int v6; // eax@9 | 1135 { |
1413 size_t v7; // eax@10 | 1136 pRenderer->DrawTextureRGB(0, 352, pTexture_StatusBar); |
1414 GUIFont *v8; // ecx@10 | 1137 if ( GameUI_Footer_TimeLeft ) |
1415 char v9; // zf@12 | 1138 { |
1416 //unsigned int v10; // ST08_4@13 | 1139 v1 = GameUI_Footer_TimedString.data(); |
1417 int v11; // eax@13 | 1140 v2 = pFontLucida->GetLineWidth(GameUI_Footer_TimedString.data()); |
1418 | 1141 while ( v2 > 450 ) |
1419 if ( pFooterString[0] || GameUI_Footer_TimeLeft || bForceDrawFooter ) | 1142 { |
1420 { | 1143 GameUI_Footer_TimedString[strlen(GameUI_Footer_TimedString.data()) - 1] = 0; |
1421 pRenderer->DrawTextureRGB(0, 352u, pTexture_StatusBar); | 1144 v2 = pFontLucida->GetLineWidth(GameUI_Footer_TimedString.data()); |
1422 if ( GameUI_Footer_TimeLeft ) | 1145 } |
1423 { | 1146 } |
1424 v1 = GameUI_Footer_TimedString.data(); | 1147 else |
1425 v2 = pFontLucida->GetLineWidth(GameUI_Footer_TimedString.data()); | 1148 { |
1426 v3 = 450; | 1149 v1 = pFooterString.data(); |
1427 while ( v2 > 450 ) | 1150 v6 = pFontLucida->GetLineWidth(pFooterString.data()); |
1428 { | 1151 while ( v6 > 450 ) |
1429 v4 = strlen(GameUI_Footer_TimedString.data()); | 1152 { |
1430 v5 = pFontLucida; | 1153 pFooterString[strlen(pFooterString.data()) - 1] = 0; |
1431 GameUI_Footer_TimedString[v4 - 1] = 0; | 1154 v6 = pFontLucida->GetLineWidth(pFooterString.data()); |
1432 v2 = pFontLucida->GetLineWidth(GameUI_Footer_TimedString.data()); | 1155 } |
1433 } | 1156 } |
1434 } | 1157 v9 = *v1 == 0; |
1435 else | 1158 bForceDrawFooter = 0; |
1436 { | 1159 if ( !v9 ) |
1437 v1 = pFooterString.data(); | 1160 pPrimaryWindow->DrawText(pFontLucida, pFontLucida->AlignText_Center(450, v1) + 11, 357, uGameUIFontMain, v1, 0, 0, uGameUIFontShadow); |
1438 v6 = pFontLucida->GetLineWidth(pFooterString.data()); | 1161 } |
1439 v3 = 450; | 1162 } |
1440 while ( v6 > 450 ) | |
1441 { | |
1442 v7 = strlen(pFooterString.data()); | |
1443 v8 = pFontLucida; | |
1444 pFooterString[v7 - 1] = 0; | |
1445 v6 = pFontLucida->GetLineWidth(pFooterString.data()); | |
1446 } | |
1447 } | |
1448 v9 = *v1 == 0; | |
1449 bForceDrawFooter = 0; | |
1450 if ( !v9 ) | |
1451 { | |
1452 v11 = pFontLucida->AlignText_Center(v3, v1); | |
1453 pPrimaryWindow->DrawText(pFontLucida, v11 + 11, 357, uGameUIFontMain, v1, 0, 0, uGameUIFontShadow); | |
1454 } | |
1455 } | |
1456 } | |
1457 // 5C35BC: using guessed type int bForceDrawFooter; | 1163 // 5C35BC: using guessed type int bForceDrawFooter; |
1458 | |
1459 | |
1460 //----- (00420EFF) -------------------------------------------------------- | 1164 //----- (00420EFF) -------------------------------------------------------- |
1461 void GameUI_WritePointedObjectStatusString() | 1165 void GameUI_WritePointedObjectStatusString() |
1462 { | 1166 { |
1463 int v1; // ebx@6 | 1167 int v1; // ebx@6 |
1464 GUIWindow *pWindow; // edi@7 | 1168 GUIWindow *pWindow; // edi@7 |
1469 int v7; // ecx@19 | 1173 int v7; // ecx@19 |
1470 __int16 v8; // fps@23 | 1174 __int16 v8; // fps@23 |
1471 unsigned __int8 v9; // c0@23 | 1175 unsigned __int8 v9; // c0@23 |
1472 unsigned __int8 v10; // c3@23 | 1176 unsigned __int8 v10; // c3@23 |
1473 enum UIMessageType pMessageType1; // esi@24 | 1177 enum UIMessageType pMessageType1; // esi@24 |
1474 //int v12; // edx@25 | |
1475 char *v13; // ecx@28 | 1178 char *v13; // ecx@28 |
1476 int v14; // eax@41 | 1179 int v14; // eax@41 |
1477 ItemGen *pItemGen; // ecx@44 | 1180 ItemGen *pItemGen; // ecx@44 |
1478 int v16; // ecx@46 | 1181 int v16; // ecx@46 |
1479 const char *v17; // eax@49 | 1182 const char *v17; // eax@49 |
1491 char *v28; // esi@82 | 1194 char *v28; // esi@82 |
1492 int v29; // eax@82 | 1195 int v29; // eax@82 |
1493 signed int v30; // ecx@88 | 1196 signed int v30; // ecx@88 |
1494 const char *v31; // eax@91 | 1197 const char *v31; // eax@91 |
1495 __int16 v32; // fps@109 | 1198 __int16 v32; // fps@109 |
1496 //unsigned __int8 v33; // c0@109 | |
1497 //unsigned __int8 v34; // c3@109 | |
1498 enum UIMessageType pMessageType2; // esi@110 | 1199 enum UIMessageType pMessageType2; // esi@110 |
1499 //int v36; // edx@111 | |
1500 enum UIMessageType pMessageType3; // edx@117 | 1200 enum UIMessageType pMessageType3; // edx@117 |
1501 //int v38; // ecx@118 | |
1502 const char *v39; // [sp-8h] [bp-E8h]@20 | 1201 const char *v39; // [sp-8h] [bp-E8h]@20 |
1503 char *v40; // [sp-8h] [bp-E8h]@83 | 1202 char *v40; // [sp-8h] [bp-E8h]@83 |
1504 int v41; // [sp-4h] [bp-E4h]@20 | 1203 int v41; // [sp-4h] [bp-E4h]@20 |
1505 char Str1[200]; // [sp+Ch] [bp-D4h]@129 | 1204 char Str1[200]; // [sp+Ch] [bp-D4h]@129 |
1506 unsigned int pX; // [sp+D4h] [bp-Ch]@1 | 1205 unsigned int pX; // [sp+D4h] [bp-Ch]@1 |
1507 unsigned int pY; // [sp+D8h] [bp-8h]@1 | 1206 unsigned int pY; // [sp+D8h] [bp-8h]@1 |
1508 unsigned int v45; // [sp+DCh] [bp-4h]@21 | 1207 unsigned int v45; // [sp+DCh] [bp-4h]@21 |
1509 | 1208 |
1510 v13 = nullptr; | 1209 v13 = nullptr; |
1511 | |
1512 pMouse->uPointingObjectID = 0; | 1210 pMouse->uPointingObjectID = 0; |
1513 pMouse->GetClickPos(&pX, &pY); | 1211 pMouse->GetClickPos(&pX, &pY); |
1514 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 ) | 1212 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 ) |
1515 return; | 1213 return; |
1516 if (pCurrentScreen == SCREEN_GAME) | 1214 if (pCurrentScreen == SCREEN_GAME) |
1524 || (signed int)pX > (signed int)pViewport->uScreen_BR_X | 1222 || (signed int)pX > (signed int)pViewport->uScreen_BR_X |
1525 || (signed int)pY < (signed int)pViewport->uScreen_TL_Y | 1223 || (signed int)pY < (signed int)pViewport->uScreen_TL_Y |
1526 || (signed int)pY > (signed int)pViewport->uScreen_BR_Y ) | 1224 || (signed int)pY > (signed int)pViewport->uScreen_BR_Y ) |
1527 v18 = -1; | 1225 v18 = -1; |
1528 if ( v18 == -1 ) | 1226 if ( v18 == -1 ) |
1529 //goto LABEL_61; | |
1530 { | 1227 { |
1531 pMouse->uPointingObjectID = 0; | 1228 pMouse->uPointingObjectID = 0; |
1532 if ( pMouse->uPointingObjectID == 0 ) | 1229 if ( pMouse->uPointingObjectID == 0 ) |
1533 { | 1230 { |
1534 if ( uLastPointedObjectID != 0 ) | 1231 if ( uLastPointedObjectID != 0 ) |
1540 uLastPointedObjectID = pMouse->uPointingObjectID; | 1237 uLastPointedObjectID = pMouse->uPointingObjectID; |
1541 return; | 1238 return; |
1542 } | 1239 } |
1543 } | 1240 } |
1544 else | 1241 else |
1545 { | |
1546 v18 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]]; | 1242 v18 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]]; |
1547 } | |
1548 pMouse->uPointingObjectID = (unsigned __int16)v18; | 1243 pMouse->uPointingObjectID = (unsigned __int16)v18; |
1549 v19 = (signed)PID_ID(v18); | 1244 v19 = (signed)PID_ID(v18); |
1550 if (PID_TYPE(v18) == OBJECT_Item) | 1245 if (PID_TYPE(v18) == OBJECT_Item) |
1551 { | 1246 { |
1552 v30 = v19; | 1247 v30 = v19; |
1553 if ( pObjectList->pObjects[pSpriteObjects[v30].uObjectDescID].uFlags & 0x10 ) | 1248 if ( pObjectList->pObjects[pSpriteObjects[v30].uObjectDescID].uFlags & 0x10 ) |
1554 //goto LABEL_73; | |
1555 { | 1249 { |
1556 pMouse->uPointingObjectID = 0; | 1250 pMouse->uPointingObjectID = 0; |
1557 //goto LABEL_50; | |
1558 uLastPointedObjectID = 1; | 1251 uLastPointedObjectID = 1; |
1559 if ( pMouse->uPointingObjectID == 0 ) | 1252 if ( pMouse->uPointingObjectID == 0 ) |
1560 { | 1253 { |
1561 if ( uLastPointedObjectID != 0 ) | 1254 if ( uLastPointedObjectID != 0 ) |
1562 { | 1255 { |
1568 return; | 1261 return; |
1569 } | 1262 } |
1570 if ( v18 >= (signed int)0x2000000u || pParty->pPickedItem.uItemID ) | 1263 if ( v18 >= (signed int)0x2000000u || pParty->pPickedItem.uItemID ) |
1571 { | 1264 { |
1572 v22 = pSpriteObjects[v30].stru_24.GetDisplayName(); | 1265 v22 = pSpriteObjects[v30].stru_24.GetDisplayName(); |
1573 //LABEL_93: | 1266 GameUI_SetFooterString(v22); |
1574 v26 = v22; | |
1575 //goto LABEL_87; | |
1576 GameUI_SetFooterString(v26); | |
1577 if ( pMouse->uPointingObjectID == 0 ) | 1267 if ( pMouse->uPointingObjectID == 0 ) |
1578 { | 1268 { |
1579 if ( uLastPointedObjectID != 0 ) | 1269 if ( uLastPointedObjectID != 0 ) |
1580 { | 1270 { |
1581 pFooterString[0] = 0; | 1271 pFooterString[0] = 0; |
1602 { | 1292 { |
1603 if ( v23->IsInteractive() ) | 1293 if ( v23->IsInteractive() ) |
1604 v26 = pNPCTopics[stru_5E4C90._decor_events[v24->_idx_in_stru123 - 75] + 379].pTopic; | 1294 v26 = pNPCTopics[stru_5E4C90._decor_events[v24->_idx_in_stru123 - 75] + 379].pTopic; |
1605 else | 1295 else |
1606 v26 = pDecorationList->pDecorations[v24->uDecorationDescID].field_20; | 1296 v26 = pDecorationList->pDecorations[v24->uDecorationDescID].field_20; |
1607 //goto LABEL_87; | |
1608 GameUI_SetFooterString(v26); | 1297 GameUI_SetFooterString(v26); |
1609 if ( pMouse->uPointingObjectID == 0 ) | 1298 if ( pMouse->uPointingObjectID == 0 ) |
1610 { | 1299 { |
1611 if ( uLastPointedObjectID != 0 ) | 1300 if ( uLastPointedObjectID != 0 ) |
1612 { | 1301 { |
1617 uLastPointedObjectID = pMouse->uPointingObjectID; | 1306 uLastPointedObjectID = pMouse->uPointingObjectID; |
1618 return; | 1307 return; |
1619 } | 1308 } |
1620 v22 = GetEventHintString(v25); | 1309 v22 = GetEventHintString(v25); |
1621 if ( !v22 ) | 1310 if ( !v22 ) |
1622 //goto _return; | |
1623 { | 1311 { |
1624 if ( pMouse->uPointingObjectID == 0 ) | 1312 if ( pMouse->uPointingObjectID == 0 ) |
1625 { | 1313 { |
1626 if ( uLastPointedObjectID != 0 ) | 1314 if ( uLastPointedObjectID != 0 ) |
1627 { | 1315 { |
1630 } | 1318 } |
1631 } | 1319 } |
1632 uLastPointedObjectID = pMouse->uPointingObjectID; | 1320 uLastPointedObjectID = pMouse->uPointingObjectID; |
1633 return; | 1321 return; |
1634 } | 1322 } |
1635 //goto LABEL_93; | 1323 GameUI_SetFooterString(v22); |
1636 v26 = v22; | |
1637 //goto LABEL_87; | |
1638 GameUI_SetFooterString(v26); | |
1639 if ( pMouse->uPointingObjectID == 0 ) | 1324 if ( pMouse->uPointingObjectID == 0 ) |
1640 { | 1325 { |
1641 if ( uLastPointedObjectID != 0 ) | 1326 if ( uLastPointedObjectID != 0 ) |
1642 { | 1327 { |
1643 pFooterString[0] = 0; | 1328 pFooterString[0] = 0; |
1651 { | 1336 { |
1652 if ( HIWORD(v18) < 512) | 1337 if ( HIWORD(v18) < 512) |
1653 { | 1338 { |
1654 if ( uCurrentlyLoadedLevelType != LEVEL_Indoor) | 1339 if ( uCurrentlyLoadedLevelType != LEVEL_Indoor) |
1655 { | 1340 { |
1656 v18b = (signed int)(unsigned __int16)v18 >> 9; | 1341 v18b = (signed int)(unsigned __int16)v18 >> 9; |
1657 v21 = pOutdoor->pBModels[v18b].pFaces[v19 & 0x3F].sCogTriggeredID; | 1342 v21 = pOutdoor->pBModels[v18b].pFaces[v19 & 0x3F].sCogTriggeredID; |
1658 //goto LABEL_71; | |
1659 if ( !v21 || (v22 = GetEventHintString(v21)) == 0 ) | 1343 if ( !v21 || (v22 = GetEventHintString(v21)) == 0 ) |
1660 //goto LABEL_73; | |
1661 { | 1344 { |
1662 pMouse->uPointingObjectID = 0; | 1345 pMouse->uPointingObjectID = 0; |
1663 //goto LABEL_50; | |
1664 uLastPointedObjectID = 1; | 1346 uLastPointedObjectID = 1; |
1665 if ( pMouse->uPointingObjectID == 0 ) | 1347 if ( pMouse->uPointingObjectID == 0 ) |
1666 { | 1348 { |
1667 if ( uLastPointedObjectID != 0 ) | 1349 if ( uLastPointedObjectID != 0 ) |
1668 { | 1350 { |
1671 } | 1353 } |
1672 } | 1354 } |
1673 uLastPointedObjectID = pMouse->uPointingObjectID; | 1355 uLastPointedObjectID = pMouse->uPointingObjectID; |
1674 return; | 1356 return; |
1675 } | 1357 } |
1676 //goto LABEL_93; | 1358 GameUI_SetFooterString(v22); |
1677 v26 = v22; | |
1678 //goto LABEL_87; | |
1679 GameUI_SetFooterString(v26); | |
1680 if ( pMouse->uPointingObjectID == 0 ) | 1359 if ( pMouse->uPointingObjectID == 0 ) |
1681 { | 1360 { |
1682 if ( uLastPointedObjectID != 0 ) | 1361 if ( uLastPointedObjectID != 0 ) |
1683 { | 1362 { |
1684 pFooterString[0] = 0; | 1363 pFooterString[0] = 0; |
1690 } | 1369 } |
1691 pFace = &pIndoor->pFaces[v19]; | 1370 pFace = &pIndoor->pFaces[v19]; |
1692 if ( BYTE3(pFace->uAttributes) & 6 ) | 1371 if ( BYTE3(pFace->uAttributes) & 6 ) |
1693 { | 1372 { |
1694 v21 = pIndoor->pFaceExtras[pFace->uFaceExtraID].uEventID; | 1373 v21 = pIndoor->pFaceExtras[pFace->uFaceExtraID].uEventID; |
1695 //LABEL_71: | |
1696 if ( !v21 || (v22 = GetEventHintString(v21)) == 0 ) | 1374 if ( !v21 || (v22 = GetEventHintString(v21)) == 0 ) |
1697 //goto LABEL_73; | |
1698 { | 1375 { |
1699 pMouse->uPointingObjectID = 0; | 1376 pMouse->uPointingObjectID = 0; |
1700 //goto LABEL_50; | |
1701 uLastPointedObjectID = 1; | 1377 uLastPointedObjectID = 1; |
1702 if ( pMouse->uPointingObjectID == 0 ) | 1378 if ( pMouse->uPointingObjectID == 0 ) |
1703 { | 1379 { |
1704 if ( uLastPointedObjectID != 0 ) | 1380 if ( uLastPointedObjectID != 0 ) |
1705 { | 1381 { |
1708 } | 1384 } |
1709 } | 1385 } |
1710 uLastPointedObjectID = pMouse->uPointingObjectID; | 1386 uLastPointedObjectID = pMouse->uPointingObjectID; |
1711 return; | 1387 return; |
1712 } | 1388 } |
1713 //goto LABEL_93; | 1389 GameUI_SetFooterString(v22); |
1714 v26 = v22; | |
1715 //goto LABEL_87; | |
1716 GameUI_SetFooterString(v26); | |
1717 if ( pMouse->uPointingObjectID == 0 ) | 1390 if ( pMouse->uPointingObjectID == 0 ) |
1718 { | 1391 { |
1719 if ( uLastPointedObjectID != 0 ) | 1392 if ( uLastPointedObjectID != 0 ) |
1720 { | 1393 { |
1721 pFooterString[0] = 0; | 1394 pFooterString[0] = 0; |
1724 } | 1397 } |
1725 uLastPointedObjectID = pMouse->uPointingObjectID; | 1398 uLastPointedObjectID = pMouse->uPointingObjectID; |
1726 return; | 1399 return; |
1727 } | 1400 } |
1728 } | 1401 } |
1729 //LABEL_73: | |
1730 pMouse->uPointingObjectID = 0; | 1402 pMouse->uPointingObjectID = 0; |
1731 //goto LABEL_50; | |
1732 uLastPointedObjectID = 1; | 1403 uLastPointedObjectID = 1; |
1733 if ( pMouse->uPointingObjectID == 0 ) | 1404 if ( pMouse->uPointingObjectID == 0 ) |
1734 { | 1405 { |
1735 if ( uLastPointedObjectID != 0 ) | 1406 if ( uLastPointedObjectID != 0 ) |
1736 { | 1407 { |
1739 } | 1410 } |
1740 } | 1411 } |
1741 uLastPointedObjectID = pMouse->uPointingObjectID; | 1412 uLastPointedObjectID = pMouse->uPointingObjectID; |
1742 return; | 1413 return; |
1743 } | 1414 } |
1744 //LABEL_61: | |
1745 pMouse->uPointingObjectID = 0; | 1415 pMouse->uPointingObjectID = 0; |
1746 //goto _return; | |
1747 if ( pMouse->uPointingObjectID == 0 ) | 1416 if ( pMouse->uPointingObjectID == 0 ) |
1748 { | 1417 { |
1749 if ( uLastPointedObjectID != 0 ) | 1418 if ( uLastPointedObjectID != 0 ) |
1750 { | 1419 { |
1751 pFooterString[0] = 0; | 1420 pFooterString[0] = 0; |
1754 } | 1423 } |
1755 uLastPointedObjectID = pMouse->uPointingObjectID; | 1424 uLastPointedObjectID = pMouse->uPointingObjectID; |
1756 return; | 1425 return; |
1757 } | 1426 } |
1758 if ( v18 >= 335544320 ) | 1427 if ( v18 >= 335544320 ) |
1759 //goto LABEL_61; | |
1760 { | 1428 { |
1761 pMouse->uPointingObjectID = 0; | 1429 pMouse->uPointingObjectID = 0; |
1762 if ( pMouse->uPointingObjectID == 0 ) | 1430 if ( pMouse->uPointingObjectID == 0 ) |
1763 { | 1431 { |
1764 if ( uLastPointedObjectID != 0 ) | 1432 if ( uLastPointedObjectID != 0 ) |
1778 else | 1446 else |
1779 v40 = pMonsterStats->pInfos[pActor->pMonsterInfo.uID].pName; | 1447 v40 = pMonsterStats->pInfos[pActor->pMonsterInfo.uID].pName; |
1780 strncpy(pTmpBuf.data(), v40, 0x7D0u); | 1448 strncpy(pTmpBuf.data(), v40, 0x7D0u); |
1781 } | 1449 } |
1782 v26 = v28; | 1450 v26 = v28; |
1783 //LABEL_87: | |
1784 GameUI_SetFooterString(v26); | 1451 GameUI_SetFooterString(v26); |
1785 //goto _return; | |
1786 if ( pMouse->uPointingObjectID == 0 ) | 1452 if ( pMouse->uPointingObjectID == 0 ) |
1787 { | 1453 { |
1788 if ( uLastPointedObjectID != 0 ) | 1454 if ( uLastPointedObjectID != 0 ) |
1789 { | 1455 { |
1790 pFooterString[0] = 0; | 1456 pFooterString[0] = 0; |
1814 if ( (signed int)pX >= (signed int)pButton->uX | 1480 if ( (signed int)pX >= (signed int)pButton->uX |
1815 && (signed int)pX <= (signed int)pButton->uZ | 1481 && (signed int)pX <= (signed int)pButton->uZ |
1816 && (signed int)pY >= (signed int)pButton->uY | 1482 && (signed int)pY >= (signed int)pButton->uY |
1817 && (signed int)pY <= (signed int)pButton->uW ) | 1483 && (signed int)pY <= (signed int)pButton->uW ) |
1818 { | 1484 { |
1819 //LABEL_24: | |
1820 pMessageType1 = (UIMessageType)pButton->field_1C; | 1485 pMessageType1 = (UIMessageType)pButton->field_1C; |
1821 if ( pMessageType1 ) | 1486 if ( pMessageType1 ) |
1822 { | 1487 { |
1823 pMessageQueue_50CBD0->AddMessage(pMessageType1, pButton->msg_param, 0); | 1488 pMessageQueue_50CBD0->AddMessage(pMessageType1, pButton->msg_param, 0); |
1824 } | 1489 } |
1825 //LABEL_28: | |
1826 v13 = pButton->pButtonName; | 1490 v13 = pButton->pButtonName; |
1827 //_set_status_and_ret: | |
1828 GameUI_SetFooterString(v13); | 1491 GameUI_SetFooterString(v13); |
1829 //LABEL_131: | |
1830 uLastPointedObjectID = 1; | 1492 uLastPointedObjectID = 1; |
1831 return; | 1493 return; |
1832 } | 1494 } |
1833 } | 1495 } |
1834 else | 1496 else |
1860 && (signed int)pX >= (signed int)pButton->uX | 1522 && (signed int)pX >= (signed int)pButton->uX |
1861 && (signed int)pX <= (signed int)pButton->uZ | 1523 && (signed int)pX <= (signed int)pButton->uZ |
1862 && (signed int)pY >= (signed int)pButton->uY | 1524 && (signed int)pY >= (signed int)pButton->uY |
1863 && (signed int)pY <= (signed int)pButton->uW ) | 1525 && (signed int)pY <= (signed int)pButton->uW ) |
1864 { | 1526 { |
1865 //LABEL_19: | |
1866 pPlayer = pPlayers[uActiveCharacter]; | 1527 pPlayer = pPlayers[uActiveCharacter]; |
1867 v5 = LOBYTE(pPlayer->pActiveSkills[pButton->msg_param]); | 1528 v5 = LOBYTE(pPlayer->pActiveSkills[pButton->msg_param]); |
1868 v6 = pPlayer->uSkillPoints; | 1529 v6 = pPlayer->uSkillPoints; |
1869 v7 = (v5 & 0x3F) + 1; | 1530 v7 = (v5 & 0x3F) + 1; |
1870 if ( v6 < v7 ) | 1531 if ( v6 < v7 ) |
1877 v41 = v7; | 1538 v41 = v7; |
1878 v39 = pGlobalTXT_LocalizationStrings[468];// "Clicking here will spend %d Skill Points" | 1539 v39 = pGlobalTXT_LocalizationStrings[468];// "Clicking here will spend %d Skill Points" |
1879 } | 1540 } |
1880 sprintf(Str1, v39, v41); | 1541 sprintf(Str1, v39, v41); |
1881 v13 = Str1; | 1542 v13 = Str1; |
1882 //goto _set_status_and_ret; | |
1883 GameUI_SetFooterString(v13); | 1543 GameUI_SetFooterString(v13); |
1884 uLastPointedObjectID = 1; | 1544 uLastPointedObjectID = 1; |
1885 return; | 1545 return; |
1886 } | 1546 } |
1887 } | 1547 } |
1900 if ( uNumVisibleWindows <= 0 || (uNumVisibleWindows > 0 && pWindow->uFrameHeight != 480 && v1 <= 0)) | 1560 if ( uNumVisibleWindows <= 0 || (uNumVisibleWindows > 0 && pWindow->uFrameHeight != 480 && v1 <= 0)) |
1901 { | 1561 { |
1902 if ( pCurrentScreen == SCREEN_CHEST ) | 1562 if ( pCurrentScreen == SCREEN_CHEST ) |
1903 { | 1563 { |
1904 ChestUI_WritePointedObjectStatusString(); | 1564 ChestUI_WritePointedObjectStatusString(); |
1905 //goto _return; | |
1906 if ( pMouse->uPointingObjectID == 0 ) | 1565 if ( pMouse->uPointingObjectID == 0 ) |
1907 { | 1566 { |
1908 if ( uLastPointedObjectID != 0 ) | 1567 if ( uLastPointedObjectID != 0 ) |
1909 { | 1568 { |
1910 pFooterString[0] = 0; | 1569 pFooterString[0] = 0; |
1917 if ( pCurrentScreen == SCREEN_HOUSE ) | 1576 if ( pCurrentScreen == SCREEN_HOUSE ) |
1918 { | 1577 { |
1919 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD | 1578 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD |
1920 || (v16 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]], v16 == 0) | 1579 || (v16 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]], v16 == 0) |
1921 || v16 == -65536 ) | 1580 || v16 == -65536 ) |
1922 //goto _return; | |
1923 { | 1581 { |
1924 if ( pMouse->uPointingObjectID == 0 ) | 1582 if ( pMouse->uPointingObjectID == 0 ) |
1925 { | 1583 { |
1926 if ( uLastPointedObjectID != 0 ) | 1584 if ( uLastPointedObjectID != 0 ) |
1927 { | 1585 { |
1931 } | 1589 } |
1932 uLastPointedObjectID = pMouse->uPointingObjectID; | 1590 uLastPointedObjectID = pMouse->uPointingObjectID; |
1933 return; | 1591 return; |
1934 } | 1592 } |
1935 pItemGen = (ItemGen *)((char *)&pParty->pPickedItem + 36 * (v16 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 4); | 1593 pItemGen = (ItemGen *)((char *)&pParty->pPickedItem + 36 * (v16 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 4); |
1936 //LABEL_49: | |
1937 v17 = pItemGen->GetDisplayName(); | 1594 v17 = pItemGen->GetDisplayName(); |
1938 GameUI_SetFooterString(v17); | 1595 GameUI_SetFooterString(v17); |
1939 //LABEL_50: | |
1940 uLastPointedObjectID = 1; | 1596 uLastPointedObjectID = 1; |
1941 //_return: | |
1942 if ( pMouse->uPointingObjectID == 0 ) | 1597 if ( pMouse->uPointingObjectID == 0 ) |
1943 { | 1598 { |
1944 if ( uLastPointedObjectID != 0 ) | 1599 if ( uLastPointedObjectID != 0 ) |
1945 { | 1600 { |
1946 pFooterString[0] = 0; | 1601 pFooterString[0] = 0; |
1952 } | 1607 } |
1953 if ( (signed int)pY < 350 ) | 1608 if ( (signed int)pY < 350 ) |
1954 { | 1609 { |
1955 v14 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]]; | 1610 v14 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]]; |
1956 if ( v14 == 0 || v14 == -65536 || (unsigned int)v14 >= 0x1388 ) | 1611 if ( v14 == 0 || v14 == -65536 || (unsigned int)v14 >= 0x1388 ) |
1957 //goto _return; | |
1958 { | 1612 { |
1959 if ( pMouse->uPointingObjectID == 0 ) | 1613 if ( pMouse->uPointingObjectID == 0 ) |
1960 { | 1614 { |
1961 if ( uLastPointedObjectID != 0 ) | 1615 if ( uLastPointedObjectID != 0 ) |
1962 { | 1616 { |
1966 } | 1620 } |
1967 uLastPointedObjectID = pMouse->uPointingObjectID; | 1621 uLastPointedObjectID = pMouse->uPointingObjectID; |
1968 return; | 1622 return; |
1969 } | 1623 } |
1970 pItemGen = (ItemGen *)&pPlayers[uActiveCharacter]->pInventoryItemList[v14-1]; | 1624 pItemGen = (ItemGen *)&pPlayers[uActiveCharacter]->pInventoryItemList[v14-1]; |
1971 //goto LABEL_49; | |
1972 v17 = pItemGen->GetDisplayName(); | 1625 v17 = pItemGen->GetDisplayName(); |
1973 GameUI_SetFooterString(v17); | 1626 GameUI_SetFooterString(v17); |
1974 uLastPointedObjectID = 1; | 1627 uLastPointedObjectID = 1; |
1975 if ( pMouse->uPointingObjectID == 0 ) | 1628 if ( pMouse->uPointingObjectID == 0 ) |
1976 { | 1629 { |
1998 && (signed int)pY >= (signed int)pButton->uY | 1651 && (signed int)pY >= (signed int)pButton->uY |
1999 && (signed int)pY <= (signed int)pButton->uW ) | 1652 && (signed int)pY <= (signed int)pButton->uW ) |
2000 { | 1653 { |
2001 pMessageType3 = (UIMessageType)pButton->field_1C; | 1654 pMessageType3 = (UIMessageType)pButton->field_1C; |
2002 if ( pMessageType3 == 0 ) // For books | 1655 if ( pMessageType3 == 0 ) // For books |
2003 //goto LABEL_28; | |
2004 { | 1656 { |
2005 v13 = pButton->pButtonName; | 1657 v13 = pButton->pButtonName; |
2006 GameUI_SetFooterString(v13); | 1658 GameUI_SetFooterString(v13); |
2007 uLastPointedObjectID = 1; | 1659 uLastPointedObjectID = 1; |
2008 return; | 1660 return; |
2009 } | 1661 } |
2010 | 1662 |
2011 pMessageQueue_50CBD0->AddMessage(pMessageType3, pButton->msg_param, 0); | 1663 pMessageQueue_50CBD0->AddMessage(pMessageType3, pButton->msg_param, 0); |
2012 //goto LABEL_131; | |
2013 uLastPointedObjectID = 1; | 1664 uLastPointedObjectID = 1; |
2014 return; | 1665 return; |
2015 } | 1666 } |
2016 } | 1667 } |
2017 else | 1668 else |
2032 //{ | 1683 //{ |
2033 pMessageType2 = (UIMessageType)pButton->field_1C; | 1684 pMessageType2 = (UIMessageType)pButton->field_1C; |
2034 if ( pMessageType2 != 0 ) | 1685 if ( pMessageType2 != 0 ) |
2035 pMessageQueue_50CBD0->AddMessage(pMessageType2, pButton->msg_param, 0); | 1686 pMessageQueue_50CBD0->AddMessage(pMessageType2, pButton->msg_param, 0); |
2036 | 1687 |
2037 //goto LABEL_28; | |
2038 v13 = pButton->pButtonName; | 1688 v13 = pButton->pButtonName; |
2039 GameUI_SetFooterString(v13); | 1689 GameUI_SetFooterString(v13); |
2040 uLastPointedObjectID = 1; | 1690 uLastPointedObjectID = 1; |
2041 return; | 1691 return; |
2042 //} | 1692 //} |
2048 if ( pButton->uButtonType == 3 | 1698 if ( pButton->uButtonType == 3 |
2049 && (signed int)pX >= (signed int)pButton->uX | 1699 && (signed int)pX >= (signed int)pButton->uX |
2050 && (signed int)pX <= (signed int)pButton->uZ | 1700 && (signed int)pX <= (signed int)pButton->uZ |
2051 && (signed int)pY >= (signed int)pButton->uY | 1701 && (signed int)pY >= (signed int)pButton->uY |
2052 && (signed int)pY <= (signed int)pButton->uW ) | 1702 && (signed int)pY <= (signed int)pButton->uW ) |
2053 //goto LABEL_19; | |
2054 { | 1703 { |
2055 pPlayer = pPlayers[uActiveCharacter]; | 1704 pPlayer = pPlayers[uActiveCharacter]; |
2056 v5 = LOBYTE(pPlayer->pActiveSkills[pButton->msg_param]); | 1705 v5 = LOBYTE(pPlayer->pActiveSkills[pButton->msg_param]); |
2057 v6 = pPlayer->uSkillPoints; | 1706 v6 = pPlayer->uSkillPoints; |
2058 v7 = (v5 & 0x3F) + 1; | 1707 v7 = (v5 & 0x3F) + 1; |
2066 v41 = v7; | 1715 v41 = v7; |
2067 v39 = pGlobalTXT_LocalizationStrings[468];// "Clicking here will spend %d Skill Points" | 1716 v39 = pGlobalTXT_LocalizationStrings[468];// "Clicking here will spend %d Skill Points" |
2068 } | 1717 } |
2069 sprintf(Str1, v39, v41); | 1718 sprintf(Str1, v39, v41); |
2070 v13 = Str1; | 1719 v13 = Str1; |
2071 //goto _set_status_and_ret; | |
2072 GameUI_SetFooterString(v13); | 1720 GameUI_SetFooterString(v13); |
2073 uLastPointedObjectID = 1; | 1721 uLastPointedObjectID = 1; |
2074 return; | 1722 return; |
2075 } | 1723 } |
2076 } | 1724 } |
2077 } | 1725 } |
2078 } | 1726 } |
2079 } | 1727 } |
2080 pMouse->uPointingObjectID = sub_46A99B(); | 1728 pMouse->uPointingObjectID = sub_46A99B(); |
2081 //goto _return; | |
2082 if ( pMouse->uPointingObjectID == 0 ) | 1729 if ( pMouse->uPointingObjectID == 0 ) |
2083 { | 1730 { |
2084 if ( uLastPointedObjectID != 0 ) | 1731 if ( uLastPointedObjectID != 0 ) |
2085 { | 1732 { |
2086 pFooterString[0] = 0; | 1733 pFooterString[0] = 0; |
2089 } | 1736 } |
2090 uLastPointedObjectID = pMouse->uPointingObjectID; | 1737 uLastPointedObjectID = pMouse->uPointingObjectID; |
2091 return; | 1738 return; |
2092 } | 1739 } |
2093 } | 1740 } |
2094 | |
2095 | 1741 |
2096 //----- (0044158F) -------------------------------------------------------- | 1742 //----- (0044158F) -------------------------------------------------------- |
2097 void GameUI_DrawCharacterSelectionFrame() | 1743 void GameUI_DrawCharacterSelectionFrame() |
2098 { | 1744 { |
2099 if ( uActiveCharacter ) | 1745 if ( uActiveCharacter ) |
2100 pRenderer->DrawTextureTransparent(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[uActiveCharacter - 1] - 9, 380, | 1746 pRenderer->DrawTextureTransparent(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[uActiveCharacter - 1] - 9, 380, |
2101 pIcons_LOD->GetTexture(uTextureID_GameUI_CharSelectionFrame)); | 1747 pIcons_LOD->GetTexture(uTextureID_GameUI_CharSelectionFrame)); |
2102 } | 1748 } |
2103 | 1749 |
2104 | |
2105 | |
2106 //----- (0044162D) -------------------------------------------------------- | 1750 //----- (0044162D) -------------------------------------------------------- |
2107 void GameUI_DrawPartySpells() | 1751 void GameUI_DrawPartySpells() |
2108 { | 1752 { |
2109 unsigned int v0; // ebp@1 | 1753 unsigned int v0; // ebp@1 |
2110 //signed int v1; // edi@1 | |
2111 //int v2; // eax@2 | |
2112 //int v3; // ecx@5 | |
2113 //__int16 *v4; // ebx@25 | |
2114 //Player *v5; // edi@26 | |
2115 //unsigned int v6; // [sp-4h] [bp-1Ch]@11 | |
2116 Texture *v7; // [sp-4h] [bp-1Ch]@12 | 1754 Texture *v7; // [sp-4h] [bp-1Ch]@12 |
2117 //unsigned int v8; // [sp-4h] [bp-1Ch]@20 | |
2118 Texture *v9; // [sp-4h] [bp-1Ch]@21 | 1755 Texture *v9; // [sp-4h] [bp-1Ch]@21 |
2119 //Player **v10; // [sp+10h] [bp-8h]@25 | |
2120 | 1756 |
2121 v0 = (signed __int64)((double)GetTickCount() * 0.050000001); | 1757 v0 = (signed __int64)((double)GetTickCount() * 0.050000001); |
2122 //v1 = 0; | 1758 //v1 = 0; |
2123 for (uint i = 0; i < 14; ++i) | 1759 for (uint i = 0; i < 14; ++i) |
2124 { | 1760 { |
2173 pRenderer->DrawTextureIndexed(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 72, 410, pIcons_LOD->GetTexture(uTextureID_PlayerBuff_Preservation)); | 1809 pRenderer->DrawTextureIndexed(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 72, 410, pIcons_LOD->GetTexture(uTextureID_PlayerBuff_Preservation)); |
2174 if (player->pPlayerBuffs[PLAYER_BUFF_PAIN_REFLECTION].uExpireTime) | 1810 if (player->pPlayerBuffs[PLAYER_BUFF_PAIN_REFLECTION].uExpireTime) |
2175 pRenderer->DrawTextureIndexed(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 72, 444, pIcons_LOD->GetTexture(uTextureID_PlayerBuff_PainReflection)); | 1811 pRenderer->DrawTextureIndexed(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 72, 444, pIcons_LOD->GetTexture(uTextureID_PlayerBuff_PainReflection)); |
2176 } | 1812 } |
2177 } | 1813 } |
2178 | |
2179 | |
2180 | 1814 |
2181 //----- (004921C1) -------------------------------------------------------- | 1815 //----- (004921C1) -------------------------------------------------------- |
2182 void GameUI_DrawPortraits(unsigned int _this) | 1816 void GameUI_DrawPortraits(unsigned int _this) |
2183 { | 1817 { |
2184 Texture *pFace; // eax@10 | 1818 Texture *pFace; // eax@10 |