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