Mercurial > mm7
annotate UI/UiGame.cpp @ 2224:c2eeeb991a87
some more pvs warning fixes
author | Grumpy7 |
---|---|
date | Wed, 19 Feb 2014 22:26:10 +0100 |
parents | d9caf2b3d8d5 |
children | 080fd5a5433d |
rev | line source |
---|---|
1299 | 1 #include "..\Texture.h" |
2 #include "..\MM7.h" | |
1298 | 3 |
1299 | 4 #include "..\Mouse.h" |
5 #include "..\Keyboard.h" | |
6 #include "..\mm7_data.h" | |
1298 | 7 |
1299 | 8 #include "..\Vis.h" |
9 #include "..\MapInfo.h" | |
10 #include "..\Game.h" | |
11 #include "..\GUIWindow.h" | |
12 #include "..\GUIFont.h" | |
13 #include "..\Party.h" | |
14 #include "..\AudioPlayer.h" | |
15 #include "..\Outdoor.h" | |
16 #include "..\LOD.h" | |
17 #include "..\Actor.h" | |
18 #include "..\Viewport.h" | |
19 #include "..\SpriteObject.h" | |
20 #include "..\ObjectList.h" | |
21 #include "..\DecorationList.h" | |
22 #include "..\PlayerFrameTable.h" | |
23 #include "..\stru123.h" | |
2044 | 24 #include "..\Timer.h" |
1299 | 25 #include "..\IconFrameTable.h" |
26 #include "..\TurnEngine.h" | |
27 #include "..\texts.h" | |
1298 | 28 #include "UIHouses.h" |
1299 | 29 #include "..\BSPModel.h" |
2073 | 30 #include "..\OurMath.h" |
1828
35c1e4ff6ba7
party_finds_gold to Party::PartyFindsGold, cleaned up, moved Level/Decoration.h reference out of Indoor.h
Grumpy7
parents:
1827
diff
changeset
|
31 #include "..\Level/Decoration.h" |
1298 | 32 |
33 | |
34 int uTextureID_GameUI_CharSelectionFrame; // 50C98C | |
35 | |
36 //----- (00421D00) -------------------------------------------------------- | |
37 void __fastcall GameUI_OnPlayerPortraitLeftClick(unsigned int uPlayerID) | |
38 { | |
1980 | 39 Player* player = &pParty->pPlayers[uPlayerID - 1]; |
1298 | 40 if (pParty->pPickedItem.uItemID) |
41 { | |
1980 | 42 if (int slot = player->AddItem(-1, pParty->pPickedItem.uItemID)) |
1298 | 43 { |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1362
diff
changeset
|
44 memcpy(&player->pInventoryItemList[slot-1], &pParty->pPickedItem, 0x24u); |
1298 | 45 viewparams->bRedrawGameUI = true; |
46 pMouse->RemoveHoldingItem(); | |
47 return; | |
48 } | |
49 | |
50 if (!player->CanAct()) | |
51 { | |
52 player = pPlayers[uActiveCharacter]; | |
53 } | |
1496 | 54 if( player->CanAct() || !pPlayers[uActiveCharacter]->CanAct() ) |
55 player->PlaySound(SPEECH_NoRoom, 0); | |
1298 | 56 } |
57 | |
58 if (pCurrentScreen == SCREEN_GAME) | |
59 { | |
60 viewparams->bRedrawGameUI = true; | |
61 if ( uActiveCharacter != uPlayerID ) | |
62 { | |
63 if ( pPlayers[uPlayerID]->uTimeToRecovery ) | |
64 return; | |
65 | |
66 uActiveCharacter = uPlayerID; | |
67 return; | |
68 } | |
1496 | 69 pGUIWindow_CurrentMenu = CharacterUI_Initialize(7); |
1298 | 70 return; |
71 } | |
72 if ( pCurrentScreen == SCREEN_SPELL_BOOK ) | |
73 return; | |
74 if ( pCurrentScreen == SCREEN_CHEST ) | |
75 { | |
76 viewparams->bRedrawGameUI = true; | |
77 if ( uActiveCharacter == uPlayerID ) | |
78 { | |
79 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 103; | |
80 pCurrentScreen = SCREEN_CHEST_INVENTORY; | |
81 uActiveCharacter = uPlayerID; | |
82 return; | |
83 } | |
84 if ( pPlayers[uPlayerID]->uTimeToRecovery ) | |
85 return; | |
86 uActiveCharacter = uPlayerID; | |
87 return; | |
88 } | |
89 if ( pCurrentScreen != SCREEN_HOUSE ) | |
90 { | |
91 if ( pCurrentScreen == SCREEN_E ) | |
92 { | |
93 uActiveCharacter = uPlayerID; | |
94 return; | |
95 } | |
96 if ( pCurrentScreen != SCREEN_CHEST_INVENTORY ) | |
97 { | |
98 viewparams->bRedrawGameUI = true; | |
99 uActiveCharacter = uPlayerID; | |
100 if ( pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] == 102 ) | |
101 FillAwardsData(); | |
102 return; | |
103 } | |
104 viewparams->bRedrawGameUI = true; | |
105 if ( uActiveCharacter == uPlayerID ) | |
106 { | |
107 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 103; | |
108 pCurrentScreen = SCREEN_CHEST_INVENTORY; | |
109 uActiveCharacter = uPlayerID; | |
110 return; | |
111 } | |
112 if ( pPlayers[uPlayerID]->uTimeToRecovery ) | |
113 return; | |
114 uActiveCharacter = uPlayerID; | |
115 return; | |
116 } | |
117 if ( window_SpeakInHouse->receives_keyboard_input_2 == WINDOW_INPUT_IN_PROGRESS) | |
118 return; | |
119 viewparams->bRedrawGameUI = true; | |
120 if ( uActiveCharacter != uPlayerID ) | |
2224 | 121 { |
1298 | 122 uActiveCharacter = uPlayerID; |
123 return; | |
2224 | 124 } |
1298 | 125 if (dialog_menu_id == HOUSE_DIALOGUE_SHOP_BUY_STANDARD || dialog_menu_id == HOUSE_DIALOGUE_SHOP_6) |
126 { | |
127 __debugbreak(); // fix indexing | |
128 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 103; | |
1496 | 129 pGUIWindow_CurrentMenu = CharacterUI_Initialize(14); |
1298 | 130 return; |
131 } | |
132 } | |
133 // 4E28F8: using guessed type int pCurrentScreen; | |
134 // F8B19C: using guessed type int dword_F8B19C; | |
135 | |
136 //----- (00416B01) -------------------------------------------------------- | |
137 void GameUI_DrawNPCPopup(void *_this)//PopupWindowForBenefitAndJoinText | |
138 { | |
139 int v1; // edi@2 | |
1496 | 140 NPCData *pNPC; // eax@16 |
141 const CHAR *pText; // eax@18 | |
1298 | 142 char *v11; // esi@26 |
1496 | 143 GUIWindow popup_window; // [sp+Ch] [bp-60h]@23 |
1298 | 144 int a2; // [sp+60h] [bp-Ch]@16 |
145 LPCSTR lpsz; // [sp+68h] [bp-4h]@6 | |
146 | |
147 if ( bNoNPCHiring != 1 ) | |
148 { | |
149 v1 = 0; | |
150 /*do | |
151 { | |
152 if ( v3->pName ) | |
153 pTmpBuf[v1++] = v2; | |
154 ++v3; | |
155 ++v2; | |
156 } | |
157 while ( (signed int)v3 < (signed int)&pParty->pPickedItem );*/ | |
158 for (int i = 0; i < 2; ++i) | |
159 { | |
160 if (pParty->pHirelings[i].pName) | |
161 pTmpBuf[v1++] = i; | |
162 } | |
163 lpsz = 0; | |
164 if ( (signed int)pNPCStats->uNumNewNPCs > 0 ) | |
165 { | |
166 /*v4 = pNPCStats->pNewNPCData; | |
167 do | |
168 { | |
169 if ( v4->uFlags & 0x80 | |
170 && (!pParty->pHirelings[0].pName || strcmp(v4->pName, pParty->pHirelings[0].pName)) | |
171 && (!pParty->pHirelings[1].pName || strcmp(v4->pName, pParty->pHirelings[1].pName)) ) | |
172 pTmpBuf[v1++] = (char)lpsz + 2; | |
173 ++lpsz; | |
174 ++v4; | |
175 } | |
176 while ( (signed int)lpsz < (signed int)pNPCStats->uNumNewNPCs );*/ | |
1523
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
177 for ( uint i = 0; i < pNPCStats->uNumNewNPCs; ++i ) |
1298 | 178 { |
179 if (pNPCStats->pNewNPCData[i].Hired()) | |
180 { | |
181 if (!pParty->pHirelings[0].pName || strcmp((char *)pNPCStats->pNewNPCData[i].pName, (char *)pParty->pHirelings[0].pName)) | |
182 { | |
183 if (!pParty->pHirelings[1].pName || strcmp((char *)pNPCStats->pNewNPCData[i].pName, (char *)pParty->pHirelings[1].pName)) | |
184 pTmpBuf[v1++] = i + 2; | |
185 } | |
186 } | |
187 } | |
188 } | |
1793
4dee76d79c78
dword_5B65CC to npcIdToDismissAfterDialogue, Party::field_709 to Party::hirelingScrollPosition
Grumpy7
parents:
1758
diff
changeset
|
189 if ( (signed int)((char *)_this + pParty->hirelingScrollPosition) < v1 ) |
1298 | 190 { |
1793
4dee76d79c78
dword_5B65CC to npcIdToDismissAfterDialogue, Party::field_709 to Party::hirelingScrollPosition
Grumpy7
parents:
1758
diff
changeset
|
191 sDialogue_SpeakingActorNPC_ID = -1 - pParty->hirelingScrollPosition - (int)_this; |
1496 | 192 pNPC = GetNewNPCData(sDialogue_SpeakingActorNPC_ID, &a2); |
193 if ( pNPC ) | |
1298 | 194 { |
195 if ( a2 == 57 ) | |
1496 | 196 pText = pNPCTopics[512].pText; // Baby dragon |
1298 | 197 else |
1496 | 198 pText = (const CHAR *)pNPCStats->pProfessions[pNPC->uProfession].pBenefits; |
199 lpsz = pText; | |
200 if ( !pText ) | |
1298 | 201 { |
1496 | 202 lpsz = (LPCSTR)pNPCStats->pProfessions[pNPC->uProfession].pJoinText; |
1298 | 203 if ( !lpsz ) |
204 lpsz = ""; | |
205 } | |
1496 | 206 popup_window.Hint = 0; |
207 popup_window.uFrameX = 38; | |
208 popup_window.uFrameY = 60; | |
209 popup_window.uFrameWidth = 276; | |
210 popup_window.uFrameZ = 313; | |
211 popup_window.uFrameHeight = pFontArrus->CalcTextHeight(lpsz, &popup_window, 0, 0) + 2 * LOBYTE(pFontArrus->uFontHeight) + 24; | |
212 if ( (signed int)popup_window.uFrameHeight < 130 ) | |
213 popup_window.uFrameHeight = 130; | |
214 popup_window.uFrameWidth = 400; | |
215 popup_window.uFrameZ = popup_window.uFrameX + 399; | |
216 popup_window.DrawMessageBox(0); | |
217 sprintfex(pTmpBuf2.data(), "NPC%03d", pNPC->uPortraitID); | |
218 pRenderer->DrawTextureIndexed(popup_window.uFrameX + 22, popup_window.uFrameY + 36, | |
219 (Texture *)(pIcons_LOD->LoadTexture(pTmpBuf2.data(), TEXTURE_16BIT_PALETTE) != -1 | |
220 ? &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(pTmpBuf2.data(), TEXTURE_16BIT_PALETTE)] : 0)); | |
221 if ( pNPC->uProfession ) | |
1298 | 222 { |
223 v11 = pTmpBuf.data(); | |
1496 | 224 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[429], pNPC->pName, aNPCProfessionNames[pNPC->uProfession]); |
1298 | 225 } |
226 else | |
227 { | |
228 v11 = pTmpBuf.data(); | |
1496 | 229 strcpy(pTmpBuf.data(), pNPC->pName); |
1298 | 230 } |
2069 | 231 popup_window.DrawTitleText(pFontArrus, 0, 12, Color16(0xFFu, 0xFFu, 0x9Bu), v11, 3); |
1496 | 232 popup_window.uFrameWidth -= 24; |
233 popup_window.uFrameZ = popup_window.uFrameX + popup_window.uFrameWidth - 1; | |
234 popup_window.DrawText(pFontArrus, 100, 36, 0, BuildDialogueString((char *)lpsz, uActiveCharacter - 1, 0, 0, 0, 0), 0, 0, 0); | |
1298 | 235 } |
236 } | |
237 } | |
238 } | |
239 | |
240 //----- (00445D4A) -------------------------------------------------------- | |
241 void GameUI_InitializeDialogue(Actor *actor, int bPlayerSaysHello) | |
242 { | |
243 NPCData *pNPCInfo; // ebp@1 | |
244 int v9; // esi@8 | |
245 int pNumberContacts; // eax@11 | |
246 char pContainer[32]; // [sp+14h] [bp-28h]@3 | |
247 | |
248 dword_A74CDC = -1; | |
249 dword_AE336C = -1; | |
250 pEventTimer->Pause(); | |
251 pMiscTimer->Pause(); | |
252 pAudioPlayer->StopChannels(-1, -1); | |
253 uDialogueType = 0; | |
254 sDialogue_SpeakingActorNPC_ID = actor->sNPC_ID; | |
255 pDialogue_SpeakingActor = actor; | |
256 pNPCInfo = GetNPCData(actor->sNPC_ID); | |
257 if ( (pNPCInfo->uFlags & 3) != 2 ) | |
258 pNPCInfo->uFlags = pNPCInfo->uFlags + 1; | |
259 | |
260 switch (pParty->alignment) | |
261 { | |
262 case PartyAlignment_Good: sprintfex(pContainer, "evt%02d-b", const_2()); break; | |
263 case PartyAlignment_Neutral: sprintfex(pContainer, "evt%02d", const_2()); break; | |
264 case PartyAlignment_Evil: sprintfex(pContainer, "evt%02d-c", const_2()); break; | |
265 } | |
266 | |
267 pDialogueNPCCount = 0; | |
268 uNumDialogueNPCPortraits = 1; | |
269 pTexture_Dialogue_Background = pIcons_LOD->LoadTexturePtr(pContainer, TEXTURE_16BIT_PALETTE); | |
270 sprintfex(pContainer, "npc%03u", pNPCInfo->uPortraitID); | |
271 v9 = 0; | |
272 pDialogueNPCPortraits[0] = pIcons_LOD->LoadTexturePtr(pContainer, TEXTURE_16BIT_PALETTE); | |
273 dword_591084 = areWeLoadingTexture; | |
274 uTextureID_right_panel_loop = uTextureID_right_panel; | |
275 if ( !pNPCInfo->Hired() && pNPCInfo->Location2D >= 0 ) | |
276 { | |
277 if ( (signed int)pParty->GetPartyFame() <= pNPCInfo->fame | |
278 || (pNumberContacts = pNPCInfo->uFlags & 0xFFFFFF7F, (pNumberContacts & 0x80000000u) != 0) ) | |
279 { | |
280 v9 = 1; | |
281 } | |
282 else | |
283 { | |
284 if ( pNumberContacts > 1 ) | |
285 { | |
286 if ( pNumberContacts == 2 ) | |
287 { | |
288 v9 = 3; | |
289 } | |
290 else | |
291 { | |
292 if ( pNumberContacts != 3 ) | |
293 { | |
294 if ( pNumberContacts != 4 ) | |
295 v9 = 1; | |
296 } | |
297 else | |
298 { | |
299 v9 = 2; | |
300 } | |
301 } | |
302 } | |
303 else if ( pNPCInfo->rep ) | |
304 { | |
305 v9 = 2; | |
306 } | |
307 } | |
308 } | |
309 if (sDialogue_SpeakingActorNPC_ID < 0) | |
310 v9 = 4; | |
2115 | 311 pDialogueWindow = GUIWindow::Create(0, 0, 640, 480, WINDOW_Dialogue, 3, 0);//pNumberContacts = 1, v9 = 0; pNumberContacts = 2, v9 = 3; |
312 if (pNPCInfo->Hired() && !pNPCInfo->bHasUsedTheAbility) | |
1298 | 313 { |
2115 | 314 if (pNPCInfo->uProfession == 10 || //Healer |
315 pNPCInfo->uProfession == 11 || //Expert Healer | |
316 pNPCInfo->uProfession == 12 || //Master Healer | |
317 pNPCInfo->uProfession == 33 || //Cook | |
318 pNPCInfo->uProfession == 34 || //Chef | |
319 pNPCInfo->uProfession == 39 || //Wind Master | |
320 pNPCInfo->uProfession == 40 || //Water Master | |
321 pNPCInfo->uProfession == 41 || //Gate Master | |
322 pNPCInfo->uProfession == 42 || //Chaplain | |
323 pNPCInfo->uProfession == 43 || //Piper | |
324 pNPCInfo->uProfession == 52 //Fallen Wizard | |
325 ) | |
1298 | 326 { |
2115 | 327 pDialogueWindow->CreateButton(480, 250, 140, LOBYTE(pFontArrus->uFontHeight) - 3, 1, 0, UIMSG_SelectNPCDialogueOption, 9, 0, "", 0); |
328 pDialogueWindow->_41D08F_set_keyboard_control_group(4, 1, 0, 1); | |
1298 | 329 } |
330 } | |
331 | |
332 pDialogueWindow->CreateButton( 61, 424, 31, 40, 2, 94, UIMSG_SelectCharacter, 1, '1', "", 0); | |
333 pDialogueWindow->CreateButton(177, 424, 31, 40, 2, 94, UIMSG_SelectCharacter, 2, '2', "", 0); | |
334 pDialogueWindow->CreateButton(292, 424, 31, 40, 2, 94, UIMSG_SelectCharacter, 3, '3', "", 0); | |
335 pDialogueWindow->CreateButton(407, 424, 31, 40, 2, 94, UIMSG_SelectCharacter, 4, '4', "", 0); | |
336 | |
337 if (bPlayerSaysHello && uActiveCharacter && !pNPCInfo->Hired()) | |
338 { | |
339 if (pParty->uCurrentHour < 5 || pParty->uCurrentHour > 21) | |
340 pPlayers[uActiveCharacter]->PlaySound(SPEECH_GoodEvening, 0); | |
341 else | |
342 pPlayers[uActiveCharacter]->PlaySound(SPEECH_GoodDay, 0); | |
343 } | |
344 } | |
345 | |
346 //----- (00445350) -------------------------------------------------------- | |
347 void GameUI_DrawDialogue() | |
348 { | |
349 NPCData *pNPC; // ebx@2 | |
350 int pGreetType; // eax@2 | |
1496 | 351 int pTextHeight; // esi@39 |
352 GUIButton *pButton; // eax@43 | |
1672 | 353 int all_text_height; // ebx@93 |
354 signed int index; // esi@99 | |
1298 | 355 int v42; // edi@102 |
1672 | 356 int v45; |
1496 | 357 unsigned __int16 pTextColor; // ax@104 |
358 GUIWindow window; // [sp+ACh] [bp-68h]@42 | |
1298 | 359 GUIFont *pOutString; // [sp+10Ch] [bp-8h]@39 |
1838 | 360 const char *pInString=NULL; // [sp+110h] [bp-4h]@32 |
1298 | 361 |
362 if ( !pDialogueWindow ) | |
363 return; | |
364 | |
1496 | 365 // Window title(Çàãîëîâîê îêíà)---- |
366 memcpy(&window, pDialogueWindow, sizeof(window)); | |
1298 | 367 pNPC = GetNPCData(sDialogue_SpeakingActorNPC_ID); |
368 pGreetType = GetGreetType(sDialogue_SpeakingActorNPC_ID); | |
1496 | 369 window.uFrameWidth -= 10; |
370 window.uFrameZ -= 10; | |
1298 | 371 pRenderer->DrawTextureIndexed(477, 0, pTexture_Dialogue_Background); |
372 pRenderer->DrawTextureTransparent(468, 0, (Texture *)(uTextureID_right_panel_loop != -1 ? &pIcons_LOD->pTextures[uTextureID_right_panel_loop] : 0)); | |
373 pRenderer->DrawTextureIndexed(pNPCPortraits_x[0][0] - 4, pNPCPortraits_y[0][0] - 4, (Texture *)(uTextureID_50795C != -1 ? &pIcons_LOD->pTextures[uTextureID_50795C] : 0)); | |
374 pRenderer->DrawTextureIndexed(pNPCPortraits_x[0][0], pNPCPortraits_y[0][0], pDialogueNPCPortraits[0]); | |
375 | |
376 if (pNPC->uProfession) | |
377 { | |
378 assert(pNPC->uProfession < sizeof(aNPCProfessionNames) / sizeof(*aNPCProfessionNames.data())); // sometimes buffer overflows; errors emerge both here and in dialogue text | |
379 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[429], pNPC->pName, aNPCProfessionNames[pNPC->uProfession]);//^Pi[%s] %s | |
380 } | |
1983 | 381 else if (pNPC->pName) |
1298 | 382 strcpy(pTmpBuf.data(), pNPC->pName); |
383 | |
1496 | 384 window.DrawTitleText(pFontArrus, 483, 112, ui_game_dialogue_npc_name_color, pTmpBuf.data(), 3); |
1298 | 385 pParty->GetPartyFame(); |
386 | |
387 pInString = nullptr; | |
388 switch (uDialogueType) | |
389 { | |
390 case DIALOGUE_13: | |
1666 | 391 pInString = BuildDialogueString(pNPCStats->pProfessions[pNPC->uProfession].pJoinText, uActiveCharacter - 1, 0, 0, 0, 0); |
1298 | 392 break; |
393 | |
394 case DIALOGUE_PROFESSION_DETAILS: | |
395 { | |
1661 | 396 //auto prof = pNPCStats->pProfessions[pNPC->uProfession]; |
1298 | 397 |
398 if (dialogue_show_profession_details) | |
1661 | 399 pInString = BuildDialogueString(pNPCStats->pProfessions[pNPC->uProfession].pBenefits, uActiveCharacter - 1, 0, 0, 0, 0); |
1298 | 400 else if (pNPC->Hired()) |
1661 | 401 pInString = BuildDialogueString(pNPCStats->pProfessions[pNPC->uProfession].pDismissText, uActiveCharacter - 1, 0, 0, 0, 0); |
1298 | 402 else |
1661 | 403 pInString = BuildDialogueString(pNPCStats->pProfessions[pNPC->uProfession].pJoinText, uActiveCharacter - 1, 0, 0, 0, 0); |
1298 | 404 } |
405 break; | |
406 | |
407 | |
408 case DIALOGUE_ARENA_WELCOME: | |
409 pInString = pGlobalTXT_LocalizationStrings[574]; // "Welcome to the Arena of Life and Death. Remember, you are only allowed one arena combat per visit. To fight an arena battle, select the option that best describes your abilities and return to me- if you survive:" | |
410 break; | |
411 | |
412 case DIALOGUE_ARENA_FIGHT_NOT_OVER_YET: | |
413 pInString = pGlobalTXT_LocalizationStrings[577]; //"Get back in there you wimps:" | |
414 break; | |
415 | |
416 case DIALOGUE_ARENA_REWARD: | |
417 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[576], gold_transaction_amount);// "Congratulations on your win: here's your stuff: %u gold." | |
418 pInString = pTmpBuf.data(); | |
419 break; | |
420 | |
421 case DIALOGUE_ARENA_ALREADY_WON: | |
422 pInString = pGlobalTXT_LocalizationStrings[582]; // "You already won this trip to the Arena:" | |
423 break; | |
424 | |
425 default: | |
2102 | 426 if (uDialogueType > DIALOGUE_18 && uDialogueType < DIALOGUE_EVT_E && !byte_5B0938[0]) |
1298 | 427 { |
428 pInString = (char *)current_npc_text; | |
429 } | |
430 else if (pGreetType == 1)//QuestNPC_greet | |
431 { | |
432 if (pNPC->greet) | |
433 { | |
434 if ((pNPC->uFlags & 3) == 2) | |
1655 | 435 pInString = pNPCStats->pNPCGreetings[pNPC->greet].pGreeting2; |
1298 | 436 else |
1655 | 437 pInString = pNPCStats->pNPCGreetings[pNPC->greet].pGreeting1; |
1298 | 438 } |
439 } | |
440 else if (pGreetType == 2)//HiredNPC_greet | |
441 { | |
1980 | 442 NPCProfession* prof = &pNPCStats->pProfessions[pNPC->uProfession]; |
1298 | 443 |
444 if (pNPC->Hired()) | |
1410
38df78aba732
deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents:
1407
diff
changeset
|
445 pInString = BuildDialogueString(prof->pDismissText, uActiveCharacter - 1, 0, 0, 0, 0); |
1298 | 446 else |
1410
38df78aba732
deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents:
1407
diff
changeset
|
447 pInString = BuildDialogueString(prof->pJoinText, uActiveCharacter - 1, 0, 0, 0, 0); |
1298 | 448 } |
449 break; | |
450 } | |
451 | |
1496 | 452 // Message window(Îêíî ñîîáùåíèÿ)---- |
1298 | 453 if (pInString) |
454 { | |
1496 | 455 window.uFrameWidth = game_viewport_width; |
456 window.uFrameZ = 452; | |
1980 | 457 GUIFont* font = pFontArrus; |
1496 | 458 pTextHeight = pFontArrus->CalcTextHeight(pInString, &window, 13, 0) + 7; |
459 if ( 352 - pTextHeight < 8 ) | |
1298 | 460 { |
461 font = pFontCreate; | |
1496 | 462 pTextHeight = pFontCreate->CalcTextHeight(pInString, &window, 13, 0) + 7; |
1298 | 463 } |
464 if (uTextureID_Leather != -1) | |
1496 | 465 pRenderer->GetLeather(8, 352 - pTextHeight, &pIcons_LOD->pTextures[uTextureID_Leather], pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight - pTextHeight); |
466 pRenderer->DrawTextureIndexed(8, 347 - pTextHeight, pTexture_591428); | |
467 pDialogueWindow->DrawText(font, 13, 354 - pTextHeight, 0, FitTextInAWindow(pInString, font, &window, 13, 0), 0, 0, 0); | |
1298 | 468 } |
1496 | 469 // Right panel(Ïðàâàÿ ïàíåëü)------- |
470 memcpy(&window, pDialogueWindow, sizeof(window)); | |
471 window.uFrameX = 483; | |
472 window.uFrameWidth = 148; | |
473 window.uFrameZ = 334; | |
474 for (int i = window.pStartingPosActiveItem; i < window.pStartingPosActiveItem + window.pNumPresenceButton; ++i) | |
1298 | 475 { |
1496 | 476 pButton = window.GetControl(i); |
477 if ( !pButton ) | |
1298 | 478 break; |
479 | |
1496 | 480 if ( pButton->msg_param > 88 ) |
481 pButton->pButtonName[0] = 0; | |
482 else if (pButton->msg_param == 88) | |
483 strcpy(pButton->pButtonName, pGlobalTXT_LocalizationStrings[581]); // Lord | |
484 else if (pButton->msg_param == 87) | |
485 strcpy(pButton->pButtonName, pGlobalTXT_LocalizationStrings[580]); // Knight | |
486 else if (pButton->msg_param == 86) | |
487 strcpy(pButton->pButtonName, pGlobalTXT_LocalizationStrings[579]); // Squire | |
488 else if (pButton->msg_param == 85) | |
489 strcpy(pButton->pButtonName, pGlobalTXT_LocalizationStrings[578]); // Page | |
490 else if (pButton->msg_param == 77) | |
491 strcpy(pButton->pButtonName, pGlobalTXT_LocalizationStrings[407]); // Details | |
492 else if (pButton->msg_param == 76) | |
1298 | 493 { |
494 if (pNPC->Hired()) | |
1496 | 495 sprintf(pButton->pButtonName, (const char*)pGlobalTXT_LocalizationStrings[408], pNPC->pName); // Release %s |
1298 | 496 else |
1496 | 497 strcpy(pButton->pButtonName, pGlobalTXT_LocalizationStrings[406]); // Hire |
1298 | 498 } |
1496 | 499 else if (pButton->msg_param == 24) |
1298 | 500 { |
501 __debugbreak(); // learn conditions of this event | |
1645 | 502 if (!pNPC->evt_F) |
503 { | |
504 pButton->pButtonName[0] = 0; | |
505 pButton->msg_param = 0; | |
506 } | |
507 else | |
508 strcpy(pButton->pButtonName, pNPCTopics[pNPC->evt_F].pTopic); | |
509 } | |
510 else if (pButton->msg_param == 9) | |
511 strcpy(pButton->pButtonName, GetProfessionActionText(pNPC->uProfession)); | |
512 else if (pButton->msg_param == 19) // Scavenger Hunt | |
513 { | |
514 if (!pNPC->evt_A) | |
1298 | 515 { |
1496 | 516 pButton->pButtonName[0] = 0; |
517 pButton->msg_param = 0; | |
1298 | 518 } |
519 else | |
1645 | 520 strcpy(pButton->pButtonName, pNPCTopics[pNPC->evt_A].pTopic); |
1298 | 521 } |
1645 | 522 else if (pButton->msg_param == 20) // Scavenger Hunt |
1496 | 523 { |
1645 | 524 if (!pNPC->evt_B) |
1298 | 525 { |
1496 | 526 pButton->pButtonName[0] = 0; |
527 pButton->msg_param = 0; | |
1298 | 528 } |
1645 | 529 else strcpy(pButton->pButtonName, pNPCTopics[pNPC->evt_B].pTopic); |
1496 | 530 } |
531 else if (pButton->msg_param == 21) | |
532 { | |
1298 | 533 //__debugbreak(); // learn conditions of this event |
1645 | 534 if (!pNPC->evt_C) |
1298 | 535 { |
1496 | 536 pButton->pButtonName[0] = 0; |
537 pButton->msg_param = 0; | |
1298 | 538 } |
1645 | 539 else strcpy(pButton->pButtonName, pNPCTopics[pNPC->evt_C].pTopic); |
1496 | 540 } |
541 else if (pButton->msg_param == 22) | |
542 { | |
1298 | 543 //__debugbreak(); // learn conditions of this event |
1645 | 544 if (!pNPC->evt_D) |
1298 | 545 { |
1496 | 546 pButton->pButtonName[0] = 0; |
547 pButton->msg_param = 0; | |
1298 | 548 } |
1645 | 549 else strcpy(pButton->pButtonName, pNPCTopics[pNPC->evt_D].pTopic); |
1496 | 550 } |
551 else if (pButton->msg_param == 23) | |
552 { | |
1298 | 553 //__debugbreak(); // learn conditions of this event |
1645 | 554 if (!pNPC->evt_E) |
1298 | 555 { |
1496 | 556 pButton->pButtonName[0] = 0; |
557 pButton->msg_param = 0; | |
1298 | 558 } |
1645 | 559 else strcpy(pButton->pButtonName, pNPCTopics[pNPC->evt_E].pTopic); |
1496 | 560 } |
561 else if (pButton->msg_param == 13) | |
562 { | |
1298 | 563 if (pNPC->Hired()) |
1496 | 564 sprintf(pButton->pButtonName, pGlobalTXT_LocalizationStrings[408], pNPC->pName); // Release %s |
1298 | 565 else |
1496 | 566 strcpy(pButton->pButtonName, pGlobalTXT_LocalizationStrings[122]); // Join |
567 } | |
568 else | |
569 pButton->pButtonName[0] = 0; | |
1298 | 570 |
571 if (pParty->field_7B5_in_arena_quest && pParty->field_7B5_in_arena_quest != -1) | |
572 { | |
573 int num_dead_actors = 0; | |
574 pInString = 0; | |
1496 | 575 for ( uint i = 0; i < uNumActors; ++i ) |
1298 | 576 { |
1496 | 577 if (pActors[i].uAIState == Dead || pActors[i].uAIState == Removed || pActors[i].uAIState == Disabled) |
1298 | 578 ++num_dead_actors; |
579 else | |
580 { | |
581 int sumonner_type = PID_TYPE(pActors[i].uSummonerID); | |
582 if (sumonner_type == OBJECT_Player) | |
583 ++num_dead_actors; | |
584 } | |
585 } | |
586 if (num_dead_actors == uNumActors) | |
1496 | 587 strcpy(pButton->pButtonName, pGlobalTXT_LocalizationStrings[658]); // Collect Prize |
1298 | 588 } |
589 } | |
590 | |
1496 | 591 // Install Buttons(Óñòàíîâêà êíîïîê)-------- |
1672 | 592 index = 0; |
593 all_text_height = 0; | |
594 for ( int i = pDialogueWindow->pStartingPosActiveItem; | |
595 i < pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton; ++i ) | |
1298 | 596 { |
1610 | 597 pButton = pDialogueWindow->GetControl(i); |
1496 | 598 if ( !pButton ) |
1298 | 599 break; |
1672 | 600 all_text_height += pFontArrus->CalcTextHeight(pButton->pButtonName, &window, 0, 0); |
601 index++; | |
1298 | 602 } |
1672 | 603 if ( index ) |
1298 | 604 { |
1672 | 605 v45 = (174 - all_text_height) / index; |
606 if ( v45 > 32 ) | |
607 v45 = 32; | |
608 v42 = (174 - v45 * index - all_text_height)/ 2 - v45 / 2 + 138; | |
609 for ( int i = pDialogueWindow->pStartingPosActiveItem; | |
610 i < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem; ++i ) | |
1298 | 611 { |
1672 | 612 pButton = pDialogueWindow->GetControl(i); |
613 if ( !pButton ) | |
614 break; | |
615 pButton->uY = (unsigned int)(v45 + v42); | |
616 pTextHeight = pFontArrus->CalcTextHeight(pButton->pButtonName, &window, 0, 0); | |
617 pButton->uHeight = pTextHeight; | |
618 v42 = pButton->uY + pTextHeight - 1; | |
619 pButton->uW = v42; | |
2000 | 620 pTextColor = ui_game_dialogue_option_normal_color; |
621 if ( pDialogueWindow->pCurrentPosActiveItem == i ) | |
622 pTextColor = ui_game_dialogue_option_highlight_color; | |
1672 | 623 window.DrawTitleText(pFontArrus, 0, pButton->uY, pTextColor, pButton->pButtonName, 3); |
1298 | 624 } |
625 } | |
626 pRenderer->DrawTextureIndexed(471, 445, pIcons_LOD->GetTexture(uExitCancelTextureId)); | |
627 } | |
628 | |
629 //----- (00444FBE) -------------------------------------------------------- | |
630 void GameUI_DrawBranchlessDialogue() | |
631 { | |
1496 | 632 int pTextHeight; // esi@4 |
1298 | 633 char Str[200]; // [sp+Ch] [bp-120h]@12 |
1496 | 634 GUIWindow BranchlessDlg_window; // [sp+D4h] [bp-58h]@4 |
1298 | 635 GUIFont *pFont; // [sp+128h] [bp-4h]@1 |
636 | |
637 pFont = pFontArrus; | |
638 if ( current_npc_text && !byte_5B0938[0] ) | |
639 strcpy(byte_5B0938.data(), current_npc_text); | |
1496 | 640 BranchlessDlg_window.uFrameWidth = game_viewport_width; |
641 BranchlessDlg_window.uFrameZ = 452; | |
642 pTextHeight = pFontArrus->CalcTextHeight(byte_5B0938.data(), &BranchlessDlg_window, 12, 0) + 7; | |
643 if ( 352 - pTextHeight < 8 ) | |
1298 | 644 { |
645 pFont = pFontCreate; | |
1496 | 646 pTextHeight = pFontCreate->CalcTextHeight(byte_5B0938.data(), &BranchlessDlg_window, 12, 0) + 7; |
1298 | 647 } |
1496 | 648 pRenderer->GetLeather(8, 352 - pTextHeight, pIcons_LOD->GetTexture(uTextureID_Leather), pIcons_LOD->GetTexture(uTextureID_Leather)->uTextureHeight - pTextHeight); |
649 pRenderer->DrawTextureIndexed(8, 347 - pTextHeight, pTexture_591428); | |
650 pGUIWindow2->DrawText(pFont, 12, 354 - pTextHeight, 0, FitTextInAWindow(byte_5B0938.data(), pFont, &BranchlessDlg_window, 12, 0), 0, 0, 0); | |
1298 | 651 pRenderer->DrawTextureRGB(0, 0x160u, pTexture_StatusBar); |
652 if ( pGUIWindow2->receives_keyboard_input_2 != WINDOW_INPUT_IN_PROGRESS) | |
653 { | |
654 if ( pGUIWindow2->receives_keyboard_input_2 == WINDOW_INPUT_CONFIRMED) | |
655 { | |
656 pGUIWindow2->receives_keyboard_input_2 = WINDOW_INPUT_NONE; | |
657 strcpy(GameUI_Footer_TimedString.data(), (const char *)pKeyActionMap->pPressedKeysBuffer); | |
658 sub_4452BB(); | |
659 return; | |
660 } | |
661 if ( pGUIWindow2->receives_keyboard_input_2 != WINDOW_INPUT_CANCELLED) | |
662 return; | |
663 pGUIWindow2->receives_keyboard_input_2 = WINDOW_INPUT_NONE; | |
664 memset(GameUI_Footer_TimedString.data(), 0, 0xC8u); | |
1496 | 665 sub_4452BB(); |
666 return; | |
1298 | 667 } |
668 if ( pGUIWindow2->ptr_1C == (void *)26 ) | |
669 { | |
670 sprintf(Str, "%s %s", GameUI_Footer_TimedString, pKeyActionMap->pPressedKeysBuffer); | |
671 pGUIWindow2->DrawText(pFontLucida, 13, 357, 0, Str, 0, 0, 0); | |
1496 | 672 pGUIWindow2->DrawFlashingInputCursor(pFontLucida->GetLineWidth(Str) + 13, 357, pFontLucida); |
1298 | 673 return; |
674 } | |
675 if ( pKeyActionMap->pPressedKeysBuffer[0] ) | |
676 { | |
1459 | 677 pKeyActionMap->SetWindowInputStatus(WINDOW_INPUT_NONE); |
1496 | 678 memset(GameUI_Footer_TimedString.data(), 0, 0xC8u); |
679 sub_4452BB(); | |
680 return; | |
1298 | 681 } |
682 } | |
683 | |
684 //----- (004443D5) -------------------------------------------------------- | |
685 const char *GameUI_GetMinimapHintText() | |
686 { | |
687 double v3; // st7@1 | |
688 int v7; // eax@4 | |
1496 | 689 ODMFace *pFace; // eax@6 |
1298 | 690 const char *v14; // eax@8 |
691 char *result; // eax@12 | |
1496 | 692 unsigned int pMapID; // eax@14 |
1722 | 693 int global_coord_X; // [sp+10h] [bp-1Ch]@1 |
694 int global_coord_Y; // [sp+14h] [bp-18h]@1 | |
1298 | 695 unsigned int pY; // [sp+1Ch] [bp-10h]@1 |
1496 | 696 unsigned int pX; // [sp+28h] [bp-4h]@1 |
1298 | 697 |
1496 | 698 result = 0; |
699 pMouse->GetClickPos(&pX, &pY); | |
700 v3 = 1.0 / (float)((signed int)viewparams->uMinimapZoom * 0.000015258789); | |
1722 | 701 global_coord_X = (signed __int64)((double)(pX - 557) * v3 + (double)pParty->vPosition.x); |
702 global_coord_Y = (signed __int64)((double)pParty->vPosition.y - (double)(pY - 74) * v3); | |
1496 | 703 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor || pOutdoor->uNumBModels <= 0 ) |
1298 | 704 { |
1496 | 705 pMapID = pMapStats->GetMapInfo(pCurrentMapName); |
706 if ( pMapID == 0 ) | |
1298 | 707 result = "No Maze Info for this maze on file!"; |
708 else | |
1496 | 709 result = pMapStats->pInfos[pMapID].pName; |
1298 | 710 } |
711 else | |
712 { | |
1523
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
713 for ( uint j = 0; j < (uint)pOutdoor->uNumBModels; ++j ) |
1298 | 714 { |
1722 | 715 v7 = int_get_vector_length(abs((signed)pOutdoor->pBModels[j].vBoundingCenter.x - global_coord_X), |
716 abs((signed)pOutdoor->pBModels[j].vBoundingCenter.y - global_coord_Y), 0); | |
1496 | 717 if ( v7 < 2 * pOutdoor->pBModels[j].sBoundingRadius ) |
1298 | 718 { |
1496 | 719 if ( pOutdoor->pBModels[j].uNumFaces ) |
1298 | 720 { |
1523
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
721 for ( uint i = 0; i < (uint)pOutdoor->pBModels[j].uNumFaces; ++i ) |
1298 | 722 { |
1496 | 723 pFace = &pOutdoor->pBModels[j].pFaces[i]; |
724 if ( pFace->sCogTriggeredID ) | |
1298 | 725 { |
1496 | 726 if ( !(BYTE2(pFace->uAttributes) & 0x10) ) |
1298 | 727 { |
1496 | 728 v14 = GetEventHintString(pFace->sCogTriggeredID); |
1298 | 729 if ( v14 ) |
730 { | |
731 if ( _stricmp(v14, "") ) | |
1496 | 732 result = (char *)v14; |
1298 | 733 } |
734 } | |
735 } | |
736 } | |
737 } | |
1496 | 738 if ( result ) |
739 return result; | |
1298 | 740 } |
741 } | |
1496 | 742 pMapID = pMapStats->GetMapInfo(pCurrentMapName); |
743 if ( pMapID == 0 ) | |
744 result = "No Maze Info for this maze on file!"; | |
745 else | |
746 result = pMapStats->pInfos[pMapID].pName; | |
747 return result; | |
1298 | 748 } |
749 return result; | |
750 } | |
751 | |
752 //----- (0041D3B7) -------------------------------------------------------- | |
753 void GameUI_CharacterQuickRecord_Draw(GUIWindow *window, Player *player) | |
754 { | |
755 Texture *v13; // eax@6 | |
756 PlayerFrame *v15; // eax@12 | |
1496 | 757 unsigned int pTextColor; // eax@15 |
1838 | 758 const char *v29; // eax@16 |
1298 | 759 int v36; // esi@22 |
1838 | 760 const char *v39; // eax@24 |
1298 | 761 signed int uFramesetID; // [sp+20h] [bp-8h]@9 |
762 int uFramesetIDa; // [sp+20h] [bp-8h]@18 | |
763 | |
764 uint numActivePlayerBuffs = 0; | |
765 for (uint i = 0; i < 24; ++i) | |
766 if (player->pPlayerBuffs[i].uExpireTime > 0) | |
767 ++numActivePlayerBuffs; | |
768 | |
1496 | 769 window->uFrameHeight = ((pFontArrus->uFontHeight + 162) + ((numActivePlayerBuffs - 1) * pFontArrus->uFontHeight)); |
1298 | 770 window->uFrameZ = window->uFrameWidth + window->uFrameX - 1; |
1496 | 771 window->uFrameW = ((pFontArrus->uFontHeight + 162) + ((numActivePlayerBuffs - 1) * pFontArrus->uFontHeight)) + window->uFrameY - 1; |
1298 | 772 window->DrawMessageBox(0); |
773 | |
1362
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1340
diff
changeset
|
774 if (player->IsEradicated()) |
1298 | 775 v13 = pTexture_PlayerFaceEradicated; |
1362
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1340
diff
changeset
|
776 else if (player->IsDead()) |
1298 | 777 v13 = pTexture_PlayerFaceDead; |
778 else | |
779 { | |
780 uFramesetID = pPlayerFrameTable->GetFrameIdByExpression(player->expression); | |
781 if ( !uFramesetID ) | |
782 uFramesetID = 1; | |
783 if ( player->expression == CHARACTER_EXPRESSION_21) | |
784 v15 = pPlayerFrameTable->GetFrameBy_y(&player->_expression21_frameset, &player->_expression21_animtime, pMiscTimer->uTimeElapsed); | |
785 else | |
1496 | 786 v15 = pPlayerFrameTable->GetFrameBy_x(uFramesetID, pMiscTimer->Time()); |
1298 | 787 player->field_1AA2 = v15->uTextureID - 1; |
788 v13 = pTextures_PlayerFaces[(unsigned int)window->ptr_1C][v15->uTextureID - 1]; | |
789 } | |
790 | |
791 pRenderer->DrawTextureTransparent(window->uFrameX + 24, window->uFrameY + 24, v13); | |
792 | |
793 sprintfex(pTmpBuf.data(), "\f%05d", ui_character_header_text_color); | |
794 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[429], player->pName, pClassNames[player->classType]); // "%s the %s" | |
795 strcat(pTmpBuf.data(), pTmpBuf2.data()); | |
796 strcat(pTmpBuf.data(), "\f00000\n"); | |
797 | |
1507 | 798 pTextColor = UI_GetHealthManaAndOtherQualitiesStringColor(player->sHealth, player->GetMaxHealth()); |
1496 | 799 sprintfex(pTmpBuf2.data(), "%s : \f%05u%d\f00000 / %d\n", pGlobalTXT_LocalizationStrings[108], // "Hit Points" |
800 pTextColor, player->sHealth, player->GetMaxHealth()); | |
1298 | 801 strcat(pTmpBuf.data(), pTmpBuf2.data()); |
802 | |
1507 | 803 pTextColor = UI_GetHealthManaAndOtherQualitiesStringColor(player->sMana, player->GetMaxMana()); |
1496 | 804 sprintfex(pTmpBuf2.data(), "%s : \f%05u%d\f00000 / %d\n", pGlobalTXT_LocalizationStrings[212], // "Spell Points" |
805 pTextColor, player->sMana, player->GetMaxMana()); | |
1298 | 806 strcat(pTmpBuf.data(), pTmpBuf2.data()); |
807 | |
1496 | 808 pTextColor = player->GetMajorConditionIdx(); |
809 sprintfex(pTmpBuf2.data(), "%s: \f%05d%s\f00000\n", pGlobalTXT_LocalizationStrings[47], // "Condition | |
810 GetConditionDrawColor(pTextColor), aCharacterConditionNames[pTextColor]); | |
1298 | 811 strcat(pTmpBuf.data(), pTmpBuf2.data()); |
812 | |
1496 | 813 if ( player->uQuickSpell ) |
814 v29 = pSpellStats->pInfos[player->uQuickSpell].pShortName; | |
1298 | 815 else |
816 v29 = pGlobalTXT_LocalizationStrings[153]; | |
817 sprintfex(pTmpBuf2.data(), "%s: %s", pGlobalTXT_LocalizationStrings[172], v29); // "Quick Spell" | |
818 strcat(pTmpBuf.data(), pTmpBuf2.data()); | |
819 | |
820 window->DrawText(pFontArrus, 120, 22, 0, pTmpBuf.data(), 0, 0, 0); | |
821 | |
822 uFramesetIDa = 0; | |
823 for (uint i = 0; i < 24; ++i) | |
824 { | |
1980 | 825 SpellBuff* buff = &player->pPlayerBuffs[i]; |
1298 | 826 if (buff->uExpireTime > 0) |
827 { | |
828 v36 = uFramesetIDa++ * pFontComic->uFontHeight + 134; | |
1496 | 829 window->DrawText(pFontComic, 52, v36, ui_game_character_record_playerbuff_colors[i], aSpellNames[20 + i], 0, 0, 0); |
1758
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1736
diff
changeset
|
830 DrawBuff_remaining_time_string(v36, window, buff->uExpireTime - pParty->uTimePlayed, pFontComic); |
1298 | 831 } |
832 } | |
833 | |
834 v39 = ""; | |
835 if ( uFramesetIDa == 0 ) | |
836 v39 = pGlobalTXT_LocalizationStrings[153]; // "None" | |
1393 | 837 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[450], v39); // "Active Spells: %s" |
1298 | 838 window->DrawText(pFontArrus, 14, 114, 0, pTmpBuf.data(), 0, 0, 0); |
839 } | |
840 | |
841 //----- (0041A57E) -------------------------------------------------------- | |
842 void GameUI_QuickRef_Draw() | |
843 { | |
1496 | 844 unsigned int pTextColor; // eax@7 |
845 unsigned int pX; // [sp+14h] [bp-18h]@2 | |
846 unsigned int pY; // edi@9 | |
847 int pSkillsCount; // ecx@27 | |
1838 | 848 const char *pText; // eax@38 |
1496 | 849 int pFontHeight; // [sp+18h] [bp-14h]@1 |
1298 | 850 |
851 pRenderer->DrawTextureIndexed(8, 8, pIcons_LOD->LoadTexturePtr("quikref", TEXTURE_16BIT_PALETTE)); | |
1496 | 852 pFontHeight = LOBYTE(pFontArrus->uFontHeight) + 1; |
853 for ( uint i = 0; i < 4; ++i ) | |
854 { | |
1980 | 855 Player* player = &pParty->pPlayers[i]; |
1496 | 856 pX = 94 * i + 89; |
857 if ( i == 0 ) | |
858 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 22, 18, 0, pGlobalTXT_LocalizationStrings[149], 60, 0);//Name | |
859 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 94 * i + 89, 18, ui_character_header_text_color, player->pName, 84, 0); | |
860 if ( i == 0 ) | |
861 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 22, 47, 0, pGlobalTXT_LocalizationStrings[131], 60, 0); //Óðîâ. | |
862 sprintf(pTmpBuf.data(), "%lu", player->GetActualLevel()); | |
863 if ( player->GetActualLevel() <= player->GetBaseLevel()) | |
864 pTextColor = player->GetExperienceDisplayColor(); | |
865 else | |
866 pTextColor = ui_character_bonus_text_color; | |
867 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, pX, 47, pTextColor, pTmpBuf.data(), 84, 0); | |
868 pY = pFontHeight + 47; | |
869 if ( i == 0 ) | |
870 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 22, pFontHeight + 47, 0, pGlobalTXT_LocalizationStrings[41], 60, 0);//Êëàññ | |
871 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, pX, pY, 0, pClassNames[player->classType], 84, 0); | |
872 pY = pFontHeight + pY; | |
873 if ( i == 0 ) | |
874 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 22, pY, 0, pGlobalTXT_LocalizationStrings[107], 60, 0);//Çäîð. | |
875 sprintf(pTmpBuf.data(), "%d", player->sHealth); | |
1507 | 876 pTextColor = UI_GetHealthManaAndOtherQualitiesStringColor(player->sHealth, player->GetMaxHealth()); |
1496 | 877 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, pX, pY, pTextColor, pTmpBuf.data(), 84, 0); |
878 pY = pFontHeight + pY; | |
879 if ( i == 0 ) | |
880 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 22, pY, 0, pGlobalTXT_LocalizationStrings[209], 60, 0);//Ìàíà | |
881 sprintf(pTmpBuf.data(), "%d", player->sMana); | |
1507 | 882 pTextColor = UI_GetHealthManaAndOtherQualitiesStringColor(player->sMana, player->GetMaxMana()); |
1496 | 883 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, pX, pY, pTextColor, pTmpBuf.data(), 84, 0); |
884 pY = pFontHeight + pY; | |
885 if ( i == 0 ) | |
886 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 22, pY, 0, pGlobalTXT_LocalizationStrings[0], 60, 0);//Êëàññ áðîíè | |
887 sprintf(pTmpBuf.data(), "%d", player->GetActualAC()); | |
1507 | 888 pTextColor = UI_GetHealthManaAndOtherQualitiesStringColor(player->GetActualAC(), player->GetBaseAC()); |
1496 | 889 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, pX, pY, pTextColor, pTmpBuf.data(), 84, 0); |
890 pY = pFontHeight + pY; | |
891 if ( !i ) | |
892 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 22, pY, 0, pGlobalTXT_LocalizationStrings[18], 60, 0);//Àòàêà | |
1684 | 893 sprintf(pTmpBuf.data(), "%+d", player->GetActualAttack(false)); |
1496 | 894 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, pX, pY, 0, pTmpBuf.data(), 84, 0); |
895 pY = pFontHeight + pY; | |
896 if ( !i ) | |
897 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 22, pY, 0, pGlobalTXT_LocalizationStrings[66], 60, 0);//Ïîâð. | |
898 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, pX, pY, 0, player->GetMeleeDamageString(), 84, 0); | |
899 pY = pFontHeight + pY; | |
900 if ( !i ) | |
901 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 22, pY, 0, pGlobalTXT_LocalizationStrings[203], 60, 0);// Ñòðåëÿòü | |
902 sprintf(pTmpBuf.data(), "%+d", player->GetRangedAttack()); | |
903 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, pX, pY, 0, pTmpBuf.data(), 84, 0); | |
904 pY = pFontHeight + pY; | |
905 if ( !i ) | |
906 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 22, pY, 0, pGlobalTXT_LocalizationStrings[66], 60, 0);//Ïîâð. | |
907 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, pX, pY, 0, player->GetRangedDamageString(), 84, 0); | |
908 pY = pFontHeight + pY; | |
909 if ( !i ) | |
910 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 22, pY, 0, pGlobalTXT_LocalizationStrings[205], 60, 0);//Íàâûêè | |
911 pSkillsCount = 0; | |
912 for ( uint j = 0; j <= 36; ++j ) | |
913 { | |
914 if ( player->pActiveSkills[j] ) | |
915 ++pSkillsCount; | |
916 } | |
917 sprintf(pTmpBuf.data(), "%lu", pSkillsCount); | |
918 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, pX, pY, 0, pTmpBuf.data(), 84, 0); | |
919 pY = pFontHeight + pY; | |
920 if ( !i ) | |
921 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 22, pY, 0, pGlobalTXT_LocalizationStrings[168], 60, 0);//Î÷êè | |
922 sprintf(pTmpBuf.data(), "%lu", player->uSkillPoints); | |
923 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, pX, pY, player->uSkillPoints ? ui_character_bonus_text_color : ui_character_default_text_color, pTmpBuf.data(), 84, 0); | |
924 pY = pFontHeight + pY; | |
925 if ( !i ) | |
926 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 22, pY, 0, pGlobalTXT_LocalizationStrings[45], 60, 0);//Ñîñò. | |
927 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, pX, pY, pTextColor, aCharacterConditionNames[player->GetMajorConditionIdx()], 84, 0); | |
928 pY = pFontHeight + pY; | |
929 if ( !i ) | |
930 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 22, pY, 0, pGlobalTXT_LocalizationStrings[170], 60, 0);//Á.Ïðèì. | |
931 if (player->uQuickSpell) | |
932 pText = pSpellStats->pInfos[player->uQuickSpell].pShortName; | |
933 else | |
934 pText = pGlobalTXT_LocalizationStrings[153];//Íåò | |
935 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, pX, pY, 0, pText, 84, 0); | |
936 } | |
1298 | 937 |
1827
0c75c3e7e436
cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents:
1826
diff
changeset
|
938 if ( pParty->GetPartyReputation() >= 0 ) |
1496 | 939 { |
1827
0c75c3e7e436
cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents:
1826
diff
changeset
|
940 if ( pParty->GetPartyReputation() <= 5 ) |
1496 | 941 pTextColor = ui_character_default_text_color; |
942 else | |
943 pTextColor = ui_character_bonus_text_color_neg; | |
944 } | |
945 else | |
946 pTextColor = ui_character_bonus_text_color; | |
1298 | 947 |
1827
0c75c3e7e436
cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents:
1826
diff
changeset
|
948 sprintf(pTmpBuf.data(), "%s: \f%05d%s\f00000", pGlobalTXT_LocalizationStrings[180], pTextColor, GetReputationString(pParty->GetPartyReputation()));//Reputation |
1496 | 949 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 22, 323, 0, pTmpBuf.data(), 0, 0, 0); |
950 sprintf(pTmpBuf.data(), "\r261%s: %d", pGlobalTXT_LocalizationStrings[84], pParty->GetPartyFame());// Fame Ñëàâà | |
951 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 0, 323, 0, pTmpBuf.data(), 0, 0, 0); | |
1298 | 952 } |
953 | |
954 //----- (0041AD6E) -------------------------------------------------------- | |
955 void GameUI_DrawRightPanelItems() | |
956 { | |
1523
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
957 if ( (unsigned long long)GameUI_RightPanel_BookFlashTimer > pParty->uTimePlayed ) |
1298 | 958 GameUI_RightPanel_BookFlashTimer = 0; |
959 | |
1523
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
960 if ( pParty->uTimePlayed - GameUI_RightPanel_BookFlashTimer > 128 ) |
1298 | 961 { |
962 GameUI_RightPanel_BookFlashTimer = pParty->uTimePlayed; | |
963 | |
964 static bool byte_50697C = false; // 50697C | |
965 byte_50697C = !byte_50697C; | |
966 if ( byte_50697C && pCurrentScreen != SCREEN_REST ) | |
967 { | |
968 if (bFlashQuestBook) pRenderer->DrawTextureTransparent(493, 355, pIcons_LOD->GetTexture(uTextureID_ib_td1_A)); | |
969 if (bFlashAutonotesBook) pRenderer->DrawTextureTransparent(527, 353, pIcons_LOD->GetTexture(uTextureID_ib_td2_A)); | |
970 if (bFlashHistoryBook) pRenderer->DrawTextureTransparent(600, 361, pIcons_LOD->GetTexture(uTextureID_ib_td5_A)); | |
971 } | |
972 else | |
973 { | |
974 pRenderer->DrawTextureRGB(468, 0, pTexture_RightFrame); | |
975 GameUI_DrawHiredNPCs(); | |
976 } | |
977 } | |
978 } | |
979 | |
980 //----- (0041AEBB) -------------------------------------------------------- | |
981 void GameUI_DrawFoodAndGold() | |
982 { | |
2186 | 983 int text_y; // esi@2 |
1298 | 984 |
985 if ( uGameState != GAME_STATE_FINAL_WINDOW ) | |
986 { | |
2186 | 987 text_y = sub_44100D() != 0 ? 381 : 322; |
1298 | 988 sprintf(pTmpBuf.data(), "\r087%lu", pParty->uNumFoodRations); |
2186 | 989 pPrimaryWindow->DrawText(pFontSmallnum, 0, text_y, uGameUIFontMain, pTmpBuf.data(), 0, 0, uGameUIFontShadow); |
1298 | 990 sprintf(pTmpBuf.data(), "\r028%lu", pParty->uNumGold); |
2186 | 991 pPrimaryWindow->DrawText(pFontSmallnum, 0, text_y, uGameUIFontMain, pTmpBuf.data(), 0, 0, uGameUIFontShadow); |
1298 | 992 } |
993 } | |
994 | |
995 //----- (0041B0C9) -------------------------------------------------------- | |
996 void GameUI_DrawLifeManaBars() | |
997 { | |
998 double v3; // st7@3 | |
999 double v7; // st7@25 | |
1496 | 1000 Texture *pTextureHealth; // [sp-4h] [bp-30h]@10 |
1001 Texture *pTextureMana; // [sp+Ch] [bp-20h]@1 | |
1298 | 1002 |
1496 | 1003 pTextureMana = pIcons_LOD->GetTexture(uTextureID_BarBlue); |
1298 | 1004 for (uint i = 0; i < 4; ++i) |
1005 { | |
1496 | 1006 if (pParty->pPlayers[i].sHealth > 0) |
1007 { | |
1298 | 1008 int v17 = 0; |
1009 if (i == 2 || i == 3) | |
1010 v17 = 2; | |
1496 | 1011 v3 = (double)pParty->pPlayers[i].sHealth / (double)pParty->pPlayers[i].GetMaxHealth(); |
1298 | 1012 if( v3 > 0.5 ) |
1013 { | |
1014 if ( v3 > 1.0 ) | |
1015 v3 = 1.0; | |
1496 | 1016 pTextureHealth = pIcons_LOD->GetTexture(uTextureID_BarGreen); |
1298 | 1017 } |
1018 else if ( v3 > 0.25 ) | |
1496 | 1019 pTextureHealth = pIcons_LOD->GetTexture(uTextureID_BarYellow); |
1298 | 1020 else if ( v3 > 0.0 ) |
1496 | 1021 pTextureHealth = pIcons_LOD->GetTexture(uTextureID_BarRed); |
1022 if( v3 > 0.0 ) | |
1023 { | |
1024 pRenderer->SetTextureClipRect(v17 + pHealthBarPos[i], (signed __int64)((1.0 - v3) * pTextureHealth->uTextureHeight) + 402, | |
1025 v17 + pHealthBarPos[i] + pTextureHealth->uTextureWidth, pTextureHealth->uTextureHeight + 402); | |
1026 pRenderer->DrawTextureIndexed(v17 + pHealthBarPos[i], 402, pTextureHealth); | |
1027 pRenderer->ResetTextureClipRect(); | |
1028 } | |
1029 } | |
1030 if (pParty->pPlayers[i].sMana > 0) | |
1298 | 1031 { |
1496 | 1032 v7 = pParty->pPlayers[i].sMana / (double)pParty->pPlayers[i].GetMaxMana(); |
1298 | 1033 if ( v7 > 1.0 ) |
1034 v7 = 1.0; | |
1035 int v17 = 0; | |
1036 if (i == 2) | |
1037 v17 = 1; | |
1496 | 1038 pRenderer->SetTextureClipRect(v17 + pManaBarPos[i], (signed __int64)((1.0 - v7) * pTextureMana->uTextureHeight) + 402, |
1039 v17 + pManaBarPos[i] + pTextureMana->uTextureWidth, pTextureMana->uTextureHeight + 402); | |
1040 pRenderer->DrawTextureIndexed(v17 + pManaBarPos[i], 402, pTextureMana); | |
1298 | 1041 pRenderer->ResetTextureClipRect(); |
1042 } | |
1043 } | |
1044 } | |
1045 | |
1046 //----- (0041B3B6) -------------------------------------------------------- | |
1047 void GameUI_DrawRightPanel() | |
1048 { | |
1496 | 1049 pRenderer->DrawTextureTransparent(pViewport->uViewportBR_X, 0, pIcons_LOD->GetTexture(uTextureID_right_panel)); |
1298 | 1050 } |
1051 | |
1052 //----- (0041B3E2) -------------------------------------------------------- | |
1053 void GameUI_DrawRightPanelFrames() | |
1054 { | |
1055 pRenderer->DrawTextureRGB(0, 0, pTexture_TopFrame); | |
1056 pRenderer->DrawTextureRGB(0, 8, pTexture_LeftFrame); | |
1057 pRenderer->DrawTextureRGB(468, 0, pTexture_RightFrame); | |
1058 pRenderer->DrawTextureRGB(0, 352, pTexture_BottomFrame); | |
1059 GameUI_DrawFoodAndGold(); | |
1060 GameUI_DrawRightPanelItems(); | |
1061 } | |
1062 | |
1063 //----- (0041C047) -------------------------------------------------------- | |
1064 void GameUI_Footer_2() | |
1065 { | |
1496 | 1066 char *v1; // edx@2 |
1067 int v5; // eax@5 | |
1298 | 1068 |
1069 pRenderer->DrawTextureRGB(0, 352, pTexture_StatusBar); | |
1070 if (GameUI_Footer_TimeLeft) | |
1071 v1 = GameUI_Footer_TimedString.data(); | |
1072 else | |
1073 { | |
1074 if (!pFooterString[0]) | |
1075 return; | |
1076 v1 = pFooterString.data(); | |
1077 } | |
1078 | |
1079 v5 = pFontLucida->AlignText_Center(450, v1); | |
1080 pPrimaryWindow->DrawText(pFontLucida, v5 + 11, 357, uGameUIFontMain, v1, 0, 0, uGameUIFontShadow); | |
1081 } | |
1082 | |
1083 //----- (0041C0B8) -------------------------------------------------------- | |
1084 void GameUI_SetFooterString(const char *pStr) | |
1085 { | |
1496 | 1086 const char *v1; // esi@1 |
1298 | 1087 |
1496 | 1088 v1 = pStr; |
1089 if ( pStr && strcmp(pStr, "test") && !IsBadStringPtrA(pStr, 1) && (*v1 || GameUI_Footer_TimeLeft) ) | |
1090 { | |
1091 if ( GameUI_Footer_TimeLeft ) | |
1092 { | |
1093 for ( int i = pFontLucida->GetLineWidth(GameUI_Footer_TimedString.data()); i > 450; i = pFontLucida->GetLineWidth(GameUI_Footer_TimedString.data()) ) | |
1094 GameUI_Footer_TimedString[strlen(GameUI_Footer_TimedString.data()) - 1] = 0; | |
1298 | 1095 } |
1496 | 1096 else |
1097 { | |
1098 strcpy(pFooterString.data(), v1); | |
1099 for ( int j = pFontLucida->GetLineWidth(pFooterString.data()); j > 450; j = pFontLucida->GetLineWidth(pFooterString.data()) ) | |
1100 pFooterString[strlen(pFooterString.data()) - 1] = 0; | |
1101 } | |
1102 } | |
1103 } | |
1298 | 1104 |
1105 //----- (0041C179) -------------------------------------------------------- | |
1106 void GameUI_Footer() | |
1107 { | |
1496 | 1108 char *v1; // edi@5 |
1109 int v2; // eax@5 | |
1110 int v6; // eax@9 | |
1111 char v9; // zf@12 | |
1298 | 1112 |
1496 | 1113 if ( pFooterString[0] || GameUI_Footer_TimeLeft || bForceDrawFooter ) |
1114 { | |
1115 pRenderer->DrawTextureRGB(0, 352, pTexture_StatusBar); | |
1116 if ( GameUI_Footer_TimeLeft ) | |
1117 { | |
1118 v1 = GameUI_Footer_TimedString.data(); | |
1119 v2 = pFontLucida->GetLineWidth(GameUI_Footer_TimedString.data()); | |
1120 while ( v2 > 450 ) | |
1121 { | |
1122 GameUI_Footer_TimedString[strlen(GameUI_Footer_TimedString.data()) - 1] = 0; | |
1123 v2 = pFontLucida->GetLineWidth(GameUI_Footer_TimedString.data()); | |
1124 } | |
1298 | 1125 } |
1496 | 1126 else |
1127 { | |
1128 v1 = pFooterString.data(); | |
1129 v6 = pFontLucida->GetLineWidth(pFooterString.data()); | |
1130 while ( v6 > 450 ) | |
1131 { | |
1132 pFooterString[strlen(pFooterString.data()) - 1] = 0; | |
1133 v6 = pFontLucida->GetLineWidth(pFooterString.data()); | |
1134 } | |
1135 } | |
1136 v9 = *v1 == 0; | |
1137 bForceDrawFooter = 0; | |
1138 if ( !v9 ) | |
1139 pPrimaryWindow->DrawText(pFontLucida, pFontLucida->AlignText_Center(450, v1) + 11, 357, uGameUIFontMain, v1, 0, 0, uGameUIFontShadow); | |
1140 } | |
1141 } | |
1298 | 1142 // 5C35BC: using guessed type int bForceDrawFooter; |
1143 //----- (00420EFF) -------------------------------------------------------- | |
2155 | 1144 void GameUI_WritePointedObjectStatusString() |
1298 | 1145 { |
1146 int v1; // ebx@6 | |
1147 GUIWindow *pWindow; // edi@7 | |
1148 GUIButton *pButton; // ecx@11 | |
1149 int v7; // ecx@19 | |
1150 enum UIMessageType pMessageType1; // esi@24 | |
1151 int v14; // eax@41 | |
1152 ItemGen *pItemGen; // ecx@44 | |
1153 int v16; // ecx@46 | |
1154 signed int v18; // eax@55 | |
1155 signed int v18b; | |
1156 signed int v19; // ecx@63 | |
1523
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1157 const char *pText; // ecx@79 |
1298 | 1158 char *v28; // esi@82 |
1159 enum UIMessageType pMessageType2; // esi@110 | |
1160 enum UIMessageType pMessageType3; // edx@117 | |
1161 char Str1[200]; // [sp+Ch] [bp-D4h]@129 | |
1162 unsigned int pX; // [sp+D4h] [bp-Ch]@1 | |
1163 unsigned int pY; // [sp+D8h] [bp-8h]@1 | |
1164 unsigned int v45; // [sp+DCh] [bp-4h]@21 | |
1165 | |
1523
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1166 int interaction_distance_limit = 512; |
2021 | 1167 int monster_info_distance_limit = 5120; |
1523
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1168 |
1298 | 1169 pMouse->uPointingObjectID = 0; |
1170 pMouse->GetClickPos(&pX, &pY); | |
2017 | 1171 if ( pX < 0 || pX > 639 || pY < 0 || pY > 479 )//ãðàíèöû îêíà èãðû |
1298 | 1172 return; |
2017 | 1173 if ( pX <= 467 && pY <= 351 )//ïðåäåëû îñíîâíîé îáëàñòè |
1298 | 1174 { |
2017 | 1175 //îêíî(îáëàñòü) èãðû---------------------------------- |
1176 if ( pCurrentScreen == SCREEN_GAME ) | |
1298 | 1177 { |
2155 | 1178 //if ( pRenderer->pRenderD3D ) // inlined mm8::4C1E01 |
1298 | 1179 { |
2017 | 1180 v18 = pGame->pVisInstance->get_picked_object_zbuf_val(); |
1181 if ( pX < (unsigned int)pViewport->uScreen_TL_X || pX > (unsigned int)pViewport->uScreen_BR_X | |
1182 || pY < (unsigned int)pViewport->uScreen_TL_Y || pY > (unsigned int)pViewport->uScreen_BR_Y ) | |
1183 v18 = -1; | |
1184 if ( v18 == -1 ) | |
1523
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1185 { |
2017 | 1186 pMouse->uPointingObjectID = 0; |
1298 | 1187 if ( pMouse->uPointingObjectID == 0 ) |
1188 { | |
1189 if ( uLastPointedObjectID != 0 ) | |
1190 { | |
1191 pFooterString[0] = 0; | |
1192 bForceDrawFooter = 1; | |
1193 } | |
1194 } | |
1195 uLastPointedObjectID = pMouse->uPointingObjectID; | |
1196 return; | |
1197 } | |
1523
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1198 } |
2155 | 1199 /*else |
1200 v18 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]];*/ | |
2017 | 1201 pMouse->uPointingObjectID = (unsigned __int16)v18; |
1202 v19 = (signed)PID_ID(v18); | |
1203 //For Items------------------------------------ | |
1204 if (PID_TYPE(v18) == OBJECT_Item) | |
1523
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1205 { |
2017 | 1206 if ( pObjectList->pObjects[pSpriteObjects[v19].uObjectDescID].uFlags & 0x10 ) |
1298 | 1207 { |
2017 | 1208 pMouse->uPointingObjectID = 0; |
1523
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1209 pFooterString[0] = 0; |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1210 bForceDrawFooter = 1; |
2017 | 1211 uLastPointedObjectID = 0; |
1212 return; | |
1213 } | |
2021 | 1214 if ( HIWORD(v18) < interaction_distance_limit && !pParty->pPickedItem.uItemID ) |
2017 | 1215 { |
2021 | 1216 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[470], pSpriteObjects[v19].stru_24.GetDisplayName());// "Get %s" |
1217 GameUI_SetFooterString(pTmpBuf.data()); | |
2017 | 1218 return; |
1219 } | |
2021 | 1220 GameUI_SetFooterString(pSpriteObjects[v19].stru_24.GetDisplayName()); |
2017 | 1221 if ( pMouse->uPointingObjectID == 0 ) |
1222 { | |
1223 if ( uLastPointedObjectID != 0 ) | |
1224 { | |
1225 pFooterString[0] = 0; | |
1226 bForceDrawFooter = 1; | |
1227 } | |
1298 | 1228 } |
1229 uLastPointedObjectID = pMouse->uPointingObjectID; | |
1230 return; | |
1231 } | |
2017 | 1232 //For Decorations---------------------------------- |
1233 if (PID_TYPE(v18) == OBJECT_Decoration) | |
1298 | 1234 { |
2017 | 1235 if ( !pLevelDecorations[v19].uEventID ) |
1236 { | |
1237 if ( pLevelDecorations[v19].IsInteractive() ) | |
2026 | 1238 pText = pNPCTopics[stru_5E4C90_MapPersistVars._decor_events[pLevelDecorations[v19]._idx_in_stru123 - 75] + 380].pTopic;//-379 |
2017 | 1239 else |
1240 pText = pDecorationList->pDecorations[pLevelDecorations[v19].uDecorationDescID].field_20; | |
1241 GameUI_SetFooterString(pText); | |
1242 } | |
2021 | 1243 else |
2017 | 1244 { |
2021 | 1245 if ( GetEventHintString(pLevelDecorations[v19].uEventID) ) |
1246 GameUI_SetFooterString(GetEventHintString(pLevelDecorations[v19].uEventID)); | |
2017 | 1247 } |
1298 | 1248 if ( pMouse->uPointingObjectID == 0 ) |
1249 { | |
1250 if ( uLastPointedObjectID != 0 ) | |
1251 { | |
1252 pFooterString[0] = 0; | |
1253 bForceDrawFooter = 1; | |
1254 } | |
1255 } | |
1256 uLastPointedObjectID = pMouse->uPointingObjectID; | |
1257 return; | |
1258 } | |
2017 | 1259 //For 3D Model------------------------------------- |
1260 if (PID_TYPE(v18) == OBJECT_BModel) | |
1298 | 1261 { |
2017 | 1262 if ( HIWORD(v18) < interaction_distance_limit ) |
1263 { | |
2092 | 1264 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor) |
2017 | 1265 { |
1266 v18b = (signed int)(unsigned __int16)v18 >> 9; | |
1267 if ( !pOutdoor->pBModels[v18b].pFaces[v19 & 0x3F].sCogTriggeredID | |
1268 || !GetEventHintString(pOutdoor->pBModels[v18b].pFaces[v19 & 0x3F].sCogTriggeredID) ) | |
1269 { | |
1270 pMouse->uPointingObjectID = 0; | |
1271 pFooterString[0] = 0; | |
1272 bForceDrawFooter = 1; | |
1273 uLastPointedObjectID = 0; | |
1274 return; | |
1275 } | |
1276 GameUI_SetFooterString(GetEventHintString(pOutdoor->pBModels[v18b].pFaces[v19 & 0x3F].sCogTriggeredID)); | |
1277 if ( pMouse->uPointingObjectID == 0 ) | |
1278 { | |
1279 if ( uLastPointedObjectID != 0 ) | |
1280 { | |
1281 pFooterString[0] = 0; | |
1282 bForceDrawFooter = 1; | |
1283 } | |
1284 } | |
1285 uLastPointedObjectID = pMouse->uPointingObjectID; | |
1286 return; | |
1287 } | |
2092 | 1288 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) |
2017 | 1289 { |
2092 | 1290 if ( pIndoor->pFaces[v19].uAttributes & FACE_INDICATE ) |
2017 | 1291 { |
2092 | 1292 if ( !pIndoor->pFaceExtras[pIndoor->pFaces[v19].uFaceExtraID].uEventID |
1293 || !GetEventHintString(pIndoor->pFaceExtras[pIndoor->pFaces[v19].uFaceExtraID].uEventID) ) | |
1294 { | |
1295 pMouse->uPointingObjectID = 0; | |
1296 pFooterString[0] = 0; | |
1297 bForceDrawFooter = 1; | |
1298 uLastPointedObjectID = 0; | |
1299 return; | |
1300 } | |
1301 GameUI_SetFooterString(GetEventHintString(pIndoor->pFaceExtras[pIndoor->pFaces[v19].uFaceExtraID].uEventID)); | |
1302 if ( pMouse->uPointingObjectID == 0 ) | |
1303 { | |
1304 if ( uLastPointedObjectID != 0 ) | |
1305 { | |
1306 pFooterString[0] = 0; | |
1307 bForceDrawFooter = 1; | |
1308 } | |
1309 } | |
1310 uLastPointedObjectID = pMouse->uPointingObjectID; | |
2017 | 1311 return; |
1312 } | |
1313 } | |
1314 } | |
1315 pMouse->uPointingObjectID = 0; | |
1298 | 1316 pFooterString[0] = 0; |
1317 bForceDrawFooter = 1; | |
2017 | 1318 uLastPointedObjectID = 0; |
1319 return; | |
1320 } | |
2021 | 1321 if (PID_TYPE(v18) == OBJECT_Actor && HIWORD(v18) < monster_info_distance_limit ) |
2017 | 1322 { |
1323 if ( pActors[v19].dword_000334_unique_name ) | |
1324 pText = pMonsterStats->pPlaceStrings[pActors[v19].dword_000334_unique_name]; | |
1325 else | |
1326 pText = pMonsterStats->pInfos[pActors[v19].pMonsterInfo.uID].pName; | |
2021 | 1327 strncpy(pTmpBuf.data(), pText, 2000); |
1328 GameUI_SetFooterString(pTmpBuf.data()); | |
2017 | 1329 } |
1330 if ( pMouse->uPointingObjectID == 0 ) | |
1331 { | |
1332 if ( uLastPointedObjectID != 0 ) | |
1333 { | |
1334 pFooterString[0] = 0; | |
1335 bForceDrawFooter = 1; | |
1336 } | |
1337 } | |
1338 uLastPointedObjectID = pMouse->uPointingObjectID; | |
1339 return; | |
1340 } | |
1341 //îêíî(îáëàñòü) ÿùèêà------------------------------------------- | |
1342 if ( pCurrentScreen == SCREEN_CHEST ) | |
1343 { | |
2018 | 1344 ChestUI_WritePointedObjectStatusString(); |
2017 | 1345 if ( pMouse->uPointingObjectID == 0 ) |
1346 { | |
1347 if ( uLastPointedObjectID != 0 ) | |
1348 { | |
1349 pFooterString[0] = 0; | |
1350 bForceDrawFooter = 1; | |
1351 } | |
1352 } | |
1353 uLastPointedObjectID = pMouse->uPointingObjectID; | |
1354 return; | |
1355 } | |
1356 //îêíî(îáëàñòü) ìàãàçèíà----------------------------------------- | |
1357 if ( pCurrentScreen == SCREEN_HOUSE ) | |
1358 { | |
1359 v16 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]]; | |
1360 if ( v16 != 0 && v16 != -65536 ) | |
1361 { | |
1362 if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_BUY_STANDARD ) | |
1363 { | |
1364 pItemGen = &pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v16-1]; | |
1365 GameUI_SetFooterString(pItemGen->GetDisplayName()); | |
1366 uLastPointedObjectID = 1; | |
1367 } | |
1368 if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_BUY_SPECIAL ) | |
1369 { | |
1370 pItemGen = &pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v16-1]; | |
1371 GameUI_SetFooterString(pItemGen->GetDisplayName()); | |
1372 uLastPointedObjectID = 1; | |
1373 } | |
1374 if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_SELL ) | |
1375 { | |
1376 pItemGen = &pPlayers[uActiveCharacter]->pInventoryItemList[v16-1]; | |
1377 GameUI_SetFooterString(pItemGen->GetDisplayName()); | |
1378 uLastPointedObjectID = 1; | |
1379 } | |
1380 } | |
1381 if ( pMouse->uPointingObjectID == 0 ) | |
1382 { | |
1383 if ( uLastPointedObjectID != 0 ) | |
1384 { | |
1385 pFooterString[0] = 0; | |
1386 bForceDrawFooter = 1; | |
1387 } | |
1388 } | |
1389 uLastPointedObjectID = pMouse->uPointingObjectID; | |
1390 return; | |
1391 } | |
1392 //----------------------------------------- | |
1393 for ( v1 = uNumVisibleWindows; v1 >= 0; --v1 ) // some other fullscreen ui | |
1394 { | |
1395 pWindow = &pWindowList[pVisibleWindowsIdxs[v1] - 1]; | |
1396 if ( (signed int)pX >= (signed int)pWindow->uFrameX && (signed int)pX <= (signed int)pWindow->uFrameZ | |
1397 && (signed int)pY >= (signed int)pWindow->uFrameY && (signed int)pY <= (signed int)pWindow->uFrameW ) | |
1398 { | |
1399 for ( pButton = pWindow->pControlsHead; ; pButton = pButton->pNext ) | |
1400 { | |
1401 if ( !pButton ) | |
1402 break; | |
1403 switch ( pButton->uButtonType ) | |
1404 { | |
1405 case 1://for dialogue window | |
1406 if ( (signed int)pX >= (signed int)pButton->uX && (signed int)pX <= (signed int)pButton->uZ | |
1407 && (signed int)pY >= (signed int)pButton->uY && (signed int)pY <= (signed int)pButton->uW ) | |
1408 { | |
1409 pMessageType1 = (UIMessageType)pButton->field_1C; | |
1410 if ( pMessageType1 ) | |
1411 pMessageQueue_50CBD0->AddMessage(pMessageType1, pButton->msg_param, 0); | |
1412 GameUI_SetFooterString(pButton->pButtonName); | |
1413 uLastPointedObjectID = 1; | |
1414 return; | |
1415 } | |
1416 break; | |
1417 case 2: | |
1418 if ( pX >= pButton->uX && pX <= pButton->uZ | |
1419 && pY >= pButton->uY && pY <= pButton->uW ) | |
1420 { | |
1421 pMessageType1 = (UIMessageType)pButton->field_1C; | |
1422 if ( pMessageType1 ) | |
1423 pMessageQueue_50CBD0->AddMessage(pMessageType1, pButton->msg_param, 0); | |
1424 GameUI_SetFooterString(pButton->pButtonName); | |
1425 uLastPointedObjectID = 1; | |
1426 return; | |
1427 } | |
1428 break; | |
1429 case 3:// click on skill | |
1430 if ( pX >= pButton->uX && pX <= pButton->uZ | |
1431 && pY >= pButton->uY && pY <= pButton->uW ) | |
1432 { | |
1433 v7 = (LOBYTE(pPlayers[uActiveCharacter]->pActiveSkills[pButton->msg_param]) & 0x3F) + 1; | |
1434 if ( pPlayers[uActiveCharacter]->uSkillPoints < v7 ) | |
1435 sprintf(Str1, pGlobalTXT_LocalizationStrings[469], v7 - pPlayers[uActiveCharacter]->uSkillPoints);// "You need %d more Skill Points to advance here" | |
1436 else | |
1437 sprintf(Str1, pGlobalTXT_LocalizationStrings[468], v7);// "Clicking here will spend %d Skill Points" | |
1438 GameUI_SetFooterString(Str1); | |
1439 uLastPointedObjectID = 1; | |
1440 return; | |
1441 } | |
1442 break; | |
1443 } | |
1444 } | |
1298 | 1445 } |
1446 } | |
2019 | 1447 }//êîíåö ïðåäåëîâ îñíîâíîãî ýêðàíà------------------------ |
2020 | 1448 if ( pX > 467 && pX <=639 && pY <= 479 )//ïðåäåëû ïðàâîé îáëàñòè |
1298 | 1449 { |
2019 | 1450 if ( pCurrentScreen == SCREEN_GAME ) |
2020 | 1451 { |
2019 | 1452 pWindow = &pWindowList[0]; |
2020 | 1453 if ( (signed int)pX >= (signed int)pWindow->uFrameX && (signed int)pX <= (signed int)pWindow->uFrameZ |
1454 && (signed int)pY >= (signed int)pWindow->uFrameY && (signed int)pY <= (signed int)pWindow->uFrameW ) | |
2012 | 1455 { |
2020 | 1456 for ( pButton = pWindow->pControlsHead; ; pButton = pButton->pNext ) |
2012 | 1457 { |
2020 | 1458 if ( !pButton ) |
2012 | 1459 break; |
2020 | 1460 switch ( pButton->uButtonType ) |
1461 { | |
1462 case 1://for dialogue window | |
1463 if ( (signed int)pX >= (signed int)pButton->uX && (signed int)pX <= (signed int)pButton->uZ | |
1464 && (signed int)pY >= (signed int)pButton->uY && (signed int)pY <= (signed int)pButton->uW ) | |
1465 { | |
1466 pMessageType1 = (UIMessageType)pButton->field_1C; | |
1467 if ( pMessageType1 ) | |
1468 pMessageQueue_50CBD0->AddMessage(pMessageType1, pButton->msg_param, 0); | |
1469 GameUI_SetFooterString(pButton->pButtonName); | |
1470 uLastPointedObjectID = 1; | |
1471 return; | |
1472 } | |
1473 break; | |
1474 case 2: | |
1475 if ( pX >= pButton->uX && pX <= pButton->uZ | |
1476 && pY >= pButton->uY && pY <= pButton->uW ) | |
1477 { | |
1478 pMessageType1 = (UIMessageType)pButton->field_1C; | |
1479 if ( pMessageType1 ) | |
1480 pMessageQueue_50CBD0->AddMessage(pMessageType1, pButton->msg_param, 0); | |
1481 GameUI_SetFooterString(pButton->pButtonName); | |
1482 uLastPointedObjectID = 1; | |
1483 return; | |
1484 } | |
1485 break; | |
1486 case 3:// click on skill | |
1487 if ( pX >= pButton->uX && pX <= pButton->uZ | |
1488 && pY >= pButton->uY && pY <= pButton->uW ) | |
1489 { | |
1490 v7 = (LOBYTE(pPlayers[uActiveCharacter]->pActiveSkills[pButton->msg_param]) & 0x3F) + 1; | |
1491 if ( pPlayers[uActiveCharacter]->uSkillPoints < v7 ) | |
1492 sprintf(Str1, pGlobalTXT_LocalizationStrings[469], v7 - pPlayers[uActiveCharacter]->uSkillPoints);// "You need %d more Skill Points to advance here" | |
1493 else | |
1494 sprintf(Str1, pGlobalTXT_LocalizationStrings[468], v7);// "Clicking here will spend %d Skill Points" | |
1495 GameUI_SetFooterString(Str1); | |
1496 uLastPointedObjectID = 1; | |
1497 return; | |
1498 } | |
1499 break; | |
1500 } | |
2012 | 1501 } |
1502 } | |
1503 } | |
2020 | 1504 else |
1505 { | |
1506 for ( v1 = uNumVisibleWindows; v1 > 0; --v1 ) | |
1507 { | |
1508 pWindow = &pWindowList[pVisibleWindowsIdxs[v1] - 1]; | |
1509 if ( (signed int)pX >= (signed int)pWindow->uFrameX && (signed int)pX <= (signed int)pWindow->uFrameZ | |
1510 && (signed int)pY >= (signed int)pWindow->uFrameY && (signed int)pY <= (signed int)pWindow->uFrameW ) | |
1511 { | |
1512 for ( pButton = pWindow->pControlsHead; ; pButton = pButton->pNext ) | |
1513 { | |
1514 if ( !pButton ) | |
1515 break; | |
1516 switch ( pButton->uButtonType ) | |
1517 { | |
1518 case 1://for dialogue window | |
1519 if ( (signed int)pX >= (signed int)pButton->uX && (signed int)pX <= (signed int)pButton->uZ | |
1520 && (signed int)pY >= (signed int)pButton->uY && (signed int)pY <= (signed int)pButton->uW ) | |
1521 { | |
1522 pMessageType1 = (UIMessageType)pButton->field_1C; | |
1523 if ( pMessageType1 ) | |
1524 pMessageQueue_50CBD0->AddMessage(pMessageType1, pButton->msg_param, 0); | |
1525 GameUI_SetFooterString(pButton->pButtonName); | |
1526 uLastPointedObjectID = 1; | |
1527 return; | |
1528 } | |
1529 break; | |
1530 case 2: | |
1531 if ( pX >= pButton->uX && pX <= pButton->uZ | |
1532 && pY >= pButton->uY && pY <= pButton->uW ) | |
1533 { | |
1534 pMessageType1 = (UIMessageType)pButton->field_1C; | |
1535 if ( pMessageType1 ) | |
1536 pMessageQueue_50CBD0->AddMessage(pMessageType1, pButton->msg_param, 0); | |
1537 GameUI_SetFooterString(pButton->pButtonName); | |
1538 uLastPointedObjectID = 1; | |
1539 return; | |
1540 } | |
1541 break; | |
1542 case 3:// click on skill | |
1543 if ( pX >= pButton->uX && pX <= pButton->uZ | |
1544 && pY >= pButton->uY && pY <= pButton->uW ) | |
1545 { | |
1546 v7 = (LOBYTE(pPlayers[uActiveCharacter]->pActiveSkills[pButton->msg_param]) & 0x3F) + 1; | |
1547 if ( pPlayers[uActiveCharacter]->uSkillPoints < v7 ) | |
1548 sprintf(Str1, pGlobalTXT_LocalizationStrings[469], v7 - pPlayers[uActiveCharacter]->uSkillPoints);// "You need %d more Skill Points to advance here" | |
1549 else | |
1550 sprintf(Str1, pGlobalTXT_LocalizationStrings[468], v7);// "Clicking here will spend %d Skill Points" | |
1551 GameUI_SetFooterString(Str1); | |
1552 uLastPointedObjectID = 1; | |
1553 return; | |
1554 } | |
1555 break; | |
1556 } | |
1557 } | |
1558 } | |
1559 } | |
1560 } | |
1298 | 1561 } |
2019 | 1562 if ( pX <= 467 && pY > 351 && pY <= 479 )//ïðåäåëû íèæíåé îáëàñòè |
1563 { | |
1564 pWindow = &pWindowList[0]; | |
1565 if ( (signed int)pX >= (signed int)pWindow->uFrameX && (signed int)pX <= (signed int)pWindow->uFrameZ | |
1566 && (signed int)pY >= (signed int)pWindow->uFrameY && (signed int)pY <= (signed int)pWindow->uFrameW ) | |
1567 { | |
1568 for ( pButton = pWindow->pControlsHead; ; pButton = pButton->pNext ) | |
1569 { | |
1570 if ( !pButton ) | |
1571 break; | |
1572 switch ( pButton->uButtonType ) | |
1573 { | |
1574 case 1://for dialogue window | |
1575 if ( (signed int)pX >= (signed int)pButton->uX && (signed int)pX <= (signed int)pButton->uZ | |
1576 && (signed int)pY >= (signed int)pButton->uY && (signed int)pY <= (signed int)pButton->uW ) | |
1577 { | |
1578 pMessageType1 = (UIMessageType)pButton->field_1C; | |
1579 if ( pMessageType1 ) | |
1580 pMessageQueue_50CBD0->AddMessage(pMessageType1, pButton->msg_param, 0); | |
1581 GameUI_SetFooterString(pButton->pButtonName); | |
1582 uLastPointedObjectID = 1; | |
1583 return; | |
1584 } | |
1585 break; | |
1586 case 2: | |
1587 if ( pX >= pButton->uX && pX <= pButton->uZ | |
1588 && pY >= pButton->uY && pY <= pButton->uW ) | |
1589 { | |
1590 pMessageType1 = (UIMessageType)pButton->field_1C; | |
1591 if ( pMessageType1 ) | |
1592 pMessageQueue_50CBD0->AddMessage(pMessageType1, pButton->msg_param, 0); | |
1593 GameUI_SetFooterString(pButton->pButtonName); | |
1594 uLastPointedObjectID = 1; | |
1595 return; | |
1596 } | |
1597 break; | |
1598 case 3:// click on skill | |
1599 if ( pX >= pButton->uX && pX <= pButton->uZ | |
1600 && pY >= pButton->uY && pY <= pButton->uW ) | |
1601 { | |
1602 v7 = (LOBYTE(pPlayers[uActiveCharacter]->pActiveSkills[pButton->msg_param]) & 0x3F) + 1; | |
1603 if ( pPlayers[uActiveCharacter]->uSkillPoints < v7 ) | |
1604 sprintf(Str1, pGlobalTXT_LocalizationStrings[469], v7 - pPlayers[uActiveCharacter]->uSkillPoints);// "You need %d more Skill Points to advance here" | |
1605 else | |
1606 sprintf(Str1, pGlobalTXT_LocalizationStrings[468], v7);// "Clicking here will spend %d Skill Points" | |
1607 GameUI_SetFooterString(Str1); | |
1608 uLastPointedObjectID = 1; | |
1609 return; | |
1610 } | |
1611 break; | |
1612 } | |
1613 } | |
1614 } | |
1615 } | |
2020 | 1616 //pMouse->uPointingObjectID = sub_46A99B(); //for software |
2017 | 1617 if ( pMouse->uPointingObjectID == 0 ) |
1298 | 1618 { |
2017 | 1619 if ( uLastPointedObjectID != 0 ) |
1298 | 1620 { |
2017 | 1621 pFooterString[0] = 0; |
1622 bForceDrawFooter = 1; | |
1298 | 1623 } |
1624 } | |
2017 | 1625 uLastPointedObjectID = pMouse->uPointingObjectID; |
1626 return; | |
1298 | 1627 } |
1628 | |
1629 //----- (0044158F) -------------------------------------------------------- | |
1630 void GameUI_DrawCharacterSelectionFrame() | |
1631 { | |
1632 if ( uActiveCharacter ) | |
1633 pRenderer->DrawTextureTransparent(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[uActiveCharacter - 1] - 9, 380, | |
1634 pIcons_LOD->GetTexture(uTextureID_GameUI_CharSelectionFrame)); | |
1635 } | |
1636 | |
1637 //----- (0044162D) -------------------------------------------------------- | |
1638 void GameUI_DrawPartySpells() | |
1639 { | |
1523
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1640 unsigned int v0; // ebp@1 |
2198 | 1641 Texture *spell_texture; // [sp-4h] [bp-1Ch]@12 |
1642 //Texture *v9; // [sp-4h] [bp-1Ch]@21 | |
1298 | 1643 |
1523
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1644 v0 = (signed __int64)((double)GetTickCount() * 0.050000001); |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1645 //v1 = 0; |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1646 for (uint i = 0; i < 14; ++i) |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1647 { |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1648 //v2 = byte_4E5DD8[v1]; |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1649 if (pParty->pPartyBuffs[byte_4E5DD8[i]].uExpireTime) |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1650 { |
1980 | 1651 Texture* tex = pIcons_LOD->GetTexture(pTextureIDs_PartyBuffIcons[i]); |
1523
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1652 //v3 = pTextureIDs_PartyBuffIcons[i]; |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1653 pRenderer->_4A65CC(pPartySpellbuffsUI_XYs[i][0], |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1654 pPartySpellbuffsUI_XYs[i][1], tex, tex, |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1655 v0 + 20 * pPartySpellbuffsUI_smthns[i], 0, 63); |
1298 | 1656 } |
1523
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1657 //++v1; |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1658 } |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1659 //while ( v1 < 14 ); |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1660 if (pCurrentScreen == SCREEN_GAME || pCurrentScreen == SCREEN_NPC_DIALOGUE) |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1661 { |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1662 if (pParty->FlyActive()) |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1663 { |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1664 if ( pParty->bFlying ) |
2198 | 1665 spell_texture = pIcons_LOD->GetTexture(pIconsFrameTable->GetFrame(uIconIdx_FlySpell, v0)->uTextureID); |
1523
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1666 else |
2198 | 1667 spell_texture = pIcons_LOD->GetTexture(pIconsFrameTable->GetFrame(uIconIdx_FlySpell, 0)->uTextureID); |
2155 | 1668 //if ( pRenderer->pRenderD3D ) |
2198 | 1669 pRenderer->DrawTextureIndexed(8, 8, spell_texture); |
2155 | 1670 /*else |
1671 pRenderer->DrawTextureTransparent(8, 8, v7);*/ | |
1523
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1672 } |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1673 if ( pParty->WaterWalkActive() ) |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1674 { |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1675 if ( pParty->uFlags & PARTY_FLAGS_1_STANDING_ON_WATER ) |
2198 | 1676 spell_texture = pIcons_LOD->GetTexture(pIconsFrameTable->GetFrame(uIconIdx_WaterWalk, v0)->uTextureID); |
1523
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1677 else |
2198 | 1678 spell_texture = pIcons_LOD->GetTexture(pIconsFrameTable->GetFrame(uIconIdx_WaterWalk, 0)->uTextureID); |
2155 | 1679 //if ( pRenderer->pRenderD3D ) |
2198 | 1680 pRenderer->DrawTextureIndexed(396, 8, spell_texture); |
2155 | 1681 /*else |
1682 pRenderer->DrawTextureTransparent(396, 8, v9);*/ | |
1523
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1683 } |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1684 } |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1685 for (uint i = 0; i < 4; ++i) |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1686 { |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1687 if ( pParty->pPlayers[i].pPlayerBuffs[PLAYER_BUFF_HAMMERHANDS].uExpireTime ) |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1688 pRenderer->DrawTextureIndexed(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 72, 427, pIcons_LOD->GetTexture(uTextureID_PlayerBuff_Hammerhands)); |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1689 if ( pParty->pPlayers[i].pPlayerBuffs[PLAYER_BUFF_BLESS].uExpireTime ) |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1690 pRenderer->DrawTextureIndexed(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 72, 393, pIcons_LOD->GetTexture(uTextureID_PlayerBuff_Bless)); |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1691 if ( pParty->pPlayers[i].pPlayerBuffs[PLAYER_BUFF_PRESERVATION].uExpireTime ) |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1692 pRenderer->DrawTextureIndexed(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 72, 410, pIcons_LOD->GetTexture(uTextureID_PlayerBuff_Preservation)); |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1693 if ( pParty->pPlayers[i].pPlayerBuffs[PLAYER_BUFF_PAIN_REFLECTION].uExpireTime ) |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1694 pRenderer->DrawTextureIndexed(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 72, 444, pIcons_LOD->GetTexture(uTextureID_PlayerBuff_PainReflection)); |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1695 } |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1696 } |
1298 | 1697 |
1698 //----- (004921C1) -------------------------------------------------------- | |
1699 void GameUI_DrawPortraits(unsigned int _this) | |
1700 { | |
2179 | 1701 unsigned int face_expression_ID; // eax@17 |
1702 PlayerFrame *pFrame; // eax@21 | |
1703 int pTextureID; // eax@57 | |
1704 Texture *pPortrait; // [sp-4h] [bp-1Ch]@27 | |
1523
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1705 |
2182 | 1706 if ( _A750D8_player_speech_timer ) |
1523
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1707 { |
2182 | 1708 _A750D8_player_speech_timer -= (signed int)pMiscTimer->uTimeElapsed; |
1709 if ( _A750D8_player_speech_timer <= 0 ) | |
1523
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1710 { |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1711 if ( pPlayers[uSpeakingCharacter]->CanAct() ) |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1712 pPlayers[uSpeakingCharacter]->PlaySound(PlayerSpeechID, 0); |
2182 | 1713 _A750D8_player_speech_timer = 0i64; |
1523
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1714 } |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1715 } |
1298 | 1716 |
1523
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1717 for (uint i = 0; i < 4; ++i) |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1718 { |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1719 Player* pPlayer = &pParty->pPlayers[i]; |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1720 if ( pPlayer->IsEradicated() ) |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1721 { |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1722 pPortrait = pTexture_PlayerFaceEradicated; |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1723 if ( pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime ) |
2155 | 1724 pRenderer->DrawTranslucent(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i], 388, pPortrait); |
1523
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1725 else |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1726 pRenderer->DrawTextureTransparent(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 1, 388, pPortrait); |
1605
434b796cdfd3
Player::GetMagicalBonus cleaned up, identified a few player only effect spells used in mm6
Grumpy7
parents:
1545
diff
changeset
|
1727 if ( pPlayer->pPlayerBuffs[PLAYER_BUFF_BLESS].uExpireTime | pPlayer->pPlayerBuffs[PLAYER_BUFF_HASTE].uExpireTime |
1822 | 1728 | pPlayer->pPlayerBuffs[PLAYER_BUFF_HEROISM].uExpireTime | pPlayer->pPlayerBuffs[PLAYER_BUFF_SHIELD].uExpireTime |
1605
434b796cdfd3
Player::GetMagicalBonus cleaned up, identified a few player only effect spells used in mm6
Grumpy7
parents:
1545
diff
changeset
|
1729 | pPlayer->pPlayerBuffs[PLAYER_BUFF_STONESKIN].uExpireTime ) |
1523
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1730 sub_441A4E(i); |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1731 continue; |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1732 } |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1733 if (pPlayer->IsDead()) |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1734 { |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1735 pPortrait = pTexture_PlayerFaceDead; |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1736 if ( pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime ) |
2155 | 1737 pRenderer->DrawTranslucent(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i], 388, pPortrait); |
1523
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1738 else |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1739 pRenderer->DrawTextureTransparent(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 1, 388, pPortrait); |
1605
434b796cdfd3
Player::GetMagicalBonus cleaned up, identified a few player only effect spells used in mm6
Grumpy7
parents:
1545
diff
changeset
|
1740 if ( pPlayer->pPlayerBuffs[PLAYER_BUFF_BLESS].uExpireTime | pPlayer->pPlayerBuffs[PLAYER_BUFF_HASTE].uExpireTime |
1822 | 1741 | pPlayer->pPlayerBuffs[PLAYER_BUFF_HEROISM].uExpireTime | pPlayer->pPlayerBuffs[PLAYER_BUFF_SHIELD].uExpireTime |
1605
434b796cdfd3
Player::GetMagicalBonus cleaned up, identified a few player only effect spells used in mm6
Grumpy7
parents:
1545
diff
changeset
|
1742 | pPlayer->pPlayerBuffs[PLAYER_BUFF_STONESKIN].uExpireTime ) |
1523
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1743 sub_441A4E(i); |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1744 continue; |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1745 } |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1746 face_expression_ID = 0; |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1747 for ( uint j = 0; j < pPlayerFrameTable->uNumFrames; ++j ) |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1748 if ( pPlayerFrameTable->pFrames[j].expression == pPlayer->expression ) |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1749 { |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1750 face_expression_ID = j; |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1751 break; |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1752 } |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1753 if ( face_expression_ID == 0 ) |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1754 face_expression_ID = 1; |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1755 if (pPlayer->expression == CHARACTER_EXPRESSION_21) |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1756 pFrame = pPlayerFrameTable->GetFrameBy_y(&pPlayer->_expression21_frameset, &pPlayer->_expression21_animtime, pMiscTimer->uTimeElapsed); |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1757 else |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1758 pFrame = pPlayerFrameTable->GetFrameBy_x(face_expression_ID, pPlayer->uExpressionTimePassed); |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1759 if (pPlayer->field_1AA2 != pFrame->uTextureID - 1 || _this ) |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1760 { |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1761 pPlayer->field_1AA2 = pFrame->uTextureID - 1; |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1762 pPortrait = (Texture *)pTextures_PlayerFaces[i][pPlayer->field_1AA2];//pFace = (Texture *)pTextures_PlayerFaces[i][pFrame->uTextureID]; |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1763 if ( pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime ) |
2155 | 1764 pRenderer->DrawTranslucent(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i], 388, pPortrait); |
1523
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1765 else |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1766 pRenderer->DrawTextureTransparent(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 1, 388, pPortrait); |
1605
434b796cdfd3
Player::GetMagicalBonus cleaned up, identified a few player only effect spells used in mm6
Grumpy7
parents:
1545
diff
changeset
|
1767 if ( pPlayer->pPlayerBuffs[PLAYER_BUFF_BLESS].uExpireTime | pPlayer->pPlayerBuffs[PLAYER_BUFF_HASTE].uExpireTime |
1822 | 1768 | pPlayer->pPlayerBuffs[PLAYER_BUFF_HEROISM].uExpireTime | pPlayer->pPlayerBuffs[PLAYER_BUFF_SHIELD].uExpireTime |
1605
434b796cdfd3
Player::GetMagicalBonus cleaned up, identified a few player only effect spells used in mm6
Grumpy7
parents:
1545
diff
changeset
|
1769 | pPlayer->pPlayerBuffs[PLAYER_BUFF_STONESKIN].uExpireTime ) |
1523
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1770 sub_441A4E(i); |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1771 continue; |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1772 } |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1773 } |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1774 if ( pParty->bTurnBasedModeOn == 1 ) |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1775 { |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1776 if ( pTurnEngine->turn_stage != 1 ) |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1777 { |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1778 if (PID_TYPE(pTurnEngine->pQueue[0].uPackedID) == OBJECT_Player) |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1779 { |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1780 if ( pTurnEngine->uActorQueueSize > 0 ) |
1298 | 1781 { |
1523
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1782 for (uint i = 0; i < (uint)pTurnEngine->uActorQueueSize; ++i) |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1783 { |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1784 if (PID_TYPE(pTurnEngine->pQueue[i].uPackedID) != OBJECT_Player) |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1785 break; |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1786 pTextureID = dword_5079D0; |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1787 if ( pParty->uFlags & 0x10 ) |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1788 pTextureID = dword_5079CC; |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1789 else |
1298 | 1790 { |
1523
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1791 if ( pParty->uFlags & 0x20 ) |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1792 pTextureID = dword_5079C8; |
1298 | 1793 } |
1523
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1794 pRenderer->DrawTextureTransparent(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[PID_ID(pTurnEngine->pQueue[i].uPackedID)] - 4, 385, pIcons_LOD->GetTexture(pTextureID)); |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1795 } |
1298 | 1796 } |
1523
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1797 } |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1798 } |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1799 } |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1800 else |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1801 { |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1802 for (uint i = 0; i < 4; ++i) |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1803 { |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1804 if (pParty->pPlayers[i].CanAct() && !pParty->pPlayers[i].uTimeToRecovery) |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1805 { |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1806 pTextureID = dword_5079D0; |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1807 if ( pParty->uFlags & 0x10 ) |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1808 pTextureID = dword_5079CC; |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1809 else |
1298 | 1810 { |
1523
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1811 if ( pParty->uFlags & 0x20 ) |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1812 pTextureID = dword_5079C8; |
1298 | 1813 } |
1523
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1814 pRenderer->DrawTextureTransparent(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] - 4, 385, pIcons_LOD->GetTexture(pTextureID)); |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1815 } |
1298 | 1816 } |
1523
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1817 } |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1818 } |
1298 | 1819 |
1820 //----- (00441D38) -------------------------------------------------------- | |
1821 void GameUI_DrawMinimap(unsigned int uX, unsigned int uY, unsigned int uZ, unsigned int uW, unsigned int uZoom, unsigned int bRedrawOdmMinimap) | |
1822 { | |
1823 int uHeight; // ebx@6 | |
2101 | 1824 signed int pW; // ebx@23 |
1298 | 1825 int v15; // eax@23 |
1826 double v20; // st7@30 | |
1827 signed int v27; // eax@37 | |
2069 | 1828 //unsigned __int16 *v28; // ecx@37 |
1298 | 1829 signed int v29; // edi@40 |
1523
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1830 int pPoint_X; // edi@72 |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1831 int pPoint_Y; // ebx@72 |
1298 | 1832 unsigned int lPitch; // [sp+20h] [bp-34h]@1 |
2101 | 1833 signed int pY; // [sp+20h] [bp-34h]@23 |
1834 signed int pX; // [sp+24h] [bp-30h]@23 | |
1298 | 1835 signed int v70; // [sp+24h] [bp-30h]@37 |
1836 signed int uBluea; // [sp+28h] [bp-2Ch]@37 | |
1837 int v73; // [sp+2Ch] [bp-28h]@30 | |
1838 signed int uCenterY; // [sp+48h] [bp-Ch]@1 | |
1839 signed int uCenterX; // [sp+4Ch] [bp-8h]@1 | |
1840 signed int uWidth; // [sp+5Ch] [bp+8h]@30 | |
2101 | 1841 signed int pZ; // [sp+60h] [bp+Ch]@23 |
1298 | 1842 float uWb; // [sp+60h] [bp+Ch]@30 |
1507 | 1843 unsigned int pColor; |
1298 | 1844 |
1845 uCenterX = (uX + uZ) / 2; | |
1846 uCenterY = (uY + uW) / 2; | |
1847 lPitch = pRenderer->uTargetSurfacePitch; | |
1980 | 1848 bool bWizardEyeActive = pParty->WizardEyeActive(); |
1849 int uWizardEyeSkillLevel = pParty->WizardEyeSkillLevel(); | |
1505 | 1850 if ( CheckHiredNPCSpeciality(Cartographer) ) |
1298 | 1851 { |
1852 bWizardEyeActive = true; | |
1853 uWizardEyeSkillLevel = 2; | |
1854 } | |
1505 | 1855 extern bool wizard_eye; |
1856 if ( wizard_eye ) | |
1857 { | |
1298 | 1858 bWizardEyeActive = true; |
1859 uWizardEyeSkillLevel = 3; | |
1505 | 1860 } |
1298 | 1861 pRenderer->SetRasterClipRect(uX, uY, uZ - 1, uW - 1); |
1862 uHeight = uW - uY; | |
1863 uWidth = uZ - uX; | |
1864 | |
1507 | 1865 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor) |
1298 | 1866 { |
1980 | 1867 uchar* pMapLod0 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].pLevelOfDetail0_prolly_alpha_mask; |
1868 ushort* pPal = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].pPalette16; | |
1523
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1869 v73 = (1 << (pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uWidthLn2 + 16)) / (signed int)uZoom; |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1870 v20 = (double)(pParty->vPosition.x + 32768) / (double)(1 << (16 - pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uWidthLn2)); |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1871 uWb = (double)(32768 - pParty->vPosition.y) / (double)(1 << (16 - pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uWidthLn2)); |
1298 | 1872 switch (uZoom) |
1873 { | |
1874 case 512: | |
1875 { | |
1876 v20 = v20 - (double)(uWidth / 2); | |
1507 | 1877 uWb = uWb - (double)(uHeight / 2); |
1298 | 1878 } |
1879 break; | |
1880 case 1024: | |
1881 { | |
1882 v20 = v20 - (double)(uWidth / 4); | |
1507 | 1883 uWb = uWb - (double)(uHeight / 4); |
1298 | 1884 } |
1885 break; | |
1886 case 2048: | |
1887 { | |
1888 v20 = v20 - (double)(uWidth / 8); | |
1507 | 1889 uWb = uWb - (double)(uHeight / 8); |
1298 | 1890 } |
1891 break; | |
1892 default: assert(false); | |
1893 } | |
2069 | 1894 |
1895 static unsigned __int16 pOdmMinimap[117][137]; | |
1298 | 1896 assert(sizeof(pOdmMinimap) == 137 * 117 * sizeof(short)); |
1897 | |
1898 v70 = floorf(v20 * 65536.0 + 0.5f);//LODWORD(v24); | |
1899 uBluea = floorf(uWb * 65536.0 + 0.5f);//LODWORD(v25); | |
1900 v27 = uBluea >> 16; | |
2069 | 1901 //v28 = &pRenderer->pTargetSurface[uX + uY * lPitch]; |
1902 | |
1298 | 1903 if (pMapLod0 && bRedrawOdmMinimap) |
1904 { | |
1905 assert(uWidth == 137 && uHeight == 117); | |
1906 //auto pMinimap = (unsigned __int16 *)pOdmMinimap; | |
1907 | |
1980 | 1908 ushort mapWidth = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uTextureWidth; |
1298 | 1909 |
1507 | 1910 v29 = v70 >> 16; |
1911 for (int y = 0; y < uHeight; ++y) | |
1912 { | |
1980 | 1913 uchar* pMapLod0Line = &pMapLod0[v27 * mapWidth]; |
1507 | 1914 for (int x = 0; x < uWidth; ++x) |
1915 { | |
1916 //*pMinimap++ = pPal[pMapLod0Line[v29]]; | |
2069 | 1917 pRenderer->WritePixel16(uX + x, uY + y, pPal[pMapLod0Line[v29]]); |
1918 v29 = (v70 + x * v73) >> 16; | |
1919 } | |
2070 | 1920 uBluea += v73; |
1921 v27 = uBluea >> 16; | |
2069 | 1922 } |
1923 | |
1924 /*v29 = v70 >> 16; | |
1925 for (int y = 0; y < uHeight; ++y) | |
1926 { | |
1927 uchar* pMapLod0Line = &pMapLod0[v27 * mapWidth]; | |
1928 for (int x = 0; x < uWidth; ++x) | |
1929 { | |
1930 //*pMinimap++ = pPal[pMapLod0Line[v29]]; | |
1507 | 1931 pOdmMinimap[y][x] = pPal[pMapLod0Line[v29]]; |
1932 v29 = (v70 + x * v73) >> 16; | |
1933 } | |
1934 v29 = v70 >> 16; | |
1935 v28 += 137 - uWidth; | |
1936 uBluea += v73; | |
1937 v27 = uBluea >> 16; | |
2069 | 1938 }*/ |
1298 | 1939 } |
1940 | |
2069 | 1941 /*for (int y = 0; y < 117; ++y) |
1298 | 1942 { |
1943 for (int x = 0; x < 137; ++x) | |
1944 { | |
1945 *v28++ = pOdmMinimap[y][x]; | |
1946 } | |
1947 v28 += lPitch - 137; | |
2069 | 1948 }*/ |
1298 | 1949 uNumBlueFacesInBLVMinimap = 0; |
1950 } | |
1507 | 1951 else// uCurrentlyLoadedLevelType == LEVEL_Indoor |
1298 | 1952 { |
1953 pRenderer->FillRectFast(uX, uY, uZ - uX, uHeight, 0xF); | |
1954 uNumBlueFacesInBLVMinimap = 0; | |
1955 | |
1523
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
1956 for (uint i = 0; i < (uint)pIndoor->pMapOutlines->uNumOutlines; ++i) |
1298 | 1957 { |
1980 | 1958 BLVMapOutline* pOutline = &pIndoor->pMapOutlines->pOutlines[i]; |
1959 BLVFace* pFace1 = pIndoor->pFaces + pOutline->uFace1ID; | |
1960 BLVFace* pFace2 = pIndoor->pFaces + pOutline->uFace2ID; | |
1298 | 1961 if (pFace1->Visible() && pFace2->Visible()) |
1962 { | |
1507 | 1963 if ( pOutline->uFlags & 1 ) |
2169 | 1964 { |
1965 if (bWizardEyeActive && uWizardEyeSkillLevel >= 3 && | |
1966 (pFace1->Clickable() || pFace2->Clickable()) && | |
1967 (pIndoor->pFaceExtras[pFace1->uFaceExtraID].uEventID || pIndoor->pFaceExtras[pFace2->uFaceExtraID].uEventID)) | |
1968 { | |
1969 if (uNumBlueFacesInBLVMinimap < 49) | |
1970 pBlueFacesInBLVMinimapIDs[uNumBlueFacesInBLVMinimap++] = i; | |
1971 } | |
1972 else | |
1973 { | |
1974 pX = uCenterX + ((signed int)(((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex1ID].x)) << 16) - uZoom * pParty->vPosition.x) >> 16); | |
1975 pY = uCenterY - ((signed int)(((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex1ID].y)) << 16) - uZoom * pParty->vPosition.y) >> 16); | |
1976 pZ = uCenterX + ((signed int)(((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex2ID].x)) << 16) - uZoom * pParty->vPosition.x) >> 16); | |
1977 pW = uCenterY - ((signed int)(((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex2ID].y)) << 16) - uZoom * pParty->vPosition.y) >> 16); | |
1978 v15 = abs(pOutline->sZ - pParty->vPosition.z) / 8; | |
1979 if ( v15 > 100 ) | |
1980 v15 = 100; | |
1981 pRenderer->RasterLine2D(pX, pY, pZ, pW, viewparams->pPalette[-v15 + 200]); | |
1982 } | |
1983 continue; | |
1984 } | |
1298 | 1985 if (pFace1->uAttributes & 0x80 || pFace2->uAttributes & 0x80) |
2169 | 1986 { |
1987 pOutline->uFlags = pOutline->uFlags | 1; | |
1988 pIndoor->_visible_outlines[i >> 3] |= 1 << (7 - i % 8); | |
1989 if (bWizardEyeActive && uWizardEyeSkillLevel >= 3 && | |
1990 (pFace1->Clickable() || pFace2->Clickable()) && | |
1991 (pIndoor->pFaceExtras[pFace1->uFaceExtraID].uEventID || pIndoor->pFaceExtras[pFace2->uFaceExtraID].uEventID)) | |
1992 { | |
1993 if (uNumBlueFacesInBLVMinimap < 49) | |
1994 pBlueFacesInBLVMinimapIDs[uNumBlueFacesInBLVMinimap++] = i; | |
1995 } | |
1996 else | |
1997 { | |
1998 pX = uCenterX + ((signed int)(((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex1ID].x)) << 16) - uZoom * pParty->vPosition.x) >> 16); | |
1999 pY = uCenterY - ((signed int)(((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex1ID].y)) << 16) - uZoom * pParty->vPosition.y) >> 16); | |
2000 pZ = uCenterX + ((signed int)(((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex2ID].x)) << 16) - uZoom * pParty->vPosition.x) >> 16); | |
2001 pW = uCenterY - ((signed int)(((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex2ID].y)) << 16) - uZoom * pParty->vPosition.y) >> 16); | |
2002 v15 = abs(pOutline->sZ - pParty->vPosition.z) / 8; | |
2003 if ( v15 > 100 ) | |
2004 v15 = 100; | |
2005 pRenderer->RasterLine2D(pX, pY, pZ, pW, viewparams->pPalette[-v15 + 200]); | |
2006 } | |
2007 continue; | |
2008 } | |
1507 | 2009 } |
1298 | 2010 } |
1507 | 2011 |
2012 for (uint i = 0; i < uNumBlueFacesInBLVMinimap; ++i) | |
1298 | 2013 { |
1980 | 2014 BLVMapOutline* pOutline = &pIndoor->pMapOutlines->pOutlines[pBlueFacesInBLVMinimapIDs[i]]; |
2169 | 2015 pX = uCenterX + ((signed int)(((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pOutline->uVertex1ID].x)) << 16) - uZoom * pParty->vPosition.x) >> 16); |
2016 pY = uCenterY - ((signed int)(((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pOutline->uVertex1ID].y)) << 16) - uZoom * pParty->vPosition.y) >> 16); | |
2017 pZ = uCenterX + ((signed int)(((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pOutline->uVertex2ID].x)) << 16) - uZoom * pParty->vPosition.x) >> 16); | |
2018 pW = uCenterY - ((signed int)(((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pOutline->uVertex2ID].y)) << 16) - uZoom * pParty->vPosition.y) >> 16); | |
1523
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
2019 pRenderer->RasterLine2D(pX, pY, pZ, pW, ui_game_minimap_outline_color); |
1298 | 2020 } |
2021 } | |
2022 | |
1523
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
2023 //draw arrow on the minimap(include. Ritor1) |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
2024 uint arrow_idx; |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
2025 unsigned int rotate = pParty->sRotationY & stru_5C6E00->uDoublePiMask; |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
2026 if ( (signed int)rotate <= 1920 ) |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
2027 arrow_idx = 6; |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
2028 if ( (signed int)rotate < 1664 ) |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
2029 arrow_idx = 5; |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
2030 if ( (signed int)rotate <= 1408 ) |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
2031 arrow_idx = 4; |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
2032 if ( (signed int)rotate < 1152 ) |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
2033 arrow_idx = 3; |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
2034 if ( (signed int)rotate <= 896 ) |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
2035 arrow_idx = 2; |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
2036 if ( (signed int)rotate < 640 ) |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
2037 arrow_idx = 1; |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
2038 if ( (signed int)rotate <= 384 ) |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
2039 arrow_idx = 0; |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
2040 if ( (signed int)rotate < 128 || (signed int)rotate > 1920 ) |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
2041 arrow_idx = 7; |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
2042 pRenderer->DrawTextureTransparent(uCenterX - 3, uCenterY - 3, pIcons_LOD->GetTexture(pTextureIDs_pMapDirs[arrow_idx]));//ñòðåëêà |
1298 | 2043 |
1523
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
2044 //draw objects on the minimap |
1507 | 2045 if ( bWizardEyeActive ) |
1298 | 2046 { |
1507 | 2047 if ( uWizardEyeSkillLevel >= 2 ) |
2048 { | |
2049 for ( uint i = 0; i < uNumSpriteObjects; ++i ) | |
1298 | 2050 { |
1507 | 2051 if ( !pSpriteObjects[i].uType || !pSpriteObjects[i].uObjectDescID ) |
2052 continue; | |
2053 //if (uWizardEyeSkillLevel == 1 | |
2166 | 2054 pPoint_X = uCenterX + fixpoint_mul((pSpriteObjects[i].vPosition.x - pParty->vPosition.x), uZoom); |
2055 pPoint_Y = uCenterY - fixpoint_mul((pSpriteObjects[i].vPosition.y - pParty->vPosition.y), uZoom); | |
2155 | 2056 //if ( pPoint_X >= pRenderer->raster_clip_x && pPoint_X <= pRenderer->raster_clip_z && |
2057 // pPoint_Y >= pRenderer->raster_clip_y && pPoint_Y <= pRenderer->raster_clip_w) | |
1298 | 2058 { |
1507 | 2059 if (pObjectList->pObjects[pSpriteObjects[i].uObjectDescID].uFlags & OBJECT_DESC_UNPICKABLE) |
1298 | 2060 { |
1523
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
2061 pRenderer->RasterLine2D(pPoint_X, pPoint_Y, pPoint_X, pPoint_Y, ui_game_minimap_projectile_color); |
1298 | 2062 } |
1507 | 2063 else if ( uZoom > 512 ) |
1298 | 2064 { |
1523
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
2065 pRenderer->RasterLine2D(pPoint_X - 2, pPoint_Y, pPoint_X - 2, pPoint_Y + 1, ui_game_minimap_treasure_color); |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
2066 pRenderer->RasterLine2D(pPoint_X - 1, pPoint_Y - 1, pPoint_X - 1, pPoint_Y + 1, ui_game_minimap_treasure_color); |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
2067 pRenderer->RasterLine2D(pPoint_X, pPoint_Y - 2, pPoint_X, pPoint_Y + 1, ui_game_minimap_treasure_color); |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
2068 pRenderer->RasterLine2D(pPoint_X + 1, pPoint_Y - 1, pPoint_X + 1, pPoint_Y + 1, ui_game_minimap_treasure_color); |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
2069 pRenderer->RasterLine2D(pPoint_X + 2, pPoint_Y, pPoint_X + 2, pPoint_Y + 1, ui_game_minimap_treasure_color); |
1507 | 2070 } |
2071 else | |
2072 { | |
1523
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
2073 pRenderer->RasterLine2D(pPoint_X - 1, pPoint_Y - 1, pPoint_X - 1, pPoint_Y, ui_game_minimap_treasure_color); |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
2074 pRenderer->RasterLine2D(pPoint_X, pPoint_Y - 1, pPoint_X, pPoint_Y, ui_game_minimap_treasure_color); |
1298 | 2075 } |
2076 } | |
2077 } | |
2078 } | |
1507 | 2079 for ( uint i = 0; i < uNumActors; ++i )//draw actors(îòðèñîâêà ìîíñòðîâ è íïñ) |
2080 { | |
2081 if ( pActors[i].uAIState != Removed && pActors[i].uAIState != Disabled | |
2166 | 2082 && (pActors[i].uAIState == Dead || pActors[i].uAttributes & 0x8000) ) |
1507 | 2083 { |
2166 | 2084 pPoint_X = uCenterX + (fixpoint_mul((pActors[i].vPosition.x - pParty->vPosition.x), uZoom)); |
2085 pPoint_Y = uCenterY - (fixpoint_mul((pActors[i].vPosition.y - pParty->vPosition.y), uZoom)); | |
2155 | 2086 //if ( pPoint_X >= pRenderer->raster_clip_x && pPoint_X <= pRenderer->raster_clip_z |
2087 // && pPoint_Y >= pRenderer->raster_clip_y && pPoint_Y <= pRenderer->raster_clip_w ) | |
1507 | 2088 { |
2089 pColor = ui_game_minimap_actor_friendly_color; | |
2166 | 2090 if ( pActors[i].uAttributes & 0x1000000 ) |
1507 | 2091 pColor = ui_game_minimap_actor_hostile_color; |
2092 if ( pActors[i].uAIState == Dead) | |
2093 pColor = ui_game_minimap_actor_corpse_color; | |
2094 if ( uZoom > 1024 ) | |
2095 { | |
1523
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
2096 pRenderer->RasterLine2D(pPoint_X - 2, pPoint_Y - 1, pPoint_X - 2, pPoint_Y + 1, pColor); |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
2097 pRenderer->RasterLine2D(pPoint_X - 1, pPoint_Y - 2, pPoint_X - 1, pPoint_Y + 2, pColor); |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
2098 pRenderer->RasterLine2D(pPoint_X, pPoint_Y - 2, pPoint_X, pPoint_Y + 2, pColor); |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
2099 pRenderer->RasterLine2D(pPoint_X + 1, pPoint_Y - 2, pPoint_X + 1, pPoint_Y + 2, pColor); |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
2100 pRenderer->RasterLine2D(pPoint_X + 2, pPoint_Y - 1, pPoint_X + 2, pPoint_Y + 1, pColor); |
1507 | 2101 } |
2102 else | |
2103 { | |
1523
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
2104 pRenderer->RasterLine2D(pPoint_X - 1, pPoint_Y - 1, pPoint_X - 1, pPoint_Y, pColor); |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
2105 pRenderer->RasterLine2D(pPoint_X, pPoint_Y - 1, pPoint_X, pPoint_Y, pColor); |
1507 | 2106 } |
2107 } | |
2108 } | |
2109 } | |
2110 for ( uint i = 0; i < (signed int)uNumLevelDecorations; ++i )//draw items(îòðèñîâêà ïðåäìåòîâ) | |
2111 { | |
2112 if ( pLevelDecorations[i].uFlags & 8 ) | |
2113 { | |
2166 | 2114 pPoint_X = uCenterX + (fixpoint_mul((pLevelDecorations[i].vPosition.x - pParty->vPosition.x), uZoom)); |
2115 pPoint_Y = uCenterY - (fixpoint_mul((pLevelDecorations[i].vPosition.y - pParty->vPosition.y), uZoom)); | |
2155 | 2116 //if ( pPoint_X >= pRenderer->raster_clip_x && pPoint_X <= pRenderer->raster_clip_z |
2117 // && pPoint_Y >= pRenderer->raster_clip_y && pPoint_Y <= pRenderer->raster_clip_w ) | |
1507 | 2118 { |
2119 if ( (signed int)uZoom > 512 ) | |
2120 { | |
1523
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
2121 pRenderer->RasterLine2D(pPoint_X - 1, pPoint_Y - 1, pPoint_X - 1, pPoint_Y + 1, ui_game_minimap_decoration_color_1); |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
2122 pRenderer->RasterLine2D(pPoint_X, pPoint_Y - 1, pPoint_X, pPoint_Y + 1, ui_game_minimap_decoration_color_1); |
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
2123 pRenderer->RasterLine2D(pPoint_X + 1, pPoint_Y - 1, pPoint_X + 1, pPoint_Y + 1, ui_game_minimap_decoration_color_1); |
1507 | 2124 } |
2125 else | |
1523
53265d238d94
interaction_distance_limit for 3DModel in DrawStatusText
Ritor1
parents:
1509
diff
changeset
|
2126 pRenderer->RasterLine2D(pPoint_X, pPoint_Y, pPoint_X, pPoint_Y, ui_game_minimap_decoration_color_1); |
1507 | 2127 } |
2128 } | |
2129 } | |
1298 | 2130 } |
1507 | 2131 pRenderer->DrawTextureTransparent(468, 0, pIcons_LOD->GetTexture(uTextureID_Minimap_Loop));//draw minimap_loop |
1298 | 2132 pRenderer->SetTextureClipRect(541, 0, 567, 480); |
1507 | 2133 pRenderer->DrawTextureIndexed(floorf(((double)pParty->sRotationY * 0.1171875) + 0.5f) + 285, 136, pIcons_LOD->GetTexture(uTextureID_Compas));//draw compas |
1298 | 2134 pRenderer->ResetTextureClipRect(); |
2135 } | |
2136 | |
2137 //----- (00441498) -------------------------------------------------------- | |
1458 | 2138 void GameUI_DrawTorchlightAndWizardEye() |
1505 | 2139 { |
2140 if (pCurrentScreen == SCREEN_GAME | |
2141 || pCurrentScreen == SCREEN_MENU | |
2142 || pCurrentScreen == SCREEN_OPTIONS | |
2143 || pCurrentScreen == SCREEN_REST | |
2144 || pCurrentScreen == SCREEN_SPELL_BOOK | |
2145 || pCurrentScreen == SCREEN_CHEST | |
2146 || pCurrentScreen == SCREEN_SAVEGAME | |
2147 || pCurrentScreen == SCREEN_LOADGAME | |
2148 || pCurrentScreen == SCREEN_CHEST_INVENTORY | |
2149 || pCurrentScreen == SCREEN_BOOKS | |
2150 || pCurrentScreen == SCREEN_BRANCHLESS_NPC_DIALOG ) | |
2151 { | |
2152 if (pParty->TorchlightActive()) | |
1298 | 2153 { |
1980 | 2154 IconFrame* icon = pIconsFrameTable->GetFrame((signed __int16)pUIAnum_Torchlight->uIconID, pEventTimer->Time()); |
1505 | 2155 pRenderer->DrawTextureTransparent(pUIAnum_Torchlight->x, pUIAnum_Torchlight->y, pIcons_LOD->GetTexture(icon->uTextureID)); |
1298 | 2156 } |
1505 | 2157 if (pParty->WizardEyeActive()) |
2158 { | |
1980 | 2159 IconFrame* icon = pIconsFrameTable->GetFrame((signed __int16)pUIAnim_WizardEye->uIconID, pEventTimer->Time()); |
1505 | 2160 pRenderer->DrawTextureTransparent(pUIAnim_WizardEye->x, pUIAnim_WizardEye->y, pIcons_LOD->GetTexture(icon->uTextureID)); |
2161 } | |
2162 } | |
2163 } | |
1298 | 2164 // 4E28F8: using guessed type int pCurrentScreen; |
2165 | |
2166 | |
2167 //----- (00491F87) -------------------------------------------------------- | |
2168 void GameUI_DrawHiredNPCs() | |
2169 { | |
2170 unsigned int v13; // eax@23 | |
2171 char pContainer[20]; // [sp+Ch] [bp-30h]@18 | |
2172 signed int uFrameID; // [sp+24h] [bp-18h]@19 | |
2173 int v22; // [sp+34h] [bp-8h]@2 | |
1505 | 2174 unsigned __int8 pNPC_limit_ID; // [sp+3Bh] [bp-1h]@2 |
1298 | 2175 |
2176 if ( bNoNPCHiring != 1 ) | |
2177 { | |
1505 | 2178 pNPC_limit_ID = 0; |
1298 | 2179 v22 = 0; |
2180 if (pParty->pHirelings[0].pName) | |
2181 pTmpBuf[v22++] = 0; | |
2182 if (pParty->pHirelings[1].pName) | |
2183 pTmpBuf[v22++] = 1; | |
2184 | |
2185 for (uint i = 0; i < pNPCStats->uNumNewNPCs; ++i) | |
2186 { | |
2187 if (pNPCStats->pNewNPCData[i].uFlags & 128) | |
2188 { | |
2189 if (!pParty->pHirelings[0].pName || strcmp(pNPCStats->pNewNPCData[i].pName, pParty->pHirelings[0].pName)) | |
2190 { | |
2191 if (!pParty->pHirelings[1].pName || strcmp(pNPCStats->pNewNPCData[i].pName, pParty->pHirelings[1].pName)) | |
2192 pTmpBuf[v22++] = i + 2; | |
2193 } | |
2194 } | |
2195 } | |
2196 | |
1793
4dee76d79c78
dword_5B65CC to npcIdToDismissAfterDialogue, Party::field_709 to Party::hirelingScrollPosition
Grumpy7
parents:
1758
diff
changeset
|
2197 for ( int i = pParty->hirelingScrollPosition; i < v22 && pNPC_limit_ID < 2; i++ ) |
1298 | 2198 { |
1505 | 2199 if ( (unsigned __int8)pTmpBuf[i] >= 2 ) |
1298 | 2200 { |
1505 | 2201 sprintf(pContainer, "NPC%03d", pNPCStats->pNPCData[(unsigned __int8)pTmpBuf[i] + 499].uPortraitID); |
2202 pRenderer->DrawTextureIndexed(pHiredNPCsIconsOffsetsX[pNPC_limit_ID], pHiredNPCsIconsOffsetsY[pNPC_limit_ID], | |
2203 pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE))); | |
1298 | 2204 } |
2205 else | |
2206 { | |
1505 | 2207 sprintf(pContainer, "NPC%03d", pParty->pHirelings[(unsigned __int8)pTmpBuf[i]].uPortraitID); |
2208 pRenderer->DrawTextureIndexed(pHiredNPCsIconsOffsetsX[pNPC_limit_ID], pHiredNPCsIconsOffsetsY[pNPC_limit_ID], | |
2209 pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE))); | |
2210 if ( pParty->pHirelings[(unsigned __int8)pTmpBuf[i]].evt_A == 1 ) | |
1298 | 2211 { |
1505 | 2212 uFrameID = pParty->pHirelings[(unsigned __int8)pTmpBuf[i]].evt_B; |
2213 v13 = 0; | |
1802 | 2214 if (pIconsFrameTable->uNumIcons) |
1298 | 2215 { |
1505 | 2216 for ( v13 = 0; v13 < pIconsFrameTable->uNumIcons; ++v13 ) |
1298 | 2217 { |
1505 | 2218 if ( !_stricmp("spell96", pIconsFrameTable->pIcons[v13].pAnimationName) ) |
2219 break; | |
1298 | 2220 } |
2221 } | |
1505 | 2222 pRenderer->DrawTextureTransparent(pHiredNPCsIconsOffsetsX[pNPC_limit_ID], pHiredNPCsIconsOffsetsY[pNPC_limit_ID], |
2223 &pIcons_LOD->pTextures[pIconsFrameTable->GetFrame(v13, uFrameID)->uTextureID]); | |
1298 | 2224 } |
2225 } | |
1505 | 2226 ++pNPC_limit_ID; |
1298 | 2227 } |
2228 } | |
2229 } | |
2230 | |
2231 //----- (004178FE) -------------------------------------------------------- | |
1507 | 2232 unsigned int UI_GetHealthManaAndOtherQualitiesStringColor(signed int current_pos, signed int base_pos) |
1298 | 2233 { |
1507 | 2234 unsigned __int16 R, G, B; |
1298 | 2235 |
1507 | 2236 if ( current_pos <= base_pos ) |
1298 | 2237 { |
1507 | 2238 if ( current_pos == base_pos )//White |
1298 | 2239 return 0; |
1507 | 2240 if ( 100 * current_pos / base_pos >= 25 )//Yellow( current_pos > 1/4 ) |
2241 R = 255, G = 255, B = 100; | |
2242 else//Red( current_pos < 1/4 ) | |
2243 R = 255, G = 0, B = 0; | |
1298 | 2244 } |
1507 | 2245 else//Green |
2246 R = 0, G = 255, B = 0; | |
2069 | 2247 return Color16(R, G, B); |
1298 | 2248 } |
2249 | |
2250 //----- (00417939) -------------------------------------------------------- | |
1458 | 2251 int GetConditionDrawColor(unsigned int uConditionIdx) |
1298 | 2252 { |
1458 | 2253 switch (uConditionIdx) |
1298 | 2254 { |
1458 | 2255 case Condition_Zombie: |
2256 case Condition_Good: | |
2257 return ui_character_condition_normal_color; | |
2258 | |
2259 case Condition_Cursed: | |
2260 case Condition_Weak: | |
2261 case Condition_Fear: | |
2262 case Condition_Drunk: | |
2263 case Condition_Insane: | |
2187 | 2264 case Condition_Poison_Weak: |
2265 case Condition_Disease_Weak: | |
1458 | 2266 return ui_character_condition_light_color; |
2267 | |
2268 case Condition_Sleep: | |
2187 | 2269 case Condition_Poison_Medium: |
2270 case Condition_Disease_Medium: | |
1458 | 2271 case Condition_Paralyzed: |
2272 case Condition_Unconcious: | |
2273 return ui_character_condition_moderate_color; | |
2274 | |
2187 | 2275 case Condition_Poison_Severe: |
2276 case Condition_Disease_Severe: | |
1458 | 2277 case Condition_Dead: |
2278 case Condition_Pertified: | |
2279 case Condition_Eradicated: | |
2280 return ui_character_condition_severe_color; | |
1298 | 2281 } |
1802 | 2282 Error("Invalid condition (%u)", uConditionIdx); |
1298 | 2283 } |