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