comparison UI/UiGame.cpp @ 1496:ab6bf38b2940

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