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