Mercurial > mm7
annotate UI/UIPopup.cpp @ 1702:5cbd88f8a2eb
fixing paperdoll bug
author | Grumpy7 |
---|---|
date | Sun, 22 Sep 2013 19:48:02 +0200 |
parents | 33c7cc2d48d5 |
children | a395359afc8f 8251e59fd7c1 |
rev | line source |
---|---|
1298 | 1 #ifdef _MSC_VER |
2 #define _CRT_SECURE_NO_WARNINGS | |
3 #endif | |
4 | |
1299 | 5 #include "..\MM7.h" |
1298 | 6 |
1299 | 7 #include "..\Mouse.h" |
1298 | 8 |
1299 | 9 #include "..\Sprites.h" |
10 #include "..\Vis.h" | |
11 #include "..\Game.h" | |
12 #include "..\GUIWindow.h" | |
13 #include "..\GUIFont.h" | |
14 #include "..\Party.h" | |
15 #include "..\AudioPlayer.h" | |
16 #include "..\LOD.h" | |
17 #include "..\Actor.h" | |
18 #include "..\Viewport.h" | |
19 #include "..\SpriteObject.h" | |
20 #include "..\ObjectList.h" | |
21 #include "..\Chest.h" | |
22 #include "..\PaletteManager.h" | |
23 #include "..\Time.h" | |
24 #include "..\texts.h" | |
1298 | 25 |
1299 | 26 #include "..\mm7_data.h" |
1298 | 27 |
28 static char static_sub_417BB5_out_string[1200]; // static to a file, not sub actually | |
29 | |
1393 | 30 |
31 //----- (004179BC) -------------------------------------------------------- | |
1678 | 32 void CharacterUI_DrawTooltip(const char *Title, const char *content) |
1393 | 33 { |
1678 | 34 GUIWindow popup_window; // [sp+Ch] [bp-5Ch]@1 |
1393 | 35 POINT v6; // [sp+60h] [bp-8h]@1 |
36 | |
1678 | 37 memset(&popup_window, 0, 0x54u); |
38 popup_window.uFrameWidth = 384; | |
39 popup_window.uFrameHeight = 256; | |
40 popup_window.uFrameX = 128; | |
41 popup_window.uFrameY = pMouse->GetCursorPos(&v6)->y + 30; | |
42 popup_window.uFrameHeight = pFontSmallnum->CalcTextHeight(content, &popup_window, 24, 0) + 2 * LOBYTE(pFontLucida->uFontHeight) + 24; | |
43 popup_window.uFrameZ = popup_window.uFrameX + popup_window.uFrameWidth - 1; | |
44 popup_window.uFrameW = popup_window.uFrameY + popup_window.uFrameHeight - 1; | |
45 popup_window.DrawMessageBox(0); | |
46 | |
47 popup_window.uFrameX += 12; | |
48 popup_window.uFrameWidth -= 24; | |
49 popup_window.uFrameY += 12; | |
50 popup_window.uFrameHeight -= 12; | |
51 popup_window.uFrameZ = popup_window.uFrameX + popup_window.uFrameWidth - 1; | |
52 popup_window.uFrameW = popup_window.uFrameY + popup_window.uFrameHeight - 1; | |
53 sprintf(pTmpBuf.data(), "\f%05d%s\f00000\n", ui_character_tooltip_header_default_color, Title); | |
54 popup_window.DrawTitleText(pFontCreate, 0, 0, 0, pTmpBuf.data(), 3); | |
55 popup_window.DrawText(pFontSmallnum, 1, LOBYTE(pFontLucida->uFontHeight), 0, content, 0, 0, 0); | |
1393 | 56 } |
57 | |
1298 | 58 //----- (004151D9) -------------------------------------------------------- |
59 void __fastcall DrawPopupWindow(unsigned int uX, unsigned int uY, unsigned int uWidth, unsigned int uHeight) | |
1678 | 60 { |
61 unsigned int uNumTiles; // [sp+2Ch] [bp-Ch]@6 | |
62 unsigned int coord_x; // [sp+2Ch] [bp-Ch]@3 | |
63 unsigned int coord_y; // [sp+34h] [bp-4h]@5 | |
1298 | 64 |
1678 | 65 pRenderer->SetTextureClipRect(uX, uY, uX + uWidth, uY + uHeight); |
66 if ( pIcons_LOD->GetTexture(uTextureID_Parchment)->uTextureWidth && pIcons_LOD->GetTexture(uTextureID_Parchment)->uTextureHeight) | |
67 { | |
68 uNumTiles = uWidth / pIcons_LOD->GetTexture(uTextureID_Parchment)->uTextureWidth; | |
69 if ( uWidth % pIcons_LOD->GetTexture(uTextureID_Parchment)->uTextureWidth ) | |
70 ++uNumTiles; | |
71 coord_y = uY; | |
72 for ( uint j = 0; j <= uHeight / pIcons_LOD->GetTexture(uTextureID_Parchment)->uTextureHeight; j++ ) | |
1298 | 73 { |
1678 | 74 coord_x = uX - pIcons_LOD->GetTexture(uTextureID_Parchment)->uTextureWidth; |
75 for ( uint i = uNumTiles + 1; i; --i ) | |
76 { | |
77 coord_x += pIcons_LOD->GetTexture(uTextureID_Parchment)->uTextureWidth; | |
78 pRenderer->DrawTextureIndexed(coord_x, coord_y, pIcons_LOD->GetTexture(uTextureID_Parchment)); | |
79 } | |
80 coord_y += pIcons_LOD->GetTexture(uTextureID_Parchment)->uTextureHeight; | |
1298 | 81 } |
1678 | 82 pRenderer->DrawTextureTransparent(uX, uY, pIcons_LOD->GetTexture(uTextureID_5076AC)); |
83 pRenderer->DrawTextureTransparent(uX, uY + uHeight - 32, pIcons_LOD->GetTexture(uTextureID_5076B4)); | |
84 pRenderer->DrawTextureTransparent(uX + uWidth - 32, uY, pIcons_LOD->GetTexture(uTextureID_5076A8)); | |
85 pRenderer->DrawTextureTransparent(uX + uWidth - 32, uY + uHeight - 32, pIcons_LOD->GetTexture(uTextureID_5076B0)); | |
86 if ( uWidth > 64 ) | |
87 { | |
88 pRenderer->SetTextureClipRect(uX + 32, uY, uX + uWidth - 32, uY + uHeight); | |
89 pRenderer->DrawTextureTransparent(uX + 32, uY, pIcons_LOD->GetTexture(uTextureID_507698)); | |
90 pRenderer->DrawTextureTransparent(uX + 32, uY + uHeight - 10, pIcons_LOD->GetTexture(uTextureID_5076A4)); | |
91 if ( uWidth > 512 ) | |
92 { | |
93 pRenderer->DrawTextureTransparent(uX + 544, uY, pIcons_LOD->GetTexture(uTextureID_507698)); | |
94 pRenderer->DrawTextureTransparent(uX + 544, uY + uHeight - 10, pIcons_LOD->GetTexture(uTextureID_5076A4)); | |
95 } | |
96 } | |
97 if ( uHeight > 64 ) | |
98 { | |
99 pRenderer->SetTextureClipRect(uX, uY + 32, uX + uWidth, uY + uHeight - 32); | |
100 pRenderer->DrawTextureTransparent(uX, uY + 32, pIcons_LOD->GetTexture(uTextureID_5076A0)); | |
101 pRenderer->DrawTextureTransparent(uX + uWidth - 10, uY + 32, pIcons_LOD->GetTexture(uTextureID_50769C)); | |
102 } | |
103 pRenderer->ResetTextureClipRect(); | |
104 } | |
105 } | |
1298 | 106 |
107 //----- (0041D895) -------------------------------------------------------- | |
108 void GameUI_DrawItemInfo( struct ItemGen* inspect_item ) | |
1699 | 109 { |
1298 | 110 unsigned int v2; // eax@3 |
111 const char *v28; // edi@69 | |
112 int v34; // esi@81 | |
1699 | 113 char *pText; // [sp-14h] [bp-28Ch]@110 |
1298 | 114 char out_text[300]; // [sp+8h] [bp-270h]@40 |
115 char v65[120]; // [sp+134h] [bp-144h]@92 | |
116 stru351_summoned_item v67; | |
117 int v77; // [sp+200h] [bp-78h]@12 | |
118 int v78; // [sp+204h] [bp-74h]@5 | |
1699 | 119 GUIWindow iteminfo_window; // [sp+208h] [bp-70h]@2 |
1298 | 120 POINT a2; // [sp+25Ch] [bp-1Ch]@2 |
121 int v81; // [sp+264h] [bp-14h]@5 | |
122 PlayerSpeech v83; // [sp+26Ch] [bp-Ch]@18 | |
123 char* v84; | |
124 int v85; | |
125 char *Str; // [sp+270h] [bp-8h]@65 | |
126 | |
1699 | 127 if (!inspect_item->uItemID) |
128 return; | |
129 iteminfo_window.Hint = 0; | |
130 iteminfo_window.uFrameWidth = 384; | |
131 iteminfo_window.uFrameHeight = 180; | |
132 iteminfo_window.uFrameY = 40; | |
133 if ( pMouse->GetCursorPos(&a2)->x <= 320 ) | |
134 v2 = pMouse->GetCursorPos(&a2)->x + 30; | |
135 else | |
136 v2 = pMouse->GetCursorPos(&a2)->x - iteminfo_window.uFrameWidth - 30; | |
137 iteminfo_window.uFrameX = v2; | |
138 v78 = 100 - pIcons_LOD->LoadTexturePtr(pItemsTable->pItems[inspect_item->uItemID].pIconName, TEXTURE_16BIT_PALETTE)->uTextureWidth; | |
139 v81 = 144 - pIcons_LOD->LoadTexturePtr(pItemsTable->pItems[inspect_item->uItemID].pIconName, TEXTURE_16BIT_PALETTE)->uTextureHeight; | |
140 if ( v78 > 0 ) | |
141 v78 = v78 / 2; | |
142 if ( v81 <= 0 ) | |
143 v81 = 0; | |
144 else | |
145 v81 = v81 / 2; | |
146 if ( !pItemsTable->pItems[inspect_item->uItemID].uItemID_Rep_St ) | |
147 inspect_item->SetIdentified(); | |
148 v77 = 0; | |
149 if (pItemsTable->pItems[inspect_item->uItemID].uEquipType == EQUIP_GOLD) | |
150 v77 = inspect_item->uSpecEnchantmentType; | |
151 if ( uActiveCharacter ) | |
152 { | |
153 //try to identify | |
154 if (!inspect_item->IsIdentified()) | |
155 { | |
156 //v11 = inspect_item; | |
157 if ( pPlayers[uActiveCharacter]->CanIdentify(inspect_item) == 1 ) | |
1298 | 158 inspect_item->SetIdentified(); |
1699 | 159 v83 = SPEECH_9; |
160 if ( !inspect_item->IsIdentified() ) | |
161 ShowStatusBarString(pGlobalTXT_LocalizationStrings[446], 2);//"Identify Failed" | |
162 else | |
163 { | |
164 v83 = SPEECH_8; | |
165 if ( inspect_item->GetValue() < 100 * (pPlayers[uActiveCharacter]->uLevel + 5) ) | |
166 v83 = SPEECH_7; | |
167 } | |
168 if ( dword_4E455C ) | |
169 { | |
170 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)(int)v83, 0); | |
171 dword_4E455C = 0; | |
172 } | |
173 } | |
174 inspect_item->UpdateTempBonus(pParty->uTimePlayed); | |
1567
9f8b3e904e14
Player::ReceiveDamage, very small edits; prepended "Is" to item functions returning bool values (broken, indetified, stolen)
Grumpy7
parents:
1545
diff
changeset
|
175 if (inspect_item->IsBroken()) |
1699 | 176 { |
177 if ( pPlayers[uActiveCharacter]->CanRepair(inspect_item) == 1 ) | |
178 inspect_item->uAttributes = inspect_item->uAttributes & 0xFFFFFFFD | 1; | |
179 v83 = SPEECH_11; | |
180 if ( !inspect_item->IsBroken() ) | |
181 v83 = SPEECH_10; | |
182 else | |
183 ShowStatusBarString(pGlobalTXT_LocalizationStrings[448], 2);//"Repair Failed" | |
184 if ( dword_4E455C ) | |
185 { | |
186 pPlayers[uActiveCharacter]->PlaySound(v83, 0); | |
187 dword_4E455C = 0; | |
188 } | |
189 } | |
190 } | |
191 if (inspect_item->IsBroken()) | |
192 { | |
193 iteminfo_window.DrawMessageBox(0); | |
194 pRenderer->SetTextureClipRect(iteminfo_window.uFrameX + 12, iteminfo_window.uFrameY + 12, | |
195 iteminfo_window.uFrameX + iteminfo_window.uFrameWidth - 12, | |
196 iteminfo_window.uFrameY + iteminfo_window.uFrameHeight - 12); | |
197 iteminfo_window.uFrameWidth -= 24; | |
198 iteminfo_window.uFrameHeight -= 12; | |
199 iteminfo_window.uFrameZ = iteminfo_window.uFrameX + iteminfo_window.uFrameWidth - 1; | |
200 iteminfo_window.uFrameW = iteminfo_window.uFrameY + iteminfo_window.uFrameHeight - 1; | |
201 pRenderer->DrawTransparentRedShade(iteminfo_window.uFrameX + v78, v81 + iteminfo_window.uFrameY + 30, pIcons_LOD->LoadTexturePtr(pItemsTable->pItems[inspect_item->uItemID].pIconName, TEXTURE_16BIT_PALETTE)); | |
202 if ( inspect_item->IsIdentified()) | |
203 pText = (char *)inspect_item->GetIdentifiedName(); | |
204 else | |
205 pText = pItemsTable->pItems[inspect_item->uItemID].pUnidentifiedName; | |
206 iteminfo_window.DrawTitleText(pFontArrus, 0, 0xCu, TargetColor(0xFFu, 0xFFu, 0x9Bu), pText, 3); | |
207 iteminfo_window.DrawTitleText(pFontArrus, 0x64u, ((signed int)iteminfo_window.uFrameHeight >> 1) - pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[32], &iteminfo_window, 0, 0) / 2, | |
208 TargetColor(0xFFu, 0x19u, 0x19u), pGlobalTXT_LocalizationStrings[32], 3); //"Broken Item" | |
209 pRenderer->ResetTextureClipRect(); | |
210 if ( !areWeLoadingTexture ) | |
211 { | |
212 pIcons_LOD->LoadTexturePtr(pItemsTable->pItems[inspect_item->uItemID].pIconName, TEXTURE_16BIT_PALETTE)->Release(); | |
213 pIcons_LOD->SyncLoadedFilesCount(); | |
214 } | |
215 return; | |
216 } | |
217 if (!inspect_item->IsIdentified()) | |
218 { | |
219 iteminfo_window.DrawMessageBox(0); | |
220 pRenderer->SetTextureClipRect(iteminfo_window.uFrameX + 12, iteminfo_window.uFrameY + 12, | |
221 iteminfo_window.uFrameX + iteminfo_window.uFrameWidth - 12, iteminfo_window.uFrameY + iteminfo_window.uFrameHeight - 12); | |
222 iteminfo_window.uFrameWidth -= 24; | |
223 iteminfo_window.uFrameHeight -= 12; | |
224 iteminfo_window.uFrameZ = iteminfo_window.uFrameX + iteminfo_window.uFrameWidth - 1; | |
225 iteminfo_window.uFrameW = iteminfo_window.uFrameY + iteminfo_window.uFrameHeight - 1; | |
226 pRenderer->DrawTextureTransparent(iteminfo_window.uFrameX + v78, v81 + iteminfo_window.uFrameY + 30, pIcons_LOD->LoadTexturePtr(pItemsTable->pItems[inspect_item->uItemID].pIconName, TEXTURE_16BIT_PALETTE)); | |
227 iteminfo_window.DrawTitleText(pFontArrus, 0, 0xCu, TargetColor(0xFFu, 0xFFu, 0x9Bu), pItemsTable->pItems[inspect_item->uItemID].pUnidentifiedName, 3); | |
228 iteminfo_window.DrawTitleText(pFontArrus, 0x64u, ((signed int)iteminfo_window.uFrameHeight >> 1) - pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[232], &iteminfo_window, 0, 0) / 2, | |
229 TargetColor(0xFFu, 0x19u, 0x19u), pGlobalTXT_LocalizationStrings[232], 3);//"Not Identified" | |
230 pRenderer->ResetTextureClipRect(); | |
231 if ( !areWeLoadingTexture ) | |
232 { | |
233 pIcons_LOD->LoadTexturePtr(pItemsTable->pItems[inspect_item->uItemID].pIconName, TEXTURE_16BIT_PALETTE)->Release(); | |
234 pIcons_LOD->SyncLoadedFilesCount(); | |
235 } | |
236 return; | |
237 } | |
238 sprintfex(out_text, pGlobalTXT_LocalizationStrings[463], pItemsTable->pItems[inspect_item->uItemID].pUnidentifiedName); //"Type: %s" | |
239 out_text[100] = 0; | |
240 out_text[200] = 0; | |
241 switch (pItemsTable->pItems[inspect_item->uItemID].uEquipType) | |
242 { | |
1298 | 243 case EQUIP_OFF_HAND: |
244 case EQUIP_MAIN_HAND: | |
1699 | 245 sprintfex(out_text + 100, "%s: +%d %s: %dd%d", pGlobalTXT_LocalizationStrings[LOCSTR_ATTACK], |
246 (int)pItemsTable->pItems[inspect_item->uItemID].uDamageMod, pGlobalTXT_LocalizationStrings[53], | |
247 (int)pItemsTable->pItems[inspect_item->uItemID].uDamageDice, (int)pItemsTable->pItems[inspect_item->uItemID].uDamageRoll); //"Damage" | |
248 if (pItemsTable->pItems[inspect_item->uItemID].uDamageMod) | |
249 { | |
250 char mod[16]; | |
251 sprintf(mod, "+%d", (int)pItemsTable->pItems[inspect_item->uItemID].uDamageMod); | |
252 strcat(out_text + 100, mod); | |
253 } | |
254 break; | |
1298 | 255 |
256 case EQUIP_BOW: | |
1699 | 257 sprintfex(out_text + 100, "%s: +%d %s: %dd%d", pGlobalTXT_LocalizationStrings[203], //"Shoot" |
258 (int)pItemsTable->pItems[inspect_item->uItemID].uDamageMod, pGlobalTXT_LocalizationStrings[53], //"Damage" | |
259 (int)pItemsTable->pItems[inspect_item->uItemID].uDamageDice, (int)pItemsTable->pItems[inspect_item->uItemID].uDamageRoll); | |
260 if (pItemsTable->pItems[inspect_item->uItemID].uDamageMod) | |
261 { | |
262 char mod[16]; | |
263 sprintf(mod, "+%d", (int)pItemsTable->pItems[inspect_item->uItemID].uDamageMod); | |
264 strcat(out_text + 100, mod); | |
265 } | |
266 break; | |
1298 | 267 |
268 case EQUIP_ARMOUR: | |
269 case EQUIP_SHIELD: | |
270 case EQUIP_HELMET: | |
271 case EQUIP_BELT: | |
272 case EQUIP_CLOAK: | |
273 case EQUIP_GAUNTLETS: | |
274 case EQUIP_BOOTS: | |
275 case EQUIP_RING: | |
276 case EQUIP_AMULET: | |
1699 | 277 if (pItemsTable->pItems[inspect_item->uItemID].uDamageDice) //"Armor" |
278 sprintfex(out_text + 100, "%s: +%d", pGlobalTXT_LocalizationStrings[11], | |
279 pItemsTable->pItems[inspect_item->uItemID].uDamageDice + pItemsTable->pItems[inspect_item->uItemID].uDamageMod); | |
280 break; | |
281 } | |
1298 | 282 |
1699 | 283 if ( !v77 ) |
284 { | |
285 if (pItemsTable->pItems[inspect_item->uItemID].uEquipType ==EQUIP_POTION) //this is CORRECT! do not move to switch! | |
286 { | |
287 if ( inspect_item->uEnchantmentType ) | |
288 sprintf(out_text + 200, "%s: %d",pGlobalTXT_LocalizationStrings[449] , inspect_item->uEnchantmentType); //"Power" | |
289 } | |
290 else if (pItemsTable->pItems[inspect_item->uItemID].uEquipType == EQUIP_REAGENT) | |
291 sprintf(out_text + 200, "%s: %d", pGlobalTXT_LocalizationStrings[449], pItemsTable->pItems[inspect_item->uItemID].uDamageDice); //"Power" | |
292 else if ( inspect_item->uEnchantmentType ) | |
293 sprintf(out_text + 200, "%s: %s +%d", pGlobalTXT_LocalizationStrings[210], pItemsTable->pEnchantments[inspect_item->uEnchantmentType-1].pBonusStat, inspect_item->m_enchantmentStrength); //"Special" | |
294 else if ( inspect_item->uSpecEnchantmentType ) | |
295 sprintf(out_text + 200, "%s: %s", pGlobalTXT_LocalizationStrings[210], pItemsTable->pSpecialEnchantments[inspect_item->uSpecEnchantmentType-1].pBonusStatement, inspect_item->m_enchantmentStrength); | |
296 else if ( inspect_item->uNumCharges ) | |
297 sprintf(out_text + 200, "%s: %lu", pGlobalTXT_LocalizationStrings[464], inspect_item->uNumCharges); //"Charges" | |
298 } | |
299 iteminfo_window.uFrameWidth -= 12; | |
300 iteminfo_window.uFrameZ = iteminfo_window.uFrameX + iteminfo_window.uFrameWidth - 1; | |
301 iteminfo_window.uFrameW = iteminfo_window.uFrameY + iteminfo_window.uFrameHeight - 1; | |
302 Str = (char *)(3 * (LOBYTE(pFontArrus->uFontHeight) + 8)); | |
303 v84 = &out_text[0]; | |
304 for ( uint i = 1; i <= 3; i++ ) | |
305 { | |
306 if ( *v84 ) | |
307 Str += pFontComic->CalcTextHeight(v84, &iteminfo_window, 100, 0) + 3; | |
308 v84 += 100; | |
309 } | |
310 v28 = pItemsTable->pItems[inspect_item->uItemID].pDescription; | |
311 if ( *v28 ) | |
312 Str += pFontSmallnum->CalcTextHeight(pItemsTable->pItems[inspect_item->uItemID].pDescription, &iteminfo_window, 100, 0); | |
313 iteminfo_window.uFrameHeight = pIcons_LOD->LoadTexturePtr(pItemsTable->pItems[inspect_item->uItemID].pIconName, | |
314 TEXTURE_16BIT_PALETTE)->uTextureHeight + v81 + 54; | |
315 if ( (signed int)Str > (signed int)iteminfo_window.uFrameHeight ) | |
316 iteminfo_window.uFrameHeight = (unsigned int)Str; | |
317 if ( inspect_item->uAttributes & 8 && (inspect_item->uSpecEnchantmentType || inspect_item->uEnchantmentType) ) | |
318 iteminfo_window.uFrameHeight += LOBYTE(pFontComic->uFontHeight); | |
319 v85 = 0; | |
320 if ( pFontArrus->uFontHeight ) | |
321 { | |
322 iteminfo_window.uFrameWidth -= 24; | |
323 if ( pFontArrus->CalcTextHeight(inspect_item->GetIdentifiedName(), &iteminfo_window, 0, 0) / (signed int)pFontArrus->uFontHeight ) | |
324 v85 = pFontArrus->uFontHeight; | |
325 iteminfo_window.uFrameWidth += 24; | |
326 } | |
327 iteminfo_window.uFrameWidth += 12; | |
328 iteminfo_window.uFrameHeight += (unsigned int)v85; | |
329 iteminfo_window.uFrameW = iteminfo_window.uFrameY + iteminfo_window.uFrameHeight - 1; | |
330 iteminfo_window.uFrameZ = iteminfo_window.uFrameX + iteminfo_window.uFrameWidth - 1; | |
331 iteminfo_window.DrawMessageBox(0); | |
332 pRenderer->SetTextureClipRect(iteminfo_window.uFrameX + 12, iteminfo_window.uFrameY + 12, | |
333 iteminfo_window.uFrameX + iteminfo_window.uFrameWidth - 12, iteminfo_window.uFrameY + iteminfo_window.uFrameHeight - 12); | |
334 iteminfo_window.uFrameWidth -= 12; | |
335 //v32 = pIcons_LOD->LoadTexturePtr(pItemsTable->pItems[inspect_item->uItemID].pIconName, TEXTURE_16BIT_PALETTE)->uTextureHeight; | |
336 iteminfo_window.uFrameHeight -= 12; | |
337 iteminfo_window.uFrameZ = iteminfo_window.uFrameX + iteminfo_window.uFrameWidth - 1; | |
338 iteminfo_window.uFrameW = iteminfo_window.uFrameY + iteminfo_window.uFrameHeight - 1; | |
339 pRenderer->DrawTextureTransparent(iteminfo_window.uFrameX + v78, | |
340 iteminfo_window.uFrameY + (signed int)(iteminfo_window.uFrameHeight - pIcons_LOD->LoadTexturePtr(pItemsTable->pItems[inspect_item->uItemID].pIconName, TEXTURE_16BIT_PALETTE)->uTextureHeight) / 2, | |
341 pIcons_LOD->LoadTexturePtr(pItemsTable->pItems[inspect_item->uItemID].pIconName, TEXTURE_16BIT_PALETTE)); | |
1298 | 342 |
1699 | 343 v34 = (int)(v85 + 35); |
344 Str = out_text; | |
345 for ( uint i = 1; i <= 3; i++ ) | |
346 { | |
347 if ( *Str ) | |
348 { | |
349 iteminfo_window.DrawText(pFontComic, 100, v34, 0, Str, 0, 0, 0); | |
350 v34 += pFontComic->CalcTextHeight(Str, &iteminfo_window, 100, 0) + 3; | |
1298 | 351 } |
1699 | 352 Str += 100; |
353 } | |
354 v28 = pItemsTable->pItems[inspect_item->uItemID].pDescription; | |
355 if ( *v28 ) | |
356 iteminfo_window.DrawText(pFontSmallnum, 100, v34, 0, v28, 0, 0, 0); | |
357 iteminfo_window.uFrameX += 12; | |
358 iteminfo_window.uFrameWidth -= 24; | |
359 iteminfo_window.DrawTitleText(pFontArrus, 0, 0xCu, TargetColor(0xFFu, 0xFFu, 0x9Bu), inspect_item->GetIdentifiedName(), 3); | |
360 iteminfo_window.uFrameWidth += 24; | |
361 iteminfo_window.uFrameX -= 12; | |
362 if ( v77 ) | |
363 { | |
364 sprintf(pTmpBuf.data(), "%s: %lu", pGlobalTXT_LocalizationStrings[465], v77);//"Value" | |
365 iteminfo_window.DrawText(pFontComic, 100, iteminfo_window.uFrameHeight - LOBYTE(pFontComic->uFontHeight), 0, pTmpBuf.data(), 0, 0, 0); | |
366 pRenderer->ResetTextureClipRect(); | |
367 } | |
368 else | |
369 { | |
370 if ( (inspect_item->uAttributes & 8) && (inspect_item->uSpecEnchantmentType || inspect_item->uEnchantmentType) ) | |
371 { | |
372 init_summoned_item(&v67, inspect_item->uExpireTime - pParty->uTimePlayed); | |
373 strcpy(pTmpBuf.data(), "Duration:"); | |
374 Str = (char *)(v67.field_18_expire_year - game_starting_year); | |
375 if (v67.field_18_expire_year != 1168 ) | |
376 { | |
377 sprintf(v65, " %d:yr", v67.field_18_expire_year - game_starting_year); | |
378 strcat(pTmpBuf.data(), v65); | |
379 } | |
380 if ( (((v67.field_14_exprie_month || Str) && | |
381 ((sprintf(v65, " %d:mo", v67.field_14_exprie_month), strcat(pTmpBuf.data(), v65), v67.field_14_exprie_month) || Str) | |
382 || v67.field_C_expire_day) | |
383 && ((sprintf(v65, " %d:dy", v67.field_C_expire_day), strcat(pTmpBuf.data(), v65), v67.field_14_exprie_month) || Str || | |
384 v67.field_C_expire_day) | |
385 || v67.field_8_expire_hour) | |
386 && ((sprintf(v65, " %d:hr", v67.field_8_expire_hour), strcat(pTmpBuf.data(), v65), v67.field_14_exprie_month) || Str || | |
387 v67.field_C_expire_day || v67.field_8_expire_hour) | |
388 || v67.field_4_expire_minute ) | |
389 { | |
390 sprintf(v65, " %d:mn", v67.field_4_expire_minute); | |
391 strcat(pTmpBuf.data(), v65); | |
392 } | |
393 iteminfo_window.DrawText(pFontComic, 100, iteminfo_window.uFrameHeight - 2 * LOBYTE(pFontComic->uFontHeight), 0, pTmpBuf.data(), 0, 0, 0); | |
394 } | |
395 sprintf(pTmpBuf.data(), "%s: %lu", pGlobalTXT_LocalizationStrings[465], inspect_item->GetValue()); | |
396 iteminfo_window.DrawText(pFontComic, 100, iteminfo_window.uFrameHeight - LOBYTE(pFontComic->uFontHeight), 0, pTmpBuf.data(), 0, 0, 0); | |
397 if ( BYTE1(inspect_item->uAttributes) & 1 ) | |
398 pText = pGlobalTXT_LocalizationStrings[187]; //"Stolen" | |
399 else | |
400 { | |
401 if ( !(BYTE1(inspect_item->uAttributes) & 2) ) | |
402 { | |
403 pRenderer->ResetTextureClipRect(); | |
404 if ( !areWeLoadingTexture ) | |
405 { | |
406 pIcons_LOD->LoadTexturePtr(pItemsTable->pItems[inspect_item->uItemID].pIconName, TEXTURE_16BIT_PALETTE)->Release(); | |
407 pIcons_LOD->SyncLoadedFilesCount(); | |
408 } | |
409 return; | |
410 } | |
411 pText = pGlobalTXT_LocalizationStrings[651]; //"Hardened" | |
412 } | |
413 LOWORD(inspect_item->uAttributes) = LOWORD(pRenderer->uTargetRMask); | |
414 iteminfo_window.DrawText(pFontComic, pFontComic->GetLineWidth(pTmpBuf.data()) + 132, | |
415 iteminfo_window.uFrameHeight - LOBYTE(pFontComic->uFontHeight), inspect_item->uAttributes, pText, 0, 0, 0); | |
416 pRenderer->ResetTextureClipRect(); | |
417 } | |
418 if ( !areWeLoadingTexture ) | |
419 { | |
420 pIcons_LOD->LoadTexturePtr(pItemsTable->pItems[inspect_item->uItemID].pIconName, TEXTURE_16BIT_PALETTE)->Release(); | |
421 pIcons_LOD->SyncLoadedFilesCount(); | |
422 } | |
423 return; | |
424 } | |
1298 | 425 // 4E455C: using guessed type int dword_4E455C; |
426 // 506128: using guessed type int areWeLoadingTexture; | |
427 | |
428 //----- (0041E360) -------------------------------------------------------- | |
1699 | 429 void MonsterPopup_Draw(unsigned int uActorID, GUIWindow *window) |
1298 | 430 { |
431 int v8; // eax@4 | |
432 unsigned __int16 v9; // dx@4 | |
433 SpriteFrame *v10; // edi@17 | |
434 unsigned int v18; // ecx@19 | |
435 unsigned int v19; // eax@21 | |
436 char *v20; // esi@28 | |
437 int v21; // edx@29 | |
438 unsigned __int16 *v22; // ecx@29 | |
439 int v23; // eax@29 | |
440 int v25; // esi@32 | |
441 char *v26; // edx@34 | |
442 unsigned __int8 v27; // sf@36 | |
443 unsigned __int8 v28; // of@36 | |
444 SpellBuff *v40; // eax@60 | |
445 int v41; // edi@61 | |
446 unsigned int v42; // eax@61 | |
447 int v43; // eax@62 | |
448 int v44; // eax@63 | |
449 signed int v45; // edi@65 | |
450 int v50; // edi@90 | |
451 SpellBuff *v51; // eax@91 | |
452 char *v52; // ecx@98 | |
453 char *v53; // ecx@101 | |
454 char *v54; // ST0C_4@118 | |
455 unsigned int v55; // eax@118 | |
456 GUIFont *v56; // edi@124 | |
457 unsigned __int8 v57; // al@128 | |
458 int v58; // eax@132 | |
459 Actor *v59; // ecx@133 | |
460 unsigned __int8 v60; // dl@138 | |
461 char *v62; // eax@147 | |
462 int v63; // eax@152 | |
463 int v65; // eax@155 | |
464 const char *v67; // [sp-10h] [bp-1FCh]@125 | |
465 const char *v68; // [sp-10h] [bp-1FCh]@142 | |
466 char *v70; // [sp-Ch] [bp-1F8h]@125 | |
467 char *v71; // [sp-Ch] [bp-1F8h]@142 | |
468 char *v72; // [sp-8h] [bp-1F4h]@54 | |
469 int v73; // [sp-8h] [bp-1F4h]@79 | |
470 int v75; // [sp-8h] [bp-1F4h]@125 | |
471 int v76; // [sp-8h] [bp-1F4h]@142 | |
472 size_t v77; // [sp-4h] [bp-1F0h]@54 | |
473 unsigned int v79; // [sp-4h] [bp-1F0h]@125 | |
474 char *v80; // [sp-4h] [bp-1F0h]@142 | |
475 char *v81; // [sp-4h] [bp-1F0h]@148 | |
476 DDBLTFX Dst; // [sp+Ch] [bp-1E0h]@18 | |
477 DDSURFACEDESC2 pDesc; // [sp+70h] [bp-17Ch]@18 | |
478 RECT v84; // [sp+ECh] [bp-100h]@26 | |
479 char *v85[10]; // [sp+FCh] [bp-F0h]@145 | |
480 char *v95[11]; // [sp+124h] [bp-C8h]@127 | |
481 RenderBillboardTransform_local0 v106; // [sp+150h] [bp-9Ch]@3 | |
482 unsigned int v107; // [sp+1A0h] [bp-4Ch]@18 | |
483 unsigned __int16 *v108; // [sp+1A4h] [bp-48h]@34 | |
484 unsigned int v109; // [sp+1A8h] [bp-44h]@32 | |
485 LPVOID v110; // [sp+1ACh] [bp-40h]@28 | |
486 int v112; // [sp+1B4h] [bp-38h]@3 | |
487 int v222; // [sp+1B8h] [bp-34h]@18 | |
488 unsigned __int8 v114; // [sp+1BFh] [bp-2Dh]@133 | |
489 int v115; // [sp+1C0h] [bp-2Ch]@3 | |
490 unsigned int v116; // [sp+1C4h] [bp-28h]@18 | |
491 int i; // [sp+1C8h] [bp-24h]@18 | |
492 int v119; // [sp+1D0h] [bp-1Ch]@18 | |
493 SpellBuff *v120; // [sp+1D4h] [bp-18h]@18 | |
494 int v124; // [sp+1E4h] [bp-8h]@18 | |
495 int a4; // [sp+1E8h] [bp-4h]@18 | |
496 | |
497 static Actor pMonsterInfoUI_Doll; | |
498 /*if ( !(bMonsterInfoUI_bDollInitialized & 1) ) | |
499 { | |
500 bMonsterInfoUI_bDollInitialized |= 1u; | |
501 Actor::Actor(&pMonsterInfoUI_Doll); | |
502 atexit(nullsub_3); | |
503 }*/ | |
504 v106.uParentBillboardID = -1; | |
1699 | 505 v115 = monster_popup_y_offsets[((signed __int16)pActors[uActorID].pMonsterInfo.uID - 1) / 3] - 40; |
506 if ( pActors[uActorID].pMonsterInfo.uID == pMonsterInfoUI_Doll.pMonsterInfo.uID ) | |
1298 | 507 v9 = pMonsterInfoUI_Doll.uCurrentActionLength; |
508 else | |
509 { | |
1699 | 510 memcpy(&pMonsterInfoUI_Doll, &pActors[uActorID], sizeof(pMonsterInfoUI_Doll)); |
1298 | 511 pMonsterInfoUI_Doll.uCurrentActionAnimation = ANIM_Bored; |
512 pMonsterInfoUI_Doll.uCurrentActionTime = 0; | |
513 v8 = rand(); | |
514 v9 = v8 % 256 + 128; | |
515 pMonsterInfoUI_Doll.uCurrentActionLength = v8 % 256 + 128; | |
516 } | |
517 | |
518 if ( (signed int)pMonsterInfoUI_Doll.uCurrentActionTime > (signed __int16)v9 ) | |
519 { | |
520 pMonsterInfoUI_Doll.uCurrentActionTime = 0; | |
521 if ( pMonsterInfoUI_Doll.uCurrentActionAnimation == ANIM_Bored || pMonsterInfoUI_Doll.uCurrentActionAnimation == ANIM_AtkMelee) | |
522 { | |
523 pMonsterInfoUI_Doll.uCurrentActionAnimation = ANIM_Standing; | |
524 pMonsterInfoUI_Doll.uCurrentActionLength = rand() % 128 + 128; | |
525 } | |
526 else | |
527 { | |
528 //rand(); | |
529 pMonsterInfoUI_Doll.uCurrentActionAnimation = ANIM_Bored; | |
530 if ( (pMonsterInfoUI_Doll.pMonsterInfo.uID < 115 || pMonsterInfoUI_Doll.pMonsterInfo.uID > 186) && | |
531 (pMonsterInfoUI_Doll.pMonsterInfo.uID < 232 || pMonsterInfoUI_Doll.pMonsterInfo.uID > 249) && rand() % 30 < 100 ) | |
532 pMonsterInfoUI_Doll.uCurrentActionAnimation = ANIM_AtkMelee; | |
1699 | 533 pMonsterInfoUI_Doll.uCurrentActionLength = 8 * pSpriteFrameTable->pSpriteSFrames[pActors[uActorID].pSpriteIDs[(signed __int16)pMonsterInfoUI_Doll.uCurrentActionAnimation]].uAnimLength; |
1298 | 534 } |
535 } | |
1699 | 536 v10 = pSpriteFrameTable->GetFrame( pActors[uActorID].pSpriteIDs[pMonsterInfoUI_Doll.uCurrentActionAnimation], pMonsterInfoUI_Doll.uCurrentActionTime); |
1298 | 537 v106.pTarget = pRenderer->pTargetSurface; |
538 v106.pTargetZ = pRenderer->pActiveZBuffer; | |
539 v106.uTargetPitch = pRenderer->uTargetSurfacePitch; | |
1699 | 540 v106.uViewportX = window->uFrameX + 13; |
541 v106.uViewportY = window->uFrameY + 52; | |
542 v106.uViewportW = (window->uFrameY + 52) + 128; | |
1298 | 543 v106.uViewportZ = v106.uViewportX + 128; |
544 v106.uScreenSpaceX = (signed int)(v106.uViewportX + 128 + v106.uViewportX) / 2; | |
545 v106._screenspace_x_scaler_packedfloat = 65536; | |
546 v106._screenspace_y_scaler_packedfloat = 65536; | |
1699 | 547 v106.uScreenSpaceY = v115 + (window->uFrameY + 52) + pSprites_LOD->pSpriteHeaders[v10->pHwSpriteIDs[0]].uHeight; |
1298 | 548 v106.pPalette = PaletteManager::Get_Dark_or_Red_LUT(v10->uPaletteIndex, 0, 1); |
549 v106.sZValue = 0; | |
550 v106.uFlags = 0; | |
551 pRenderer->SetRasterClipRect(0, 0, 0x27Fu, 0x1DFu); | |
1699 | 552 pRenderer->RasterLine2D(v106.uViewportX - 1, v106.uViewportY - 1, v106.uViewportX + 129, v106.uViewportY - 1, TargetColor(0xE1u, 255, 0x9Bu)); |
553 pRenderer->RasterLine2D( v106.uViewportX + 129, v106.uViewportY - 1, v106.uViewportX + 129, v106.uViewportW + 1, TargetColor(0xE1u, 255, 0x9Bu)); | |
554 pRenderer->RasterLine2D(v106.uViewportX + 129, v106.uViewportW + 1, v106.uViewportX - 1, v106.uViewportW + 1, TargetColor(0xE1u, 255, 0x9Bu)); | |
555 pRenderer->RasterLine2D(v106.uViewportX - 1, v106.uViewportW + 1, v106.uViewportX - 1, v106.uViewportY - 1, TargetColor(0xE1u, 255, 0x9Bu)); | |
1298 | 556 if ( pRenderer->pRenderD3D ) |
557 { | |
1699 | 558 v106.uScreenSpaceY = v115 + v106.uViewportY + pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uBufferHeight; |
1298 | 559 memset(&Dst, 0, 0x64u); |
560 Dst.dwSize = 100; | |
561 Dst.dwFillColor = 0; | |
562 memset(&pDesc, 0, 0x7Cu); | |
563 pDesc.dwSize = 124; | |
1699 | 564 pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].pTextureSurface->GetSurfaceDesc(&pDesc); |
1298 | 565 v107 = 0; |
566 i = 0; | |
1699 | 567 int dst_x = v106.uScreenSpaceX + pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uAreaX - pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uBufferWidth / 2; |
568 int dst_y = v106.uScreenSpaceY + pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uAreaY - pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uBufferHeight; | |
569 uint dst_z = v106.uScreenSpaceX + pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uAreaX + pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uAreaWidth + pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uBufferWidth / 2 - pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uBufferWidth; | |
570 uint dst_w = v106.uScreenSpaceY + pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uAreaY + pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uAreaHeight - pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uBufferHeight; | |
1298 | 571 if (dst_x < v106.uViewportX) |
572 { | |
573 v18 = v106.uViewportX - dst_x; | |
574 dst_x = v106.uViewportX; | |
575 v107 = v18; | |
576 } | |
577 if (dst_y < v106.uViewportY) | |
578 { | |
579 v19 = v106.uViewportY - dst_y; | |
580 dst_y = v106.uViewportY; | |
581 i = v19; | |
582 } | |
583 if (dst_z > v106.uViewportZ) | |
584 dst_z = v106.uViewportZ; | |
585 if (dst_w > v106.uViewportW) | |
586 dst_w = v106.uViewportW; | |
587 pRenderer->FillRectFast(v106.uViewportX, v106.uViewportY, v106.uViewportZ - v106.uViewportX, v106.uViewportW - v106.uViewportY, pRenderer->uTargetBMask | pRenderer->uTargetGMask); | |
588 pRenderer->FillRectFast(v106.uViewportX, v106.uViewportY, v106.uViewportZ - v106.uViewportX, v106.uViewportW - v106.uViewportY, pRenderer->uTargetBMask | pRenderer->uTargetGMask); | |
589 v84.left = v106.uViewportX; | |
590 v84.top = v106.uViewportY; | |
591 v84.right = v106.uViewportZ; | |
592 v84.bottom = v106.uViewportW; | |
593 ErrD3D(pRenderer->pBackBuffer4->Blt(&v84, 0, 0, 16778240u, &Dst)); | |
594 if ( pRenderer->uTargetGBits == 5 ) | |
595 { | |
596 __debugbreak(); // no monster popup for r5g5b5 yet | |
597 memset(&pDesc, 0, 0x7Cu); | |
598 pDesc.dwSize = 124; | |
1699 | 599 if ( pRenderer->LockSurface_DDraw4(pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].pTextureSurface, &pDesc, DDLOCK_WAIT)) |
600 { | |
601 v20 = (char *)dst_y; | |
602 v110 = pDesc.lpSurface; | |
603 //a2 = dst_y; | |
604 if (dst_y < dst_w) | |
605 { | |
606 v21 = dst_x; | |
607 v22 = &pRenderer->pTargetSurface[dst_y * pRenderer->uTargetSurfacePitch + dst_x]; | |
608 auto _v22_2 = v22; | |
609 v23 = i - dst_y; | |
610 v115 = i - dst_y; | |
611 while ( 1 ) | |
612 { | |
613 dst_y = v21; | |
614 if ( v21 < dst_z ) | |
615 { | |
616 v25 = v107 - v21; | |
617 v109 = (int)&v20[v23]; | |
618 for ( i = v107 - v21; ; v25 = i ) | |
619 { | |
620 v108 = (unsigned __int16 *)((pDesc.lPitch >> 1) * pDesc.dwHeight * v109 / pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uAreaHeight); | |
621 v26 = (char *)v108 + pDesc.dwWidth * (v25 + dst_y++) / pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uAreaWidth; | |
622 *v22 = *((short *)v110 + (int)v26); | |
623 ++v22; | |
624 if ( dst_y >= dst_z ) | |
625 break; | |
626 } | |
627 v23 = v115; | |
628 } | |
629 v22 = (unsigned __int16 *)((char *)_v22_2 + 2 * pRenderer->uTargetSurfacePitch); | |
630 _v22_2 = v22; | |
631 v20 = (char *)(dst_y + 1); | |
632 v28 = __OFSUB__(dst_y + 1, dst_w); | |
633 v27 = (signed int)(dst_y++ + 1 - dst_w) < 0; | |
634 if ( !(v27 ^ v28) ) | |
635 break; | |
636 v21 = dst_x; | |
637 } | |
638 } | |
639 pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].pTextureSurface->Unlock(0); | |
640 } | |
1298 | 641 } |
1699 | 642 else |
643 { | |
644 memset(&pDesc, 0, 0x7Cu); | |
645 pDesc.dwSize = 124; | |
646 if ( pRenderer->LockSurface_DDraw4(pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].pTextureSurface, &pDesc, DDLOCK_WAIT) ) | |
647 { | |
648 auto src = (unsigned __int16 *)pDesc.lpSurface; | |
649 uint num_top_scanlines_above_frame_y = i - dst_y; | |
650 for (uint y = dst_y; y < dst_w; ++y) | |
651 { | |
652 auto dst = &pRenderer->pTargetSurface[y * pRenderer->uTargetSurfacePitch + dst_x]; | |
1298 | 653 |
1699 | 654 uint src_y = num_top_scanlines_above_frame_y + y; |
655 for (uint x = dst_x; x < dst_z; ++x) | |
656 { | |
657 uint src_x = v107 - dst_x + x; // num scanlines left to frame_x + current x | |
1298 | 658 |
1699 | 659 uint idx = pDesc.dwHeight * src_y / pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uAreaHeight * (pDesc.lPitch / sizeof(short)) + |
660 pDesc.dwWidth * src_x / pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uAreaWidth; | |
661 uint b = src[idx] & 0x1F; | |
662 *dst++ = b | 2 * (src[idx] & 0xFFE0); | |
663 } | |
664 } | |
665 pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].pTextureSurface->Unlock(0); | |
666 } | |
667 } | |
1298 | 668 } |
669 else | |
670 { | |
671 pRenderer->FillRectFast(v106.uViewportX, v106.uViewportY, v106.uViewportZ - v106.uViewportX, v106.uViewportW - v106.uViewportY, 0); | |
1699 | 672 if ( v10->pHwSpriteIDs[0] >= 0 ) |
673 pSprites_LOD->pSpriteHeaders[v10->pHwSpriteIDs[0]].DrawSprite_sw(&v106, 0); | |
1298 | 674 } |
675 | |
1699 | 676 if ( pActors[uActorID].sNPC_ID ) |
1298 | 677 { |
1699 | 678 if (GetNPCData(pActors[uActorID].sNPC_ID)->uProfession) |
679 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[429], GetNPCData(pActors[uActorID].sNPC_ID)->pName, aNPCProfessionNames[GetNPCData(pActors[uActorID].sNPC_ID)->uProfession]); // "%s the %s" / ^Pi[%s] %s | |
680 else | |
1298 | 681 { |
1699 | 682 v77 = 2000; |
683 v72 = GetNPCData(pActors[uActorID].sNPC_ID)->pName; | |
1298 | 684 } |
685 } | |
686 else | |
687 { | |
688 v77 = 2000; | |
1699 | 689 if ( pActors[uActorID].dword_000334_unique_name ) |
690 v72 = pMonsterStats->pPlaceStrings[pActors[uActorID].dword_000334_unique_name]; | |
1298 | 691 else |
1699 | 692 v72 = pMonsterStats->pInfos[pActors[uActorID].pMonsterInfo.uID].pName; |
1298 | 693 } |
1699 | 694 if(!pActors[uActorID].sNPC_ID || (pActors[uActorID].sNPC_ID && !GetNPCData(pActors[uActorID].sNPC_ID)->uProfession)) |
1298 | 695 strncpy(pTmpBuf.data(), v72, v77); |
1699 | 696 window->DrawTitleText(pFontComic, 0, 0xCu, TargetColor(0xFFu, 0xFFu, 0x9Bu), pTmpBuf.data(), 3); |
697 Actor::DrawHealthBar(&pActors[uActorID], window); | |
1298 | 698 v119 = 0; |
699 pMonsterInfoUI_Doll.uCurrentActionTime += pMiscTimer->uTimeElapsed; | |
700 v115 = 0; | |
701 v116 = 0; | |
702 i = 0; | |
703 v112 = 0; | |
704 if ( !uActiveCharacter ) | |
705 v45 = 1; | |
706 else | |
707 { | |
1699 | 708 LOBYTE(v40) = pPlayers[uActiveCharacter]->GetActualSkillLevel(PLAYER_SKILL_MONSTER_ID); |
709 v120 = v40; | |
710 if ( !v40 ) | |
711 v45 = 1; | |
712 else | |
713 { | |
714 v41 = (unsigned __int8)v40 & 0x3F; | |
715 v42 = SkillToMastery((unsigned __int16)v40) - 1; | |
716 if ( !v42 ) | |
717 { | |
718 if ( v41 + 10 >= pActors[uActorID].pMonsterInfo.uLevel ) | |
719 { | |
720 v45 = 1; | |
721 v119 = 1; | |
722 } | |
723 else | |
724 v45 = 1; | |
725 } | |
726 else | |
727 { | |
728 v43 = v42 - 1; | |
729 if ( !v43 ) | |
730 { | |
731 if ( 2 * v41 + 10 >= pActors[uActorID].pMonsterInfo.uLevel ) | |
732 { | |
733 v45 = 1; | |
734 v119 = 1; | |
735 v116 = 1; | |
736 } | |
737 else | |
738 v45 = 1; | |
739 } | |
740 else | |
741 { | |
742 v44 = v43 - 1; | |
743 if ( !v44 ) | |
744 { | |
745 if ( 3 * v41 + 10 >= pActors[uActorID].pMonsterInfo.uLevel ) | |
746 { | |
747 v45 = 1; | |
748 v119 = 1; | |
749 v116 = 1; | |
750 i = 1; | |
751 } | |
752 else | |
753 v45 = 1; | |
754 } | |
755 else | |
756 { | |
757 if ( v44 != 1 ) | |
758 v45 = 1; | |
759 else | |
760 { | |
761 v45 = 1; | |
762 v119 = 1; | |
763 v116 = 1; | |
764 i = 1; | |
765 v112 = 1; | |
766 } | |
767 } | |
768 } | |
769 } | |
770 } | |
771 if ( pActors[uActorID].uAIState != Dead | |
772 && pActors[uActorID].uAIState != Dying | |
773 && !dword_507BF0_is_there_popup_onscreen && v120 ) | |
774 { | |
775 if ( v119 | v116 | i | (unsigned int)v112 ) | |
776 { | |
777 if ( pActors[uActorID].pMonsterInfo.uLevel >= pPlayers[uActiveCharacter]->uLevel - 5 ) | |
778 v73 = SPEECH_105; | |
779 else | |
780 v73 = SPEECH_104; | |
781 } | |
782 else | |
783 v73 = SPEECH_106; | |
784 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)v73, 0); | |
785 } | |
1298 | 786 } |
787 | |
1699 | 788 for (uint i = 0; i < 4; ++i) |
1298 | 789 { |
790 v120 = (SpellBuff *)138; | |
791 do | |
792 { | |
1699 | 793 if ( (signed int)SkillToMastery(pParty->pPlayers[i].GetActualSkillLevel(PLAYER_SKILL_MONSTER_ID)) >= 3 ) |
1298 | 794 v115 = v45; |
795 v120 = (SpellBuff *)((char *)v120 - 1); | |
796 } | |
797 while ( v120 ); | |
798 } | |
799 | |
1699 | 800 window->DrawText(pFontSmallnum, 12, 196, TargetColor(0xE1u, 255, 0x9Bu), pGlobalTXT_LocalizationStrings[631], 0, 0, 0); |
1298 | 801 if ( !v115 ) |
1699 | 802 window->DrawText(pFontSmallnum, 28, LOBYTE(pFontSmallnum->uFontHeight) + 193, TargetColor(0xE1u, 255, 0x9Bu), pGlobalTXT_LocalizationStrings[630], 0, 0, 0); |
1298 | 803 else |
804 { | |
805 a4 = 0; | |
1699 | 806 v51 = &pActors[uActorID].pActorBuffs[1]; |
1298 | 807 v222 = 0; |
1699 | 808 v120 = &pActors[uActorID].pActorBuffs[1]; |
1298 | 809 do |
810 { | |
811 if ( (signed __int64)v51->uExpireTime > 0 ) | |
812 { | |
813 switch ( (int)v51 ) | |
814 { | |
815 case 0u: | |
816 v124 = 60; | |
817 a4 = (int)pGlobalTXT_LocalizationStrings[591]; | |
818 break; | |
819 case 1u: | |
820 v124 = 82; | |
821 a4 = (int)pGlobalTXT_LocalizationStrings[649]; | |
822 break; | |
823 case 2u: | |
824 v124 = 92; | |
825 a4 = (int)pGlobalTXT_LocalizationStrings[592]; | |
826 break; | |
827 case 3u: | |
828 v124 = 63; | |
829 a4 = (int)pGlobalTXT_LocalizationStrings[4]; | |
830 break; | |
831 case 4u: | |
832 v52 = pGlobalTXT_LocalizationStrings[220]; | |
833 a4 = (int)v52; | |
834 v124 = 81; | |
835 break; | |
836 case 5u: | |
837 v52 = pGlobalTXT_LocalizationStrings[162]; | |
838 a4 = (int)v52; | |
839 v124 = 81; | |
840 break; | |
841 case 6u: | |
842 v53 = pGlobalTXT_LocalizationStrings[593]; | |
843 v124 = 35; | |
844 a4 = (int)v53; | |
845 break; | |
846 case 8u: | |
847 v53 = pGlobalTXT_LocalizationStrings[608]; | |
848 v124 = 62; | |
849 a4 = (int)v53; | |
850 break; | |
851 case 7u: | |
852 case 9u: | |
853 a4 = 0; | |
854 v124 = 0; | |
855 ++v51; | |
856 v222 = v222 + 1; | |
857 v120 = v51; | |
858 __debugbreak(); // fix condition | |
859 continue; | |
860 case 0xAu: | |
861 v124 = 47; | |
862 a4 = (int)pGlobalTXT_LocalizationStrings[221]; | |
863 break; | |
864 case 0xBu: | |
865 v124 = 66; | |
866 a4 = (int)pGlobalTXT_LocalizationStrings[607]; | |
867 break; | |
868 case 0xCu: | |
869 v124 = 85; | |
870 a4 = (int)pGlobalTXT_LocalizationStrings[610]; | |
871 break; | |
872 case 0xDu: | |
873 v124 = 86; | |
874 a4 = (int)pGlobalTXT_LocalizationStrings[609]; | |
875 break; | |
876 case 0xEu: | |
877 v124 = 17; | |
878 a4 = (int)pGlobalTXT_LocalizationStrings[279]; | |
879 break; | |
880 case 0xFu: | |
881 v124 = 38; | |
882 a4 = (int)pGlobalTXT_LocalizationStrings[442]; | |
883 break; | |
884 case 0x10u: | |
885 v124 = 46; | |
886 a4 = (int)pGlobalTXT_LocalizationStrings[443]; | |
887 break; | |
888 case 0x11u: | |
889 v124 = 51; | |
890 a4 = (int)pGlobalTXT_LocalizationStrings[440]; | |
891 break; | |
892 case 0x12u: | |
893 v124 = 5; | |
894 a4 = (int)pGlobalTXT_LocalizationStrings[441]; | |
895 break; | |
896 case 0x13u: | |
897 v124 = 95; | |
898 a4 = (int)pGlobalTXT_LocalizationStrings[229]; | |
899 break; | |
900 case 0x14u: | |
901 v124 = 73; | |
902 a4 = (int)pGlobalTXT_LocalizationStrings[228]; | |
903 break; | |
904 default: | |
905 a4 = 0; | |
906 break; | |
907 } | |
908 if ( a4 ) | |
909 { | |
910 v54 = (char *)a4; | |
911 v55 = GetSpellColor(v124); | |
1699 | 912 window->DrawText(pFontSmallnum, 28, LOBYTE(pFontSmallnum->uFontHeight) + 193, v55, v54, 0, 0, 0); |
913 v50 = (LOBYTE(pFontSmallnum->uFontHeight) + 193) + *(char *)((int)pFontSmallnum + 5) - 3; | |
1298 | 914 v51 = v120; |
915 } | |
916 } | |
917 | |
918 ++v51; | |
919 v222 = v222 + 1; | |
920 v120 = v51; | |
921 | |
922 __debugbreak(); // fix condition | |
923 } | |
924 //while ( (signed int)((char *)&v222->lpVtbl + 1) < 22 ); | |
925 while (true); | |
926 | |
927 if ( !a4 ) | |
1699 | 928 window->DrawText(pFontSmallnum, 28, v50, TargetColor(0xE1u, 255, 0x9Bu), pGlobalTXT_LocalizationStrings[153], 0, 0, 0); |
1298 | 929 } |
930 v56 = pFontSmallnum; | |
931 a4 = v106.uViewportY; | |
932 if ( v119 ) | |
933 { | |
1699 | 934 sprintf(pTmpBuf.data(), "%s\f%05u\t100%d\n", pGlobalTXT_LocalizationStrings[108], 0, pActors[uActorID].pMonsterInfo.uHP); |
935 window->DrawText(v56, 150, (int)a4, TargetColor(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0); | |
1298 | 936 a4 = a4 + LOBYTE(v56->uFontHeight) - 3; |
1699 | 937 v79 = pActors[uActorID].pMonsterInfo.uAC; |
1298 | 938 v75 = 0; |
939 v70 = pGlobalTXT_LocalizationStrings[12]; | |
940 v67 = "%s\f%05u\t100%d\n"; | |
941 } | |
942 else | |
943 { | |
944 sprintf(pTmpBuf.data(), "%s\f%05u\t100%s\n", pGlobalTXT_LocalizationStrings[108], 0, pGlobalTXT_LocalizationStrings[630]); | |
1699 | 945 window->DrawText(v56, 150, (int)a4, TargetColor(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0); |
1298 | 946 v79 = (unsigned int)pGlobalTXT_LocalizationStrings[630]; |
947 v75 = 0; | |
948 v70 = pGlobalTXT_LocalizationStrings[12]; | |
949 a4 = a4 + LOBYTE(v56->uFontHeight) - 3; | |
950 v67 = "%s\f%05u\t100%s\n"; | |
951 } | |
952 sprintf(pTmpBuf.data(), v67, v70, v75, v79); | |
1699 | 953 window->DrawText(v56, 150, a4, TargetColor(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0); |
1298 | 954 a4 = a4 + LOBYTE(v56->uFontHeight) - 6 + LOBYTE(v56->uFontHeight); |
955 v95[0] = pGlobalTXT_LocalizationStrings[87]; | |
956 v95[1] = pGlobalTXT_LocalizationStrings[6]; | |
957 v95[2] = pGlobalTXT_LocalizationStrings[240]; | |
958 v95[3] = pGlobalTXT_LocalizationStrings[70]; | |
959 v95[4] = pGlobalTXT_LocalizationStrings[624]; | |
960 v95[5] = pGlobalTXT_LocalizationStrings[138]; | |
961 v95[6] = pGlobalTXT_LocalizationStrings[214]; | |
962 v95[7] = pGlobalTXT_LocalizationStrings[142]; | |
963 v95[8] = pGlobalTXT_LocalizationStrings[29]; | |
964 v95[9] = pGlobalTXT_LocalizationStrings[133]; | |
965 v95[10] = pGlobalTXT_LocalizationStrings[54]; | |
966 if ( v116 ) | |
967 { | |
1699 | 968 sprintf(pTmpBuf.data(), "%s\f%05u\t080%s\n", pGlobalTXT_LocalizationStrings[18], 0, v95[pActors[uActorID].pMonsterInfo.uAttack1Type]); |
969 window->DrawText(v56, 150, (int)a4, TargetColor(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0); | |
1298 | 970 a4 = a4 + LOBYTE(v56->uFontHeight) - 3; |
1699 | 971 v57 = pActors[uActorID].pMonsterInfo.uAttack1DamageBonus; |
1298 | 972 if ( v57 ) |
973 sprintf(pTmpBuf.data(), "%s\f%05u\t080%dd%d+%d\n", pGlobalTXT_LocalizationStrings[53], | |
1699 | 974 0, pActors[uActorID].pMonsterInfo.uAttack1DamageDiceRolls, pActors[uActorID].pMonsterInfo.uAttack1DamageDiceSides, v57); |
1298 | 975 else |
976 sprintf(pTmpBuf.data(), "%s\f%05u\t080%dd%d\n", pGlobalTXT_LocalizationStrings[53], | |
1699 | 977 0, pActors[uActorID].pMonsterInfo.uAttack1DamageDiceRolls, pActors[uActorID].pMonsterInfo.uAttack1DamageDiceSides); |
1298 | 978 } |
979 else | |
980 { | |
981 sprintf(pTmpBuf.data(), "%s\f%05u\t080%s\n", pGlobalTXT_LocalizationStrings[18], 0, pGlobalTXT_LocalizationStrings[630]); | |
1699 | 982 window->DrawText(v56, 150, (int)a4, TargetColor(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0); |
1298 | 983 a4 = a4 + LOBYTE(v56->uFontHeight) - 3; |
984 sprintf(pTmpBuf.data(), "%s\f%05u\t080%s\n", pGlobalTXT_LocalizationStrings[53], 0, pGlobalTXT_LocalizationStrings[630]); | |
985 } | |
1699 | 986 window->DrawText(v56, 150, a4, TargetColor(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0); |
1298 | 987 v58 = LOBYTE(v56->uFontHeight); |
988 a4 = a4 + v58 - 6 + v58; | |
989 if ( !i ) | |
990 { | |
991 v80 = pGlobalTXT_LocalizationStrings[630]; | |
992 v76 = 0; | |
993 v71 = pGlobalTXT_LocalizationStrings[628]; | |
994 v68 = "%s\f%05u\t080%s\n"; | |
995 sprintf(pTmpBuf.data(), v68, v71, v76, v80); | |
1699 | 996 window->DrawText(v56, 150, (int)a4, TargetColor(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0); |
1298 | 997 v58 = LOBYTE(v56->uFontHeight); |
998 a4 = a4 + v58 - 3; | |
999 } | |
1000 else | |
1001 { | |
1002 v120 = (SpellBuff *)pGlobalTXT_LocalizationStrings[628]; | |
1699 | 1003 v59 = &pActors[uActorID]; |
1004 v114 = pActors[uActorID].pMonsterInfo.uSpell1ID; | |
1005 if ( v114 && pActors[uActorID].pMonsterInfo.uSpell2ID ) | |
1298 | 1006 v120 = (SpellBuff *)pGlobalTXT_LocalizationStrings[629]; |
1007 if ( v114 ) | |
1008 { | |
1009 sprintf(pTmpBuf.data(), "%s\f%05u\t060%s\n", v120, 0, pSpellStats->pInfos[v114].pShortName); | |
1699 | 1010 window->DrawText(v56, 150, (int)a4, TargetColor(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0); |
1298 | 1011 v58 = LOBYTE(v56->uFontHeight); |
1012 a4 = a4 + v58 - 3; | |
1699 | 1013 v59 = &pActors[uActorID]; |
1298 | 1014 } |
1015 v60 = v59->pMonsterInfo.uSpell2ID; | |
1016 if ( v60 ) | |
1017 { | |
1018 sprintf(pTmpBuf.data(), "\f%05u\t060%s\n", 0, pSpellStats->pInfos[v60].pShortName); | |
1699 | 1019 window->DrawText(v56, 150, (int)a4, TargetColor(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0); |
1298 | 1020 v58 = LOBYTE(v56->uFontHeight); |
1021 a4 = a4 + v58 - 3; | |
1699 | 1022 v59 = &pActors[uActorID]; |
1298 | 1023 } |
1024 if ( !v59->pMonsterInfo.uSpell1ID && !v59->pMonsterInfo.uSpell2ID ) | |
1025 { | |
1026 v80 = pGlobalTXT_LocalizationStrings[153]; | |
1027 v76 = 0; | |
1028 v71 = pGlobalTXT_LocalizationStrings[628]; | |
1029 v68 = "%s\f%05u\t060%s\n"; | |
1030 sprintf(pTmpBuf.data(), v68, v71, v76, v80); | |
1699 | 1031 window->DrawText(v56, 150, (int)a4, TargetColor(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0); |
1298 | 1032 v58 = LOBYTE(v56->uFontHeight); |
1033 a4 = a4 + v58 - 3; | |
1034 } | |
1035 } | |
1036 a4 = a4 + v58 - 3; | |
1699 | 1037 window->DrawText(v56, 150, a4, TargetColor(0xE1u, 255, 0x9Bu), pGlobalTXT_LocalizationStrings[626], 0, 0, 0); |
1298 | 1038 a4 = a4 + LOBYTE(v56->uFontHeight) - 3; |
1039 v85[0] = pGlobalTXT_LocalizationStrings[87]; | |
1040 v85[1] = pGlobalTXT_LocalizationStrings[6]; | |
1041 v85[2] = pGlobalTXT_LocalizationStrings[240]; | |
1042 v85[3] = pGlobalTXT_LocalizationStrings[70]; | |
1043 v85[4] = pGlobalTXT_LocalizationStrings[142]; | |
1044 v85[5] = pGlobalTXT_LocalizationStrings[214]; | |
1045 v85[6] = pGlobalTXT_LocalizationStrings[29]; | |
1046 v85[7] = pGlobalTXT_LocalizationStrings[133]; | |
1047 v85[8] = pGlobalTXT_LocalizationStrings[54]; | |
1048 v85[9] = pGlobalTXT_LocalizationStrings[624]; | |
1699 | 1049 v95[1] = (char *)pActors[uActorID].pMonsterInfo.uResFire; |
1050 v95[2] = (char *)pActors[uActorID].pMonsterInfo.uResAir; | |
1051 v95[3] = (char *)pActors[uActorID].pMonsterInfo.uResWater; | |
1052 v95[4] = (char *)pActors[uActorID].pMonsterInfo.uResEarth; | |
1053 v95[5] = (char *)pActors[uActorID].pMonsterInfo.uResMind; | |
1054 v95[6] = (char *)pActors[uActorID].pMonsterInfo.uResSpirit; | |
1055 v95[7] = (char *)pActors[uActorID].pMonsterInfo.uResBody; | |
1056 v95[8] = (char *)pActors[uActorID].pMonsterInfo.uResLight; | |
1057 v95[9] = (char *)pActors[uActorID].pMonsterInfo.uResPhysical; | |
1058 v95[10] = (char *)pActors[uActorID].pMonsterInfo.uResDark; | |
1298 | 1059 if ( v112 ) |
1060 { | |
1061 v124 = 0; | |
1062 do | |
1063 { | |
1064 v62 = v95[v124+1]; | |
1065 if ( v62 == (char *)200 ) | |
1066 { | |
1067 v81 = pGlobalTXT_LocalizationStrings[625]; | |
1068 } | |
1069 else | |
1070 { | |
1071 if ( v62 ) | |
1072 v81 = pGlobalTXT_LocalizationStrings[627]; | |
1073 else | |
1074 v81 = pGlobalTXT_LocalizationStrings[153]; | |
1075 } | |
1076 sprintf(pTmpBuf.data(), "%s\f%05u\t070%s\n", v85[v124], 0, v81); | |
1699 | 1077 window->DrawText(v56, 170, a4, TargetColor(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0); |
1298 | 1078 v63 = LOBYTE(v56->uFontHeight); |
1079 v124 += 4; | |
1080 a4 = a4 + v63 - 3; | |
1081 } | |
1082 while ( v124 < 40 ); | |
1083 } | |
1084 else | |
1085 { | |
1086 i = 0; | |
1087 do | |
1088 { | |
1089 sprintf(pTmpBuf.data(), "%s\f%05u\t070%s\n", v85[i], 0, pGlobalTXT_LocalizationStrings[630]); // "?" | |
1699 | 1090 window->DrawText(v56, 170, a4, TargetColor(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0); |
1298 | 1091 v65 = LOBYTE(v56->uFontHeight); |
1092 ++i; | |
1093 a4 = a4 + v65 - 3; | |
1094 } | |
1095 while ( i < 10 ); | |
1096 } | |
1097 if ( (signed __int64)pParty->pPartyBuffs[PARTY_BUFF_DETECT_LIFE].uExpireTime > 0 ) | |
1098 { | |
1699 | 1099 sprintf(pTmpBuf.data(), "%s: %d", pGlobalTXT_LocalizationStrings[650], pActors[uActorID].sCurrentHP); |
1298 | 1100 pFontSmallnum->GetLineWidth(pTmpBuf.data()); |
1699 | 1101 window->DrawTitleText(pFontSmallnum, 0, window->uFrameHeight - LOBYTE(pFontSmallnum->uFontHeight) - 12, 0, pTmpBuf.data(), 3); |
1298 | 1102 } |
1103 } | |
1104 | |
1105 | |
1106 //----- (00417BB5) -------------------------------------------------------- | |
1107 const char *CharacterUI_GetSkillDescText(unsigned int uPlayerID, PLAYER_SKILL_TYPE uPlayerSkillType) | |
1108 { | |
1109 //enum PLAYER_SKILL_TYPE v2; // esi@1 | |
1110 //unsigned int v3; // ebx@1 | |
1111 int v4; // edi@1 | |
1112 int v5; // eax@1 | |
1113 Player *pPlayer; // ebx@7 | |
1114 char v7; // al@7 | |
1115 char v8; // cl@7 | |
1116 unsigned int v9; // eax@8 | |
1117 unsigned int v10; // eax@8 | |
1118 unsigned int v11; // eax@8 | |
1119 PLAYER_SKILL_TYPE v12; // edi@8 | |
1120 unsigned int v13; // eax@8 | |
1121 unsigned int v14; // eax@8 | |
1122 PLAYER_SKILL_TYPE v15; // esi@8 | |
1123 int v16; // edi@8 | |
1124 char v17; // al@8 | |
1125 int v18; // ST5C_4@8 | |
1126 int v19; // ST4C_4@8 | |
1127 int v20; // ST3C_4@8 | |
1128 int v21; // ST2C_4@8 | |
1129 int v22; // ST1C_4@8 | |
1130 char *v23; // esi@8 | |
1131 unsigned int v24; // eax@9 | |
1132 unsigned int v25; // eax@9 | |
1133 unsigned int v26; // eax@9 | |
1134 unsigned int v27; // ecx@9 | |
1135 PLAYER_SKILL_TYPE v28; // ebx@9 | |
1136 unsigned int v29; // eax@9 | |
1137 char a2[1200]; // [sp+Ch] [bp-538h]@7 | |
1138 char Source[120]; // [sp+4BCh] [bp-88h]@7 | |
1139 unsigned __int16 *v33; // [sp+534h] [bp-10h]@1 | |
1140 int v34; // [sp+538h] [bp-Ch]@1 | |
1141 unsigned __int16 *v35; // [sp+53Ch] [bp-8h]@1 | |
1142 //enum PLAYER_SKILL_TYPE v36; // [sp+540h] [bp-4h]@1 | |
1143 | |
1144 //v2 = uPlayerSkillType; | |
1145 //v3 = uPlayerID; | |
1146 //v36 = uPlayerSkillType; | |
1147 v4 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[431]);// Normal | |
1148 v34 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[433]);// Expert | |
1149 v33 = (unsigned __int16 *)pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[432]);// Master | |
1150 v5 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[96]);// Grand | |
1151 v35 = (unsigned __int16 *)v4; | |
1152 if ( v34 > v4 ) | |
1153 v35 = (unsigned __int16 *)v34; | |
1154 if ( (signed int)v33 > (signed int)v35 ) | |
1155 v35 = v33; | |
1156 if ( v5 > (signed int)v35 ) | |
1157 v35 = (unsigned __int16 *)v5; | |
1158 pPlayer = &pParty->pPlayers[uPlayerID]; | |
1159 //v33 = &pPlayer->pActiveSkills[uPlayerSkillType]; | |
1160 v7 = pPlayer->GetActualSkillLevel(uPlayerSkillType); | |
1161 v8 = pPlayer->pActiveSkills[uPlayerSkillType]; | |
1162 a2[0] = 0; | |
1163 Source[0] = 0; | |
1164 if ( (v8 & 0x3F) == (v7 & 0x3F) ) | |
1165 { | |
1166 strcpy(a2, "%s\n\n"); | |
1167 v24 = GetSkillColor(pPlayer->classType, uPlayerSkillType, 1); | |
1168 sprintf(Source, "\f%05d", v24); | |
1169 strcat(a2, Source); | |
1170 strcat(a2, "%s\t%03d:\t%03d%s\t000\n"); | |
1171 v25 = GetSkillColor(pPlayer->classType, uPlayerSkillType, 2); | |
1172 sprintf(Source, "\f%05d", v25); | |
1173 strcat(a2, Source); | |
1174 strcat(a2, "%s\t%03d:\t%03d%s\t000\n"); | |
1175 v26 = GetSkillColor(pPlayer->classType, uPlayerSkillType, 3); | |
1176 sprintf(Source, "\f%05d", v26); | |
1177 strcat(a2, Source); | |
1178 strcat(a2, "%s\t%03d:\t%03d%s\t000\n"); | |
1179 v27 = pPlayer->classType; | |
1180 v28 = uPlayerSkillType; | |
1181 v29 = GetSkillColor(v27, uPlayerSkillType, 4); | |
1182 sprintf(Source, "\f%05d", v29); | |
1183 strcat(a2, Source); | |
1184 strcat(a2, "%s\t%03d:\t%03d%s\t000\n"); | |
1185 | |
1186 v23 = static_sub_417BB5_out_string; | |
1187 sprintf(static_sub_417BB5_out_string, a2, pSkillDesc[v28], pGlobalTXT_LocalizationStrings[431], // Normal | |
1188 (char *)v35 + 3, v35 + 5, pNormalSkillDesc[v28], pGlobalTXT_LocalizationStrings[433], // Expert | |
1189 (char *)v35 + 3, v35 + 5, pExpertSkillDesc[v28], pGlobalTXT_LocalizationStrings[432], // Master | |
1190 (char *)v35 + 3, v35 + 5, pMasterSkillDesc[v28], pGlobalTXT_LocalizationStrings[96], // Grand | |
1191 (char *)v35 + 3, v35 + 5, pGrandSkillDesc[v28]); | |
1192 } | |
1193 else | |
1194 { | |
1195 strcpy(a2, "%s\n\n"); | |
1196 v9 = GetSkillColor(pPlayer->classType, uPlayerSkillType, 1); | |
1197 sprintf(Source, "\f%05d", v9); | |
1198 strcat(a2, Source); | |
1199 strcat(a2, "%s\t%03d:\t%03d%s\t000\n"); | |
1200 v10 = GetSkillColor(pPlayer->classType, uPlayerSkillType, 2); | |
1201 sprintf(Source, "\f%05d", v10); | |
1202 strcat(a2, Source); | |
1203 strcat(a2, "%s\t%03d:\t%03d%s\t000\n"); | |
1204 v11 = GetSkillColor(pPlayer->classType, uPlayerSkillType, 3); | |
1205 sprintf(Source, "\f%05d", v11); | |
1206 strcat(a2, Source); | |
1207 strcat(a2, "%s\t%03d:\t%03d%s\t000\n"); | |
1208 v12 = uPlayerSkillType; | |
1209 v13 = GetSkillColor(pPlayer->classType, uPlayerSkillType, 4); | |
1210 sprintf(Source, "\f%05d", v13); | |
1211 strcat(a2, Source); | |
1212 strcat(a2, "%s\t%03d:\t%03d%s\t000\n\n"); | |
1213 v14 = TargetColor(0xFFu, 0xFFu, 0xFFu); | |
1214 sprintf(Source, "\f%05d", v14); | |
1215 strcat(a2, Source); | |
1216 strcat(a2, "%s: +%d"); | |
1217 v15 = v12; | |
1218 v16 = (int)(v35 + 5); | |
1219 v15 = (PLAYER_SKILL_TYPE)((int)v15 * 4); | |
1220 v34 = (int)((char *)v35 + 3); | |
1221 v17 = pPlayer->GetActualSkillLevel(uPlayerSkillType); | |
1222 v18 = *(int *)(pGrandSkillDesc[v15]); | |
1223 v19 = *(int *)(pMasterSkillDesc[v15]); | |
1224 v20 = *(int *)(pExpertSkillDesc[v15]); | |
1225 v21 = *(int *)(pNormalSkillDesc[v15]); | |
1226 v22 = *(int *)(pSkillDesc[v15]); | |
1227 v23 = static_sub_417BB5_out_string; | |
1228 sprintf( | |
1229 static_sub_417BB5_out_string, | |
1230 a2, | |
1231 v22, | |
1232 pGlobalTXT_LocalizationStrings[431], | |
1233 v34, | |
1234 v16, | |
1235 v21, | |
1236 pGlobalTXT_LocalizationStrings[433], | |
1237 v34, | |
1238 v16, | |
1239 v20, | |
1240 pGlobalTXT_LocalizationStrings[432], | |
1241 v34, | |
1242 v16, | |
1243 v19, | |
1244 pGlobalTXT_LocalizationStrings[96], | |
1245 v34, | |
1246 v16, | |
1247 v18, | |
1248 pGlobalTXT_LocalizationStrings[623], | |
1249 (v17 & 0x3F) - (*(char *)v33 & 0x3F)); | |
1250 } | |
1251 return v23; | |
1252 } | |
1253 | |
1254 //----- (00417FE5) -------------------------------------------------------- | |
1255 void CharacterUI_SkillsTab_ShowHint() | |
1256 { | |
1257 unsigned int v0; // ecx@1 | |
1258 unsigned int v1; // eax@1 | |
1259 GUIButton *i; // esi@6 | |
1260 const char *v3; // eax@12 | |
1261 unsigned int pX; // [sp+4h] [bp-8h]@1 | |
1262 unsigned int pY; // [sp+8h] [bp-4h]@1 | |
1263 | |
1264 pMouse->GetClickPos(&pX, &pY); | |
1265 v0 = pX; | |
1266 v1 = pY; | |
1267 if ( (signed int)pX < 24 || (signed int)pX > 455 || (signed int)pY < 18 || (signed int)pY > 36 ) | |
1268 { | |
1269 for ( i = pGUIWindow_CurrentMenu->pControlsHead; i; i = i->pNext ) | |
1270 { | |
1271 if ( i->msg == UIMSG_SkillUp | |
1272 && (signed int)v0 >= (signed int)i->uX | |
1273 && (signed int)v0 <= (signed int)i->uZ | |
1274 && (signed int)v1 >= (signed int)i->uY | |
1275 && (signed int)v1 <= (signed int)i->uW ) | |
1276 { | |
1277 v3 = CharacterUI_GetSkillDescText(uActiveCharacter - 1, (PLAYER_SKILL_TYPE)i->msg_param); | |
1393 | 1278 CharacterUI_DrawTooltip(pSkillNames[i->msg_param], v3); |
1298 | 1279 v1 = pY; |
1280 v0 = pX; | |
1281 } | |
1282 } | |
1283 } | |
1284 else | |
1285 { | |
1393 | 1286 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[207], pSkillPointsAttributeDescription); |
1298 | 1287 } |
1288 | |
1289 } | |
1290 | |
1291 //----- (00418083) -------------------------------------------------------- | |
1458 | 1292 void CharacterUI_StatsTab_ShowHint() |
1393 | 1293 { |
1298 | 1294 int pStringNum; // edi@1 |
1295 signed int pTextColor; // eax@15 | |
1296 char *pHourWord; // ecx@17 | |
1297 char *pDayWord; // eax@20 | |
1298 int v15; // ebx@28 | |
1299 int v16; // eax@33 | |
1300 POINT a2; // [sp+Ch] [bp-24h]@1 | |
1301 int pHour; // [sp+14h] [bp-1Ch]@15 | |
1302 unsigned int pDay; // [sp+24h] [bp-Ch]@15 | |
1303 | |
1393 | 1304 pMouse->GetCursorPos(&a2); |
1305 for ( pStringNum = 0; pStringNum < stat_string_coord.size(); ++pStringNum ) | |
1298 | 1306 { |
1393 | 1307 if (a2.x >= stat_string_coord[pStringNum].x && a2.x <= stat_string_coord[pStringNum].x + stat_string_coord[pStringNum].width ) |
1298 | 1308 { |
1393 | 1309 if (a2.y >= stat_string_coord[pStringNum].y && a2.y <= stat_string_coord[pStringNum].y + stat_string_coord[pStringNum].height ) |
1298 | 1310 break; |
1311 } | |
1312 } | |
1393 | 1313 |
1298 | 1314 switch ( pStringNum ) |
1315 { | |
1316 case 0:// Attributes | |
1317 case 1: | |
1318 case 2: | |
1319 case 3: | |
1320 case 4: | |
1321 case 5: | |
1322 case 6: | |
1323 if ( aAttributeNames[pStringNum] && pAttributeDescriptions[pStringNum] ) | |
1393 | 1324 CharacterUI_DrawTooltip(aAttributeNames[pStringNum], pAttributeDescriptions[pStringNum]); |
1298 | 1325 break; |
1326 case 7:// Health Points | |
1327 if ( pGlobalTXT_LocalizationStrings[108] && pHealthPointsAttributeDescription ) | |
1393 | 1328 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[108], pHealthPointsAttributeDescription); |
1298 | 1329 break; |
1330 case 8:// Spell Points | |
1331 if ( pGlobalTXT_LocalizationStrings[212] && pSpellPointsAttributeDescription ) | |
1393 | 1332 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[212], pSpellPointsAttributeDescription); |
1298 | 1333 break; |
1334 case 9:// Armor Class | |
1335 if ( pGlobalTXT_LocalizationStrings[12] && pArmourClassAttributeDescription ) | |
1393 | 1336 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[12], pArmourClassAttributeDescription); |
1298 | 1337 break; |
1338 case 10:// Player Condition | |
1339 strcpy(pTmpBuf2.data(), pPlayerConditionAttributeDescription); | |
1340 strcat(pTmpBuf2.data(), "\n"); | |
1341 extern std::array<unsigned int, 18> pConditionImportancyTable; | |
1342 for ( uint i = 0; i < 18; ++i ) | |
1343 { | |
1344 if ( pPlayers[uActiveCharacter]->pConditions[pConditionImportancyTable[i]] ) | |
1345 { | |
1346 strcat(pTmpBuf2.data(), " \n"); | |
1347 pHour = pParty->uTimePlayed - pPlayers[uActiveCharacter]->pConditions[pConditionImportancyTable[i]]; | |
1348 pHour = (unsigned int)((pHour * 0.234375) / 60 / 60); | |
1349 pDay = (unsigned int)pHour / 24; | |
1350 pHour %= 24i64; | |
1351 pTextColor = GetConditionDrawColor(pConditionImportancyTable[i]); | |
1352 sprintfex(pTmpBuf.data(), format_4E2DE8, pTextColor, aCharacterConditionNames[pConditionImportancyTable[i]]); | |
1353 strcat(pTmpBuf2.data(), pTmpBuf.data()); | |
1354 if ( pHour && pHour <= 1 ) | |
1355 pHourWord = pGlobalTXT_LocalizationStrings[109]; | |
1356 else | |
1357 pHourWord = pGlobalTXT_LocalizationStrings[110]; | |
1358 if ( !pDay || (pDayWord = pGlobalTXT_LocalizationStrings[56], pDay > 1) ) | |
1359 pDayWord = pGlobalTXT_LocalizationStrings[57]; | |
1360 sprintfex(pTmpBuf.data(), "%lu %s, %lu %s", pDay, pDayWord, pHour, pHourWord); | |
1361 strcat(pTmpBuf2.data(), pTmpBuf.data()); | |
1362 } | |
1363 } | |
1364 if ( pGlobalTXT_LocalizationStrings[47] && pTmpBuf2.data() ) | |
1393 | 1365 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[47], pTmpBuf2.data()); |
1298 | 1366 break; |
1367 case 11:// Fast Spell | |
1368 if ( pGlobalTXT_LocalizationStrings[172] && pFastSpellAttributeDescription ) | |
1393 | 1369 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[172], pFastSpellAttributeDescription); |
1298 | 1370 break; |
1371 case 12:// Player Age | |
1372 if ( pGlobalTXT_LocalizationStrings[5] && pPlayerAgeAttributeDescription ) | |
1393 | 1373 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[5], pPlayerAgeAttributeDescription); |
1298 | 1374 break; |
1375 case 13:// Player Level | |
1376 if ( pGlobalTXT_LocalizationStrings[131] && pPlayerLevelAttributeDescription ) | |
1393 | 1377 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[131], pPlayerLevelAttributeDescription); |
1298 | 1378 break; |
1379 case 14://Experience | |
1380 v15 = pPlayers[uActiveCharacter]->uLevel; | |
1381 do | |
1382 { | |
1459 | 1383 if ( (signed __int64)pPlayers[uActiveCharacter]->uExperience < (unsigned int)GetExperienceRequiredForLevel(v15) ) |
1298 | 1384 break; |
1385 ++v15; | |
1386 } | |
1387 while ( v15 <= 10000 ); | |
1388 pTmpBuf[0] = 0; | |
1389 pTmpBuf2[0] = 0; | |
1390 if ( v15 > pPlayers[uActiveCharacter]->uLevel ) | |
1391 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[147], v15); | |
1459 | 1392 v16 = GetExperienceRequiredForLevel(v15) - LODWORD(pPlayers[uActiveCharacter]->uExperience); |
1298 | 1393 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[538], v16, v15 + 1); |
1394 strcat(pTmpBuf.data(), "\n"); | |
1395 strcat(pTmpBuf.data(), pTmpBuf2.data()); | |
1396 sprintf(pTmpBuf2.data(), "%s\n \n%s", pPlayerExperienceAttributeDescription, pTmpBuf.data()); | |
1397 if ( pGlobalTXT_LocalizationStrings[83] && pTmpBuf2.data() ) | |
1393 | 1398 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[83], pTmpBuf2.data()); |
1298 | 1399 break; |
1400 case 15:// Attack Bonus | |
1401 if ( pGlobalTXT_LocalizationStrings[587] && pAttackBonusAttributeDescription ) | |
1393 | 1402 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[587], pAttackBonusAttributeDescription); |
1298 | 1403 break; |
1404 case 16:// Attack Damage | |
1405 if ( pGlobalTXT_LocalizationStrings[588] && pAttackDamageAttributeDescription ) | |
1393 | 1406 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[588], pAttackDamageAttributeDescription); |
1298 | 1407 break; |
1408 case 17:// Missle Bonus | |
1409 if ( pGlobalTXT_LocalizationStrings[589] && pMissleBonusAttributeDescription ) | |
1393 | 1410 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[589], pMissleBonusAttributeDescription); |
1298 | 1411 break; |
1412 case 18:// Missle Damage | |
1413 if ( pGlobalTXT_LocalizationStrings[590] && pMissleDamageAttributeDescription ) | |
1393 | 1414 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[590], pMissleDamageAttributeDescription); |
1298 | 1415 break; |
1416 case 19:// Fire Resistance | |
1417 if ( pGlobalTXT_LocalizationStrings[87] && pFireResistanceAttributeDescription ) | |
1393 | 1418 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[87], pFireResistanceAttributeDescription); |
1298 | 1419 break; |
1420 case 20:// Air Resistance | |
1421 if ( pGlobalTXT_LocalizationStrings[6] && pAirResistanceAttributeDescription ) | |
1393 | 1422 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[6], pAirResistanceAttributeDescription); |
1298 | 1423 break; |
1424 case 21:// Water Resistance | |
1425 if ( pGlobalTXT_LocalizationStrings[240] && pWaterResistanceAttributeDescription ) | |
1393 | 1426 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[240], pWaterResistanceAttributeDescription); |
1298 | 1427 break; |
1428 case 22:// Earth Resistance | |
1429 if ( pGlobalTXT_LocalizationStrings[70] && pEarthResistanceAttributeDescription ) | |
1393 | 1430 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[70], pEarthResistanceAttributeDescription); |
1298 | 1431 break; |
1432 case 23:// Mind Resistance | |
1433 if ( pGlobalTXT_LocalizationStrings[142] && pMindResistanceAttributeDescription ) | |
1393 | 1434 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[142], pMindResistanceAttributeDescription); |
1298 | 1435 break; |
1436 case 24:// Body Resistance | |
1437 if ( pGlobalTXT_LocalizationStrings[29] && pBodyResistanceAttributeDescription ) | |
1393 | 1438 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[29], pBodyResistanceAttributeDescription); |
1298 | 1439 break; |
1440 case 25: // Skill Points | |
1441 if ( pGlobalTXT_LocalizationStrings[207] && pSkillPointsAttributeDescription ) | |
1393 | 1442 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[207], pSkillPointsAttributeDescription); |
1298 | 1443 break; |
1393 | 1444 case 26: // Class description |
1445 { | |
1678 | 1446 if (pClassDescriptions[pPlayers[uActiveCharacter]->classType] && pClassNames[pPlayers[uActiveCharacter]->classType]) |
1447 CharacterUI_DrawTooltip(pClassNames[pPlayers[uActiveCharacter]->classType], pClassDescriptions[pPlayers[uActiveCharacter]->classType]); | |
1393 | 1448 } |
1449 break; | |
1450 | |
1298 | 1451 default: |
1452 break; | |
1453 } | |
1454 } | |
1455 | |
1456 //----- (00410B28) -------------------------------------------------------- | |
1458 | 1457 void DrawSpellDescriptionPopup(int spell_index) |
1298 | 1458 { |
1459 Player *v1; // edi@1 | |
1460 SpellInfo *v2; // esi@1 | |
1461 unsigned int v3; // eax@2 | |
1462 int v4; // eax@4 | |
1463 LONG v5; // ecx@4 | |
1464 int v6; // eax@10 | |
1465 char *v7; // ST44_4@12 | |
1466 unsigned __int16 v8; // ax@12 | |
1467 GUIWindow a1; // [sp+Ch] [bp-68h]@4 | |
1468 int v10; // [sp+60h] [bp-14h]@1 | |
1469 POINT a2; // [sp+64h] [bp-10h]@1 | |
1470 int v12; // [sp+6Ch] [bp-8h]@4 | |
1471 int v13; // [sp+70h] [bp-4h]@4 | |
1472 | |
1473 v1 = pPlayers[uActiveCharacter]; | |
1474 v10 = spell_index; | |
1475 v2 = &pSpellStats->pInfos[spell_index + 11 * v1->lastOpenedSpellbookPage + 1]; | |
1476 if ( pMouse->GetCursorPos(&a2)->y <= 250 ) | |
1477 v3 = pMouse->GetCursorPos(&a2)->y + 30; | |
1478 else | |
1479 v3 = 30; | |
1480 a1.uFrameY = v3; | |
1481 a1.uFrameWidth = 328; | |
1482 a1.uFrameHeight = 68; | |
1483 a1.uFrameX = 90; | |
1484 a1.uFrameZ = 417; | |
1485 a1.uFrameW = v3 + 67; | |
1486 a1.Hint = 0; | |
1487 a2.y = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[LOCSTR_NORMAL]); | |
1488 v13 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[LOCSTR_MASTER]); | |
1489 v12 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[LOCSTR_EXPERT]); | |
1490 v4 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[LOCSTR_GRAND]); | |
1491 v5 = a2.y; | |
1492 if ( v13 > a2.y ) | |
1493 v5 = v13; | |
1494 if ( v12 > v5 ) | |
1495 v5 = v12; | |
1496 if ( v4 > v5 ) | |
1497 v5 = v4; | |
1498 sprintf( pTmpBuf2.data(), | |
1499 "%s\n\n%s\t%03d:\t%03d%s\t000\n%s\t%03d:\t%03d%s\t000\n%s\t%03d:\t%03d%s\t000\n%s\t%03d:\t%03d%s", | |
1500 v2->pDescription, | |
1501 pGlobalTXT_LocalizationStrings[LOCSTR_NORMAL], | |
1502 v5 + 3, v5 + 10, | |
1503 v2->pBasicSkillDesc, | |
1504 pGlobalTXT_LocalizationStrings[LOCSTR_EXPERT], | |
1505 v5 + 3, v5 + 10, | |
1506 v2->pExpertSkillDesc, | |
1507 pGlobalTXT_LocalizationStrings[LOCSTR_MASTER], | |
1508 v5 + 3, v5 + 10, | |
1509 v2->pMasterSkillDesc, | |
1510 pGlobalTXT_LocalizationStrings[LOCSTR_GRAND], | |
1511 v5 + 3, v5 + 10, | |
1512 v2->pGrandmasterSkillDesc); | |
1513 v6 = pFontSmallnum->CalcTextHeight(pTmpBuf2.data(), &a1, 0, 0); | |
1514 a1.uFrameHeight += v6; | |
1515 if ( (signed int)a1.uFrameHeight < 150 ) | |
1516 a1.uFrameHeight = 150; | |
1517 a1.uFrameWidth = game_viewport_width; | |
1518 a1.DrawMessageBox(0); | |
1519 a1.uFrameWidth -= 12; | |
1520 a1.uFrameHeight -= 12; | |
1521 v7 = v2->pName; | |
1522 a1.uFrameZ = a1.uFrameX + a1.uFrameWidth - 1; | |
1523 a1.uFrameW = a1.uFrameHeight + a1.uFrameY - 1; | |
1524 v8 = TargetColor(0xFFu, 0xFFu, 0x9Bu); | |
1525 a1.DrawTitleText(pFontArrus, 0x78u, 0xCu, v8, v7, 3u); | |
1526 a1.DrawText(pFontSmallnum, 120, 44, 0, pTmpBuf2.data(), 0, 0, 0); | |
1527 a1.uFrameWidth = 108; | |
1528 a1.uFrameZ = a1.uFrameX + 107; | |
1529 a1.DrawTitleText(pFontComic, 0xCu, 0x4Bu, 0, pSkillNames[v1->lastOpenedSpellbookPage + 12], 3u); | |
1530 sprintf( pTmpBuf.data(), "%s\n%d", pGlobalTXT_LocalizationStrings[LOCSTR_SP_COST], | |
1531 pSpellDatas[spell_index + 11 * v1->lastOpenedSpellbookPage + 1].mana_per_skill[v1->pActiveSkills[v1->lastOpenedSpellbookPage + PLAYER_SKILL_FIRE]]); | |
1532 // *(&[0].field_12 //temp_fix field_14 | |
1533 // + ((unsigned int)LOBYTE(v1->pActiveSkills[v1->lastOpenedSpellbookPage + 12]) >> 6) | |
1534 // + 10 * (int)((char *)v10 + 11 * v1->lastOpenedSpellbookPage))); | |
1535 a1.DrawTitleText(pFontComic, 0xCu, a1.uFrameHeight - LOBYTE(pFontComic->uFontHeight) - 16, 0, pTmpBuf.data(), 3u); | |
1536 dword_507B00_spell_info_to_draw_in_popup = 0; | |
1537 } | |
1538 // 507B00: using guessed type int dword_507B00_spell_info_to_draw_in_popup; | |
1539 | |
1540 | |
1541 | |
1542 | |
1543 | |
1544 //----- (00416D62) -------------------------------------------------------- | |
1545 void sub_416D62_ShowPopupWindow_MonsterRecord_ItemInfo_etcsub_416D62(Vec2_int_ *_this) | |
1546 { | |
1547 signed int pPlayerNum; // eax@12 | |
1548 char *v2; // eax@32 | |
1549 void *v3; // ecx@52 | |
1550 unsigned int v4; // eax@59 | |
1551 int v5; // esi@62 | |
1552 signed int v6; // esi@64 | |
1553 signed int v7; // esi@69 | |
1554 ItemGen *v8; // ecx@70 | |
1555 unsigned int v9; // eax@72 | |
1556 unsigned int v10; // eax@76 | |
1557 //char v11; // zf@83 | |
1558 GUIButton *pButton; // esi@84 | |
1559 unsigned int v13; // ecx@85 | |
1560 char *pStr; // edi@85 | |
1561 //signed int pControlID; // eax@92 | |
1562 int v16; // eax@95 | |
1563 int v17; // eax@96 | |
1564 PLAYER_SKILL_TYPE v18; // eax@98 | |
1565 char *pStr2; // eax@99 | |
1566 unsigned int v20; // eax@108 | |
1567 unsigned int pSkillId; // eax@109 | |
1568 const char *pSkillInfo; // eax@111 | |
1569 //char *v23; // ebx@112 | |
1570 char *pHint; // edx@113 | |
1571 unsigned int pColor; // eax@113 | |
1572 GUIWindow pWindow; // [sp+4h] [bp-74h]@32 | |
1573 double v27; // [sp+58h] [bp-20h]@33 | |
1574 struct tagPOINT Point; // [sp+60h] [bp-18h]@6 | |
1575 char *v29; // [sp+68h] [bp-10h]@33 | |
1576 float v30; // [sp+6Ch] [bp-Ch]@33 | |
1577 unsigned int pX; // [sp+70h] [bp-8h]@3 | |
1578 unsigned int pY; // [sp+74h] [bp-4h]@3 | |
1579 | |
1580 if ( pCurrentScreen == SCREEN_VIDEO ) | |
1581 return; | |
1582 if ( _this ) | |
1583 { | |
1584 pX = _this->x; | |
1585 pY = _this->y; | |
1586 } | |
1587 else | |
1588 { | |
1589 pMouse->GetClickPos(&pX, &pY); | |
1590 } | |
1591 if ( pRenderer->bWindowMode ) | |
1592 { | |
1593 GetCursorPos(&Point); | |
1594 ScreenToClient(hWnd, &Point); | |
1595 if ( Point.x < 1 || Point.y < 1 || Point.x > 638 || Point.y > 478 ) | |
1596 { | |
1597 back_to_game(); | |
1598 return; | |
1599 } | |
1600 } | |
1601 | |
1602 if ( pParty->pPickedItem.uItemID )//нажатие на портрет перса правой кнопкой мыши с раствором | |
1603 { | |
1604 //v1 = 0; | |
1605 //do | |
1606 for ( pPlayerNum = 0; pPlayerNum < 4; ++pPlayerNum) | |
1607 { | |
1608 if ( (signed int)pX > RightClickPortraitXmin[pPlayerNum] && (signed int)pX < RightClickPortraitXmax[pPlayerNum] | |
1609 && (signed int)pY > 375 && (signed int)pY < 466 ) | |
1610 { | |
1611 pPlayers[uActiveCharacter]->UseItem_DrinkPotion_etc(pPlayerNum + 1, 1); | |
1612 return; | |
1613 } | |
1614 //++v1; | |
1615 } | |
1616 //while ( v1 < 4 ); | |
1617 } | |
1618 | |
1619 pEventTimer->Pause(); | |
1620 | |
1621 switch(pCurrentScreen) | |
1622 { | |
1623 case SCREEN_CASTING: | |
1624 { | |
1575 | 1625 OnInventoryItemRightClick(); |
1298 | 1626 break; |
1627 } | |
1628 | |
1629 case SCREEN_CHEST: | |
1630 { | |
1631 if ( !pPlayers[uActiveCharacter]->CanAct() ) | |
1632 { | |
1633 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[427],//%s не в состоянии %s | |
1634 pPlayers[uActiveCharacter]->pName, pGlobalTXT_LocalizationStrings[541]);//Опознать предметы | |
1635 pWindow.Hint = pTmpBuf.data(); | |
1636 pWindow.uFrameWidth = 384; | |
1637 pWindow.uFrameHeight = 180; | |
1638 pWindow.uFrameY = 40; | |
1639 if ( (signed int)pX <= 320 ) | |
1640 v10 = pX + 30; | |
1641 else | |
1642 v10 = pX - 414; | |
1643 pWindow.uFrameX = v10; | |
1644 pWindow.DrawMessageBox(0); | |
1645 } | |
1646 else | |
1647 { | |
1648 v9 = pX + pSRZBufferLineOffsets[pY]; | |
1649 if ( pRenderer->pActiveZBuffer[v9] & 0xFFFF ) | |
1650 { | |
1651 | |
1652 // __debugbreak(); // invalid indexing will result in invalid object ptr | |
1653 // v8 = (ItemGen *)(&pOtherOverlayList->pOverlays[49].field_4 + 2662 * (unsigned int)pChestWindow->ptr_1C + 18* *((short *)&pChests[0].igChestItems[139].uExpireTime | |
1654 // + (pRenderer->pActiveZBuffer[v9] & 0xFFFF) + 2662 * (unsigned int)pChestWindow->ptr_1C + 3)); | |
1655 v10=pChests[pChestWindow->par1C].pInventoryIndices[(pRenderer->pActiveZBuffer[v9] & 0xFFFF)-1]; | |
1656 v8 =&pChests[pChestWindow->par1C].igChestItems[v10-1]; | |
1657 GameUI_DrawItemInfo(v8); | |
1658 } | |
1659 } | |
1660 break; | |
1661 } | |
1662 case SCREEN_GAME: | |
1663 { | |
1664 if (GetCurrentMenuID() > 0) | |
1665 break; | |
1666 | |
1667 if ( (signed int)pY > (signed int)pViewport->uViewportBR_Y ) | |
1668 { | |
1669 pWindow.ptr_1C = (void *)((signed int)pX / 118); | |
1670 if ( (signed int)pX / 118 < 4 ) | |
1671 { | |
1672 pWindow.Hint = 0; | |
1673 pWindow.uFrameWidth = 400; | |
1674 pWindow.uFrameHeight = 200; | |
1675 pWindow.uFrameX = 38; | |
1676 pWindow.uFrameY = 60; | |
1677 pAudioPlayer->StopChannels(-1, -1); | |
1678 GameUI_CharacterQuickRecord_Draw(&pWindow, pPlayers[(int)pWindow.ptr_1C + 1]); | |
1679 } | |
1680 } | |
1681 else if ( (signed int)pX > (signed int)pViewport->uViewportBR_X ) | |
1682 { | |
1683 if ( (signed int)pY >= 130 ) | |
1684 { | |
1685 if ( (signed int)pX >= 476 && (signed int)pX <= 636 && (signed int)pY >= 240 && (signed int)pY <= 300 ) | |
1686 { | |
1687 pWindow.Hint = 0; | |
1688 pWindow.uFrameWidth = 400; | |
1689 pWindow.uFrameHeight = 200; | |
1690 pWindow.uFrameX = 38; | |
1691 pWindow.uFrameY = 60; | |
1692 pAudioPlayer->StopChannels(-1, -1); | |
1693 pWindow._41D73D_draw_buff_tooltip(); | |
1694 } | |
1695 else if ( (signed int)pX < 485 || (signed int)pX > 548 || (signed int)pY < 156 || (signed int)pY > 229 ) | |
1696 { | |
1697 if (!( (signed int)pX < 566 || (signed int)pX > 629 || (signed int)pY < 156 || (signed int)pY > 229 )) | |
1698 { | |
1699 pAudioPlayer->StopChannels(-1, -1); | |
1700 v3 = (void *)1; | |
1701 GameUI_DrawNPCPopup(v3); | |
1702 } | |
1703 } | |
1704 else | |
1705 { | |
1706 pAudioPlayer->StopChannels(-1, -1); | |
1707 v3 = 0; | |
1708 GameUI_DrawNPCPopup(v3); | |
1709 } | |
1710 } | |
1711 else | |
1712 { | |
1713 pWindow.Hint = (char *)GameUI_GetMinimapHintText(); | |
1714 pWindow.uFrameWidth = 256; | |
1715 pWindow.uFrameX = 130; | |
1716 pWindow.uFrameY = 140; | |
1717 pWindow.uFrameHeight = 64; | |
1718 pAudioPlayer->StopChannels(-1, -1); | |
1719 pWindow.DrawMessageBox(0); | |
1720 } | |
1721 } | |
1722 else | |
1723 { | |
1724 pWindow.Hint = 0; | |
1725 pWindow.uFrameWidth = 320; | |
1726 pWindow.uFrameHeight = 320; | |
1727 v4 = pX - 350; | |
1728 if ( (signed int)pX <= 320 ) | |
1729 v4 = pX + 30; | |
1730 pWindow.uFrameX = v4; | |
1731 pWindow.uFrameY = 40; | |
1732 if ( pRenderer->pRenderD3D ) | |
1733 LOWORD(v5) = pGame->pVisInstance->get_picked_object_zbuf_val(); | |
1734 else | |
1735 v5 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]]; | |
1736 v6 = (unsigned __int16)v5; | |
1737 if (PID_TYPE(v6) != OBJECT_Item) | |
1738 { | |
1739 if (PID_TYPE(v6) == OBJECT_Actor) | |
1740 { | |
1741 if ( pRenderer->uNumSceneBegins ) | |
1742 { | |
1743 pWindow.DrawMessageBox(1); | |
1744 MonsterPopup_Draw(PID_ID(v6), &pWindow); | |
1745 } | |
1746 else | |
1747 { | |
1748 pRenderer->BeginScene(); | |
1749 pWindow.DrawMessageBox(1); | |
1750 MonsterPopup_Draw(PID_ID(v6), &pWindow); | |
1751 pRenderer->EndScene(); | |
1752 } | |
1753 } | |
1754 } | |
1755 else | |
1756 { | |
1757 v7 = PID_ID(v6); | |
1758 if ( ! (pObjectList->pObjects[pSpriteObjects[v7].uObjectDescID].uFlags & 0x10 ) ) | |
1759 { | |
1760 v8 = &pSpriteObjects[v7].stru_24; | |
1761 GameUI_DrawItemInfo(v8); | |
1762 } | |
1763 } | |
1764 } | |
1765 break; | |
1766 } | |
1767 case SCREEN_BOOKS: | |
1768 { | |
1769 if ( !dword_506364 | |
1770 || (signed int)pX < (signed int)pViewport->uViewportTL_X | |
1771 || (signed int)pX > (signed int)pViewport->uViewportBR_X | |
1772 || (signed int)pY < (signed int)pViewport->uViewportTL_Y | |
1773 || (signed int)pY > (signed int)pViewport->uViewportBR_Y | |
1774 || (v2 = (char *)sub_444564(), (pWindow.Hint = v2) == 0) ) | |
1775 break; | |
1776 v30 = (double)(pFontArrus->GetLineWidth(v2) + 32); | |
1777 v27 = v30 + 6.7553994e15; | |
1778 v29 = (char *)LODWORD(v27); | |
1779 pWindow.uFrameWidth = LODWORD(v27); | |
1780 pWindow.uFrameX = pX + 5; | |
1781 pWindow.uFrameY = pY + 5; | |
1782 pWindow.uFrameHeight = 64; | |
1783 pAudioPlayer->StopChannels(-1, -1); | |
1784 pWindow.DrawMessageBox(0); | |
1785 break; | |
1786 } | |
1787 case SCREEN_CHARACTERS: | |
1788 case SCREEN_E: | |
1789 case SCREEN_CHEST_INVENTORY: | |
1790 { | |
1791 if ( (signed int)pX > 467 && pCurrentScreen != SCREEN_E ) | |
1792 { | |
1575 | 1793 OnInventoryItemRightClick(); |
1298 | 1794 } |
1795 else if ( (signed int)pY >= 345 ) | |
1796 break; | |
1797 else if ( pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] == 100 )//2DEvent - CharacerScreenStats | |
1798 { | |
1799 CharacterUI_StatsTab_ShowHint(); | |
1800 } | |
1801 else if ( pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] == 101 )//2DEvent - CharacerScreenSkills | |
1802 { | |
1803 CharacterUI_SkillsTab_ShowHint(); | |
1804 } | |
1805 else | |
1806 { | |
1807 if ( pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] == 103 )//2DEvent - CharacerScreenInventory | |
1575 | 1808 OnInventoryItemRightClick(); |
1298 | 1809 } |
1810 break; | |
1811 } | |
1812 case SCREEN_SPELL_BOOK: | |
1813 { | |
1814 if ( dword_507B00_spell_info_to_draw_in_popup ) | |
1815 DrawSpellDescriptionPopup(dword_507B00_spell_info_to_draw_in_popup - 1); | |
1816 break; | |
1817 } | |
1818 case SCREEN_HOUSE: | |
1819 { | |
1820 if ( (signed int)pY < 345 && (signed int)pX < 469 ) | |
1821 ShowPopupShopItem(); | |
1822 break; | |
1823 } | |
1824 case SCREEN_PARTY_CREATION: | |
1825 { | |
1826 pWindow.Hint = 0; | |
1827 pStr = 0; | |
1828 for ( pButton = pGUIWindow_CurrentMenu->pControlsHead; pButton; pButton = pButton->pNext) | |
1829 { | |
1830 if ( pButton->uButtonType == 1 && pButton->uButtonType != 3 && (signed int)pX > (signed int)pButton->uX && (signed int)pX < (signed int)pButton->uZ | |
1831 && (signed int)pY > (signed int)pButton->uY && (signed int)pY < (signed int)pButton->uW ) | |
1832 { | |
1833 switch ( pButton->msg ) | |
1834 { | |
1835 case UIMSG_0: //stats info | |
1836 pWindow.Hint = pAttributeDescriptions[(signed int)pButton->msg_param % 7]; | |
1837 pStr = aAttributeNames[(signed int)pButton->msg_param % 7]; | |
1838 break; | |
1839 case UIMSG_PlayerCreationClickPlus: //Plus button info | |
1840 pStr = pGlobalTXT_LocalizationStrings[670];//Добавить | |
1841 pWindow.Hint = pGlobalTXT_LocalizationStrings[671];//"Добавляет очко к выделенному навыку, забирая его из накопителя очков" | |
1842 break; | |
1843 case UIMSG_PlayerCreationClickMinus: //Minus button info | |
1844 pStr = pGlobalTXT_LocalizationStrings[668];//Вычесть | |
1845 pWindow.Hint = pGlobalTXT_LocalizationStrings[669];//"Вычитает очко из выделенного навыка, возвращая его в накопитель очков" | |
1846 break; | |
1847 case UIMSG_PlayerCreationSelectActiveSkill: //Available skill button info | |
1848 v18 = pParty->pPlayers[uPlayerCreationUI_SelectedCharacter].GetSkillIdxByOrder(pButton->msg_param + 4); | |
1849 pStr = pSkillNames[v18]; | |
1850 pWindow.Hint = pSkillDesc[v18]; | |
1851 break; | |
1852 case UIMSG_PlayerCreationSelectClass: //Available Class Info | |
1853 pWindow.Hint = pClassDescriptions[pButton->msg_param]; | |
1854 pStr = pClassNames[pButton->msg_param]; | |
1855 break; | |
1856 case UIMSG_PlayerCreationClickOK: //OK Info | |
1857 pWindow.Hint = pGlobalTXT_LocalizationStrings[664];//Щелкните здесь для утверждения состава отряда и продолжения игры. | |
1858 pStr = pGlobalTXT_LocalizationStrings[665];//Кнопка ОК | |
1859 break; | |
1860 case UIMSG_PlayerCreationClickReset: //Clear info | |
1861 pWindow.Hint = pGlobalTXT_LocalizationStrings[666];//Сбрасывает все параметры и навыки отряда. | |
1862 pStr = pGlobalTXT_LocalizationStrings[667];//Кнопка Очистить | |
1863 break; | |
1864 case UIMSG_PlayerCreation_SelectAttribute: // Character info | |
1865 pStr = pParty->pPlayers[pButton->msg_param].pName; | |
1866 pWindow.Hint = pClassDescriptions[pParty->pPlayers[pButton->msg_param].classType]; | |
1867 break; | |
1868 } | |
1869 if ( pButton->msg > UIMSG_44 && pButton->msg <= UIMSG_PlayerCreationRemoveDownSkill ) //Sellected skills info | |
1870 { | |
1871 pSkillId = pParty->pPlayers[pButton->msg_param].GetSkillIdxByOrder(pButton->msg - UIMSG_48); | |
1872 pY = 0; | |
1873 if ( (signed int)pSkillId < 37 ) | |
1874 { | |
1875 pSkillInfo = CharacterUI_GetSkillDescText(pButton->msg_param, (PLAYER_SKILL_TYPE)pSkillId); | |
1876 strcpy(pTmpBuf2.data(), pSkillInfo); | |
1877 pWindow.Hint = pTmpBuf2.data(); | |
1878 pStr = pSkillNames[pSkillId]; | |
1879 } | |
1880 } | |
1881 } | |
1882 } | |
1883 if ( pWindow.Hint ) | |
1884 { | |
1885 pHint = (char*)pWindow.Hint; | |
1886 pWindow.Hint = 0; | |
1887 pWindow.uFrameWidth = 384; | |
1888 pWindow.uFrameHeight = 256; | |
1889 pWindow.uFrameX = 128; | |
1890 pWindow.uFrameY = 40; | |
1891 pWindow.uFrameHeight = pFontSmallnum->CalcTextHeight(pHint, &pWindow, 24, 0) + 2 * LOBYTE(pFontLucida->uFontHeight) + 24; | |
1892 pWindow.uFrameZ = pWindow.uFrameX + pWindow.uFrameWidth - 1; | |
1893 pWindow.uFrameW = pWindow.uFrameY + pWindow.uFrameHeight - 1; | |
1894 pWindow.DrawMessageBox(0); | |
1895 pWindow.uFrameX += 12; | |
1896 pWindow.uFrameWidth -= 24; | |
1897 pWindow.uFrameY += 12; | |
1898 pWindow.uFrameHeight -= 12; | |
1899 pWindow.uFrameZ = pWindow.uFrameX + pWindow.uFrameWidth - 1; | |
1900 pWindow.uFrameW = pWindow.uFrameY + pWindow.uFrameHeight - 1; | |
1901 pColor = TargetColor(0xFF, 0xFF, 0x9B); | |
1902 sprintf(pTmpBuf.data(), format_4E2D80, pColor, pStr);//"\f%05d%s\f00000\n" | |
1903 pWindow.DrawTitleText(pFontCreate, 0, 0, 0, pTmpBuf.data(), 3); | |
1904 pWindow.DrawText(pFontSmallnum, 1, pFontLucida->uFontHeight, 0, pHint, 0, 0, 0); | |
1905 } | |
1906 break; | |
1907 } | |
1908 default: | |
1909 { | |
1910 break; | |
1911 } | |
1912 } | |
1913 dword_507BF0_is_there_popup_onscreen = 1; | |
1914 viewparams->bRedrawGameUI = 1; | |
1915 } |