Mercurial > mm7
annotate UI/UIPopup.cpp @ 1720:5f2583a4fa7d
m
author | Ritor1 |
---|---|
date | Wed, 25 Sep 2013 08:59:01 +0600 |
parents | 5863074ed9ba |
children | 1c072d19e397 |
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 { |
1705 | 110 unsigned int v2; // eax@3 |
111 const char *v28; // edi@69 | |
112 int v34; // esi@81 | |
113 char *pText; // [sp-14h] [bp-28Ch]@110 | |
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 | |
119 GUIWindow iteminfo_window; // [sp+208h] [bp-70h]@2 | |
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 | |
1298 | 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 if ( pPlayers[uActiveCharacter]->CanIdentify(inspect_item) == 1 ) | |
1298 | 157 inspect_item->SetIdentified(); |
1699 | 158 v83 = SPEECH_9; |
159 if ( !inspect_item->IsIdentified() ) | |
160 ShowStatusBarString(pGlobalTXT_LocalizationStrings[446], 2);//"Identify Failed" | |
161 else | |
162 { | |
163 v83 = SPEECH_8; | |
164 if ( inspect_item->GetValue() < 100 * (pPlayers[uActiveCharacter]->uLevel + 5) ) | |
165 v83 = SPEECH_7; | |
166 } | |
167 if ( dword_4E455C ) | |
168 { | |
169 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)(int)v83, 0); | |
170 dword_4E455C = 0; | |
171 } | |
172 } | |
173 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
|
174 if (inspect_item->IsBroken()) |
1699 | 175 { |
176 if ( pPlayers[uActiveCharacter]->CanRepair(inspect_item) == 1 ) | |
177 inspect_item->uAttributes = inspect_item->uAttributes & 0xFFFFFFFD | 1; | |
178 v83 = SPEECH_11; | |
179 if ( !inspect_item->IsBroken() ) | |
180 v83 = SPEECH_10; | |
181 else | |
182 ShowStatusBarString(pGlobalTXT_LocalizationStrings[448], 2);//"Repair Failed" | |
183 if ( dword_4E455C ) | |
184 { | |
185 pPlayers[uActiveCharacter]->PlaySound(v83, 0); | |
186 dword_4E455C = 0; | |
187 } | |
188 } | |
189 } | |
190 if (inspect_item->IsBroken()) | |
191 { | |
192 iteminfo_window.DrawMessageBox(0); | |
193 pRenderer->SetTextureClipRect(iteminfo_window.uFrameX + 12, iteminfo_window.uFrameY + 12, | |
194 iteminfo_window.uFrameX + iteminfo_window.uFrameWidth - 12, | |
195 iteminfo_window.uFrameY + iteminfo_window.uFrameHeight - 12); | |
196 iteminfo_window.uFrameWidth -= 24; | |
197 iteminfo_window.uFrameHeight -= 12; | |
198 iteminfo_window.uFrameZ = iteminfo_window.uFrameX + iteminfo_window.uFrameWidth - 1; | |
199 iteminfo_window.uFrameW = iteminfo_window.uFrameY + iteminfo_window.uFrameHeight - 1; | |
200 pRenderer->DrawTransparentRedShade(iteminfo_window.uFrameX + v78, v81 + iteminfo_window.uFrameY + 30, pIcons_LOD->LoadTexturePtr(pItemsTable->pItems[inspect_item->uItemID].pIconName, TEXTURE_16BIT_PALETTE)); | |
201 if ( inspect_item->IsIdentified()) | |
202 pText = (char *)inspect_item->GetIdentifiedName(); | |
203 else | |
204 pText = pItemsTable->pItems[inspect_item->uItemID].pUnidentifiedName; | |
205 iteminfo_window.DrawTitleText(pFontArrus, 0, 0xCu, TargetColor(0xFFu, 0xFFu, 0x9Bu), pText, 3); | |
206 iteminfo_window.DrawTitleText(pFontArrus, 0x64u, ((signed int)iteminfo_window.uFrameHeight >> 1) - pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[32], &iteminfo_window, 0, 0) / 2, | |
207 TargetColor(0xFFu, 0x19u, 0x19u), pGlobalTXT_LocalizationStrings[32], 3); //"Broken Item" | |
208 pRenderer->ResetTextureClipRect(); | |
209 if ( !areWeLoadingTexture ) | |
210 { | |
211 pIcons_LOD->LoadTexturePtr(pItemsTable->pItems[inspect_item->uItemID].pIconName, TEXTURE_16BIT_PALETTE)->Release(); | |
212 pIcons_LOD->SyncLoadedFilesCount(); | |
213 } | |
214 return; | |
215 } | |
216 if (!inspect_item->IsIdentified()) | |
217 { | |
218 iteminfo_window.DrawMessageBox(0); | |
219 pRenderer->SetTextureClipRect(iteminfo_window.uFrameX + 12, iteminfo_window.uFrameY + 12, | |
220 iteminfo_window.uFrameX + iteminfo_window.uFrameWidth - 12, iteminfo_window.uFrameY + iteminfo_window.uFrameHeight - 12); | |
221 iteminfo_window.uFrameWidth -= 24; | |
222 iteminfo_window.uFrameHeight -= 12; | |
223 iteminfo_window.uFrameZ = iteminfo_window.uFrameX + iteminfo_window.uFrameWidth - 1; | |
224 iteminfo_window.uFrameW = iteminfo_window.uFrameY + iteminfo_window.uFrameHeight - 1; | |
225 pRenderer->DrawTextureTransparent(iteminfo_window.uFrameX + v78, v81 + iteminfo_window.uFrameY + 30, pIcons_LOD->LoadTexturePtr(pItemsTable->pItems[inspect_item->uItemID].pIconName, TEXTURE_16BIT_PALETTE)); | |
226 iteminfo_window.DrawTitleText(pFontArrus, 0, 0xCu, TargetColor(0xFFu, 0xFFu, 0x9Bu), pItemsTable->pItems[inspect_item->uItemID].pUnidentifiedName, 3); | |
227 iteminfo_window.DrawTitleText(pFontArrus, 0x64u, ((signed int)iteminfo_window.uFrameHeight >> 1) - pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[232], &iteminfo_window, 0, 0) / 2, | |
228 TargetColor(0xFFu, 0x19u, 0x19u), pGlobalTXT_LocalizationStrings[232], 3);//"Not Identified" | |
229 pRenderer->ResetTextureClipRect(); | |
230 if ( !areWeLoadingTexture ) | |
231 { | |
232 pIcons_LOD->LoadTexturePtr(pItemsTable->pItems[inspect_item->uItemID].pIconName, TEXTURE_16BIT_PALETTE)->Release(); | |
233 pIcons_LOD->SyncLoadedFilesCount(); | |
234 } | |
235 return; | |
236 } | |
237 sprintfex(out_text, pGlobalTXT_LocalizationStrings[463], pItemsTable->pItems[inspect_item->uItemID].pUnidentifiedName); //"Type: %s" | |
238 out_text[100] = 0; | |
239 out_text[200] = 0; | |
240 switch (pItemsTable->pItems[inspect_item->uItemID].uEquipType) | |
241 { | |
1298 | 242 case EQUIP_OFF_HAND: |
243 case EQUIP_MAIN_HAND: | |
1699 | 244 sprintfex(out_text + 100, "%s: +%d %s: %dd%d", pGlobalTXT_LocalizationStrings[LOCSTR_ATTACK], |
245 (int)pItemsTable->pItems[inspect_item->uItemID].uDamageMod, pGlobalTXT_LocalizationStrings[53], | |
246 (int)pItemsTable->pItems[inspect_item->uItemID].uDamageDice, (int)pItemsTable->pItems[inspect_item->uItemID].uDamageRoll); //"Damage" | |
247 if (pItemsTable->pItems[inspect_item->uItemID].uDamageMod) | |
248 { | |
249 char mod[16]; | |
250 sprintf(mod, "+%d", (int)pItemsTable->pItems[inspect_item->uItemID].uDamageMod); | |
251 strcat(out_text + 100, mod); | |
252 } | |
253 break; | |
1298 | 254 |
255 case EQUIP_BOW: | |
1699 | 256 sprintfex(out_text + 100, "%s: +%d %s: %dd%d", pGlobalTXT_LocalizationStrings[203], //"Shoot" |
257 (int)pItemsTable->pItems[inspect_item->uItemID].uDamageMod, pGlobalTXT_LocalizationStrings[53], //"Damage" | |
258 (int)pItemsTable->pItems[inspect_item->uItemID].uDamageDice, (int)pItemsTable->pItems[inspect_item->uItemID].uDamageRoll); | |
259 if (pItemsTable->pItems[inspect_item->uItemID].uDamageMod) | |
260 { | |
261 char mod[16]; | |
262 sprintf(mod, "+%d", (int)pItemsTable->pItems[inspect_item->uItemID].uDamageMod); | |
263 strcat(out_text + 100, mod); | |
264 } | |
265 break; | |
1298 | 266 |
267 case EQUIP_ARMOUR: | |
268 case EQUIP_SHIELD: | |
269 case EQUIP_HELMET: | |
270 case EQUIP_BELT: | |
271 case EQUIP_CLOAK: | |
272 case EQUIP_GAUNTLETS: | |
273 case EQUIP_BOOTS: | |
274 case EQUIP_RING: | |
275 case EQUIP_AMULET: | |
1699 | 276 if (pItemsTable->pItems[inspect_item->uItemID].uDamageDice) //"Armor" |
277 sprintfex(out_text + 100, "%s: +%d", pGlobalTXT_LocalizationStrings[11], | |
278 pItemsTable->pItems[inspect_item->uItemID].uDamageDice + pItemsTable->pItems[inspect_item->uItemID].uDamageMod); | |
279 break; | |
280 } | |
1298 | 281 |
1699 | 282 if ( !v77 ) |
283 { | |
284 if (pItemsTable->pItems[inspect_item->uItemID].uEquipType ==EQUIP_POTION) //this is CORRECT! do not move to switch! | |
285 { | |
286 if ( inspect_item->uEnchantmentType ) | |
287 sprintf(out_text + 200, "%s: %d",pGlobalTXT_LocalizationStrings[449] , inspect_item->uEnchantmentType); //"Power" | |
288 } | |
289 else if (pItemsTable->pItems[inspect_item->uItemID].uEquipType == EQUIP_REAGENT) | |
290 sprintf(out_text + 200, "%s: %d", pGlobalTXT_LocalizationStrings[449], pItemsTable->pItems[inspect_item->uItemID].uDamageDice); //"Power" | |
291 else if ( inspect_item->uEnchantmentType ) | |
292 sprintf(out_text + 200, "%s: %s +%d", pGlobalTXT_LocalizationStrings[210], pItemsTable->pEnchantments[inspect_item->uEnchantmentType-1].pBonusStat, inspect_item->m_enchantmentStrength); //"Special" | |
293 else if ( inspect_item->uSpecEnchantmentType ) | |
294 sprintf(out_text + 200, "%s: %s", pGlobalTXT_LocalizationStrings[210], pItemsTable->pSpecialEnchantments[inspect_item->uSpecEnchantmentType-1].pBonusStatement, inspect_item->m_enchantmentStrength); | |
295 else if ( inspect_item->uNumCharges ) | |
296 sprintf(out_text + 200, "%s: %lu", pGlobalTXT_LocalizationStrings[464], inspect_item->uNumCharges); //"Charges" | |
297 } | |
298 iteminfo_window.uFrameWidth -= 12; | |
299 iteminfo_window.uFrameZ = iteminfo_window.uFrameX + iteminfo_window.uFrameWidth - 1; | |
300 iteminfo_window.uFrameW = iteminfo_window.uFrameY + iteminfo_window.uFrameHeight - 1; | |
301 Str = (char *)(3 * (LOBYTE(pFontArrus->uFontHeight) + 8)); | |
302 v84 = &out_text[0]; | |
303 for ( uint i = 1; i <= 3; i++ ) | |
304 { | |
305 if ( *v84 ) | |
306 Str += pFontComic->CalcTextHeight(v84, &iteminfo_window, 100, 0) + 3; | |
307 v84 += 100; | |
308 } | |
309 v28 = pItemsTable->pItems[inspect_item->uItemID].pDescription; | |
310 if ( *v28 ) | |
311 Str += pFontSmallnum->CalcTextHeight(pItemsTable->pItems[inspect_item->uItemID].pDescription, &iteminfo_window, 100, 0); | |
312 iteminfo_window.uFrameHeight = pIcons_LOD->LoadTexturePtr(pItemsTable->pItems[inspect_item->uItemID].pIconName, | |
313 TEXTURE_16BIT_PALETTE)->uTextureHeight + v81 + 54; | |
314 if ( (signed int)Str > (signed int)iteminfo_window.uFrameHeight ) | |
315 iteminfo_window.uFrameHeight = (unsigned int)Str; | |
316 if ( inspect_item->uAttributes & 8 && (inspect_item->uSpecEnchantmentType || inspect_item->uEnchantmentType) ) | |
317 iteminfo_window.uFrameHeight += LOBYTE(pFontComic->uFontHeight); | |
318 v85 = 0; | |
319 if ( pFontArrus->uFontHeight ) | |
320 { | |
321 iteminfo_window.uFrameWidth -= 24; | |
322 if ( pFontArrus->CalcTextHeight(inspect_item->GetIdentifiedName(), &iteminfo_window, 0, 0) / (signed int)pFontArrus->uFontHeight ) | |
323 v85 = pFontArrus->uFontHeight; | |
324 iteminfo_window.uFrameWidth += 24; | |
325 } | |
326 iteminfo_window.uFrameWidth += 12; | |
327 iteminfo_window.uFrameHeight += (unsigned int)v85; | |
328 iteminfo_window.uFrameW = iteminfo_window.uFrameY + iteminfo_window.uFrameHeight - 1; | |
329 iteminfo_window.uFrameZ = iteminfo_window.uFrameX + iteminfo_window.uFrameWidth - 1; | |
330 iteminfo_window.DrawMessageBox(0); | |
331 pRenderer->SetTextureClipRect(iteminfo_window.uFrameX + 12, iteminfo_window.uFrameY + 12, | |
332 iteminfo_window.uFrameX + iteminfo_window.uFrameWidth - 12, iteminfo_window.uFrameY + iteminfo_window.uFrameHeight - 12); | |
333 iteminfo_window.uFrameWidth -= 12; | |
334 iteminfo_window.uFrameHeight -= 12; | |
335 iteminfo_window.uFrameZ = iteminfo_window.uFrameX + iteminfo_window.uFrameWidth - 1; | |
336 iteminfo_window.uFrameW = iteminfo_window.uFrameY + iteminfo_window.uFrameHeight - 1; | |
337 pRenderer->DrawTextureTransparent(iteminfo_window.uFrameX + v78, | |
338 iteminfo_window.uFrameY + (signed int)(iteminfo_window.uFrameHeight - pIcons_LOD->LoadTexturePtr(pItemsTable->pItems[inspect_item->uItemID].pIconName, TEXTURE_16BIT_PALETTE)->uTextureHeight) / 2, | |
339 pIcons_LOD->LoadTexturePtr(pItemsTable->pItems[inspect_item->uItemID].pIconName, TEXTURE_16BIT_PALETTE)); | |
1298 | 340 |
1699 | 341 v34 = (int)(v85 + 35); |
342 Str = out_text; | |
343 for ( uint i = 1; i <= 3; i++ ) | |
344 { | |
345 if ( *Str ) | |
346 { | |
347 iteminfo_window.DrawText(pFontComic, 100, v34, 0, Str, 0, 0, 0); | |
348 v34 += pFontComic->CalcTextHeight(Str, &iteminfo_window, 100, 0) + 3; | |
1298 | 349 } |
1699 | 350 Str += 100; |
351 } | |
352 v28 = pItemsTable->pItems[inspect_item->uItemID].pDescription; | |
353 if ( *v28 ) | |
354 iteminfo_window.DrawText(pFontSmallnum, 100, v34, 0, v28, 0, 0, 0); | |
355 iteminfo_window.uFrameX += 12; | |
356 iteminfo_window.uFrameWidth -= 24; | |
357 iteminfo_window.DrawTitleText(pFontArrus, 0, 0xCu, TargetColor(0xFFu, 0xFFu, 0x9Bu), inspect_item->GetIdentifiedName(), 3); | |
358 iteminfo_window.uFrameWidth += 24; | |
359 iteminfo_window.uFrameX -= 12; | |
360 if ( v77 ) | |
361 { | |
362 sprintf(pTmpBuf.data(), "%s: %lu", pGlobalTXT_LocalizationStrings[465], v77);//"Value" | |
363 iteminfo_window.DrawText(pFontComic, 100, iteminfo_window.uFrameHeight - LOBYTE(pFontComic->uFontHeight), 0, pTmpBuf.data(), 0, 0, 0); | |
364 pRenderer->ResetTextureClipRect(); | |
365 } | |
366 else | |
367 { | |
368 if ( (inspect_item->uAttributes & 8) && (inspect_item->uSpecEnchantmentType || inspect_item->uEnchantmentType) ) | |
369 { | |
370 init_summoned_item(&v67, inspect_item->uExpireTime - pParty->uTimePlayed); | |
371 strcpy(pTmpBuf.data(), "Duration:"); | |
372 Str = (char *)(v67.field_18_expire_year - game_starting_year); | |
373 if (v67.field_18_expire_year != 1168 ) | |
374 { | |
375 sprintf(v65, " %d:yr", v67.field_18_expire_year - game_starting_year); | |
376 strcat(pTmpBuf.data(), v65); | |
377 } | |
378 if ( (((v67.field_14_exprie_month || Str) && | |
379 ((sprintf(v65, " %d:mo", v67.field_14_exprie_month), strcat(pTmpBuf.data(), v65), v67.field_14_exprie_month) || Str) | |
380 || v67.field_C_expire_day) | |
381 && ((sprintf(v65, " %d:dy", v67.field_C_expire_day), strcat(pTmpBuf.data(), v65), v67.field_14_exprie_month) || Str || | |
382 v67.field_C_expire_day) | |
383 || v67.field_8_expire_hour) | |
384 && ((sprintf(v65, " %d:hr", v67.field_8_expire_hour), strcat(pTmpBuf.data(), v65), v67.field_14_exprie_month) || Str || | |
385 v67.field_C_expire_day || v67.field_8_expire_hour) | |
386 || v67.field_4_expire_minute ) | |
387 { | |
388 sprintf(v65, " %d:mn", v67.field_4_expire_minute); | |
389 strcat(pTmpBuf.data(), v65); | |
390 } | |
391 iteminfo_window.DrawText(pFontComic, 100, iteminfo_window.uFrameHeight - 2 * LOBYTE(pFontComic->uFontHeight), 0, pTmpBuf.data(), 0, 0, 0); | |
392 } | |
393 sprintf(pTmpBuf.data(), "%s: %lu", pGlobalTXT_LocalizationStrings[465], inspect_item->GetValue()); | |
394 iteminfo_window.DrawText(pFontComic, 100, iteminfo_window.uFrameHeight - LOBYTE(pFontComic->uFontHeight), 0, pTmpBuf.data(), 0, 0, 0); | |
395 if ( BYTE1(inspect_item->uAttributes) & 1 ) | |
396 pText = pGlobalTXT_LocalizationStrings[187]; //"Stolen" | |
397 else | |
398 { | |
399 if ( !(BYTE1(inspect_item->uAttributes) & 2) ) | |
400 { | |
401 pRenderer->ResetTextureClipRect(); | |
402 if ( !areWeLoadingTexture ) | |
403 { | |
404 pIcons_LOD->LoadTexturePtr(pItemsTable->pItems[inspect_item->uItemID].pIconName, TEXTURE_16BIT_PALETTE)->Release(); | |
405 pIcons_LOD->SyncLoadedFilesCount(); | |
406 } | |
407 return; | |
408 } | |
409 pText = pGlobalTXT_LocalizationStrings[651]; //"Hardened" | |
410 } | |
411 LOWORD(inspect_item->uAttributes) = LOWORD(pRenderer->uTargetRMask); | |
412 iteminfo_window.DrawText(pFontComic, pFontComic->GetLineWidth(pTmpBuf.data()) + 132, | |
413 iteminfo_window.uFrameHeight - LOBYTE(pFontComic->uFontHeight), inspect_item->uAttributes, pText, 0, 0, 0); | |
414 pRenderer->ResetTextureClipRect(); | |
415 } | |
416 if ( !areWeLoadingTexture ) | |
417 { | |
418 pIcons_LOD->LoadTexturePtr(pItemsTable->pItems[inspect_item->uItemID].pIconName, TEXTURE_16BIT_PALETTE)->Release(); | |
419 pIcons_LOD->SyncLoadedFilesCount(); | |
420 } | |
421 return; | |
422 } | |
1298 | 423 // 4E455C: using guessed type int dword_4E455C; |
424 // 506128: using guessed type int areWeLoadingTexture; | |
425 | |
426 //----- (0041E360) -------------------------------------------------------- | |
1699 | 427 void MonsterPopup_Draw(unsigned int uActorID, GUIWindow *window) |
1298 | 428 { |
429 int v8; // eax@4 | |
430 unsigned __int16 v9; // dx@4 | |
431 SpriteFrame *v10; // edi@17 | |
432 unsigned int v18; // ecx@19 | |
433 unsigned int v19; // eax@21 | |
434 char *v20; // esi@28 | |
435 int v21; // edx@29 | |
436 unsigned __int16 *v22; // ecx@29 | |
437 int v23; // eax@29 | |
438 int v25; // esi@32 | |
439 char *v26; // edx@34 | |
440 unsigned __int8 v27; // sf@36 | |
441 unsigned __int8 v28; // of@36 | |
442 SpellBuff *v40; // eax@60 | |
1720 | 443 int skill_points; // edi@61 |
444 unsigned int skill_level; // eax@61 | |
1705 | 445 int pTextHeight; // edi@90 |
1720 | 446 PlayerSpeech speech; // [sp-8h] [bp-1F4h]@79 |
1298 | 447 DDBLTFX Dst; // [sp+Ch] [bp-1E0h]@18 |
448 DDSURFACEDESC2 pDesc; // [sp+70h] [bp-17Ch]@18 | |
449 RECT v84; // [sp+ECh] [bp-100h]@26 | |
1705 | 450 char *string_name[10]; // [sp+FCh] [bp-F0h]@145 |
451 char *content[11]; // [sp+124h] [bp-C8h]@127 | |
1298 | 452 RenderBillboardTransform_local0 v106; // [sp+150h] [bp-9Ch]@3 |
453 unsigned int v107; // [sp+1A0h] [bp-4Ch]@18 | |
454 unsigned __int16 *v108; // [sp+1A4h] [bp-48h]@34 | |
455 unsigned int v109; // [sp+1A8h] [bp-44h]@32 | |
456 LPVOID v110; // [sp+1ACh] [bp-40h]@28 | |
1720 | 457 bool for_effects; // [sp+1C0h] [bp-2Ch]@3 |
1705 | 458 bool normal_level; // [sp+1D0h] [bp-1Ch]@18 |
459 bool expert_level; // [sp+1C4h] [bp-28h]@18 | |
460 bool master_level; // [sp+1C8h] [bp-24h]@18 | |
461 bool grandmaster_level; // [sp+1B4h] [bp-38h]@3 | |
462 char *pText; // [sp+1D4h] [bp-18h]@18 | |
463 int pTextColorID; // [sp+1E4h] [bp-8h]@18 | |
1298 | 464 int a4; // [sp+1E8h] [bp-4h]@18 |
1720 | 465 int v115; |
1298 | 466 |
1720 | 467 bool monster_full_informations = false; |
1298 | 468 static Actor pMonsterInfoUI_Doll; |
469 /*if ( !(bMonsterInfoUI_bDollInitialized & 1) ) | |
470 { | |
471 bMonsterInfoUI_bDollInitialized |= 1u; | |
472 Actor::Actor(&pMonsterInfoUI_Doll); | |
473 atexit(nullsub_3); | |
474 }*/ | |
475 v106.uParentBillboardID = -1; | |
1699 | 476 v115 = monster_popup_y_offsets[((signed __int16)pActors[uActorID].pMonsterInfo.uID - 1) / 3] - 40; |
477 if ( pActors[uActorID].pMonsterInfo.uID == pMonsterInfoUI_Doll.pMonsterInfo.uID ) | |
1298 | 478 v9 = pMonsterInfoUI_Doll.uCurrentActionLength; |
479 else | |
480 { | |
1699 | 481 memcpy(&pMonsterInfoUI_Doll, &pActors[uActorID], sizeof(pMonsterInfoUI_Doll)); |
1298 | 482 pMonsterInfoUI_Doll.uCurrentActionAnimation = ANIM_Bored; |
483 pMonsterInfoUI_Doll.uCurrentActionTime = 0; | |
484 v8 = rand(); | |
485 v9 = v8 % 256 + 128; | |
486 pMonsterInfoUI_Doll.uCurrentActionLength = v8 % 256 + 128; | |
487 } | |
488 | |
489 if ( (signed int)pMonsterInfoUI_Doll.uCurrentActionTime > (signed __int16)v9 ) | |
490 { | |
491 pMonsterInfoUI_Doll.uCurrentActionTime = 0; | |
492 if ( pMonsterInfoUI_Doll.uCurrentActionAnimation == ANIM_Bored || pMonsterInfoUI_Doll.uCurrentActionAnimation == ANIM_AtkMelee) | |
493 { | |
494 pMonsterInfoUI_Doll.uCurrentActionAnimation = ANIM_Standing; | |
495 pMonsterInfoUI_Doll.uCurrentActionLength = rand() % 128 + 128; | |
496 } | |
497 else | |
498 { | |
499 //rand(); | |
500 pMonsterInfoUI_Doll.uCurrentActionAnimation = ANIM_Bored; | |
501 if ( (pMonsterInfoUI_Doll.pMonsterInfo.uID < 115 || pMonsterInfoUI_Doll.pMonsterInfo.uID > 186) && | |
502 (pMonsterInfoUI_Doll.pMonsterInfo.uID < 232 || pMonsterInfoUI_Doll.pMonsterInfo.uID > 249) && rand() % 30 < 100 ) | |
503 pMonsterInfoUI_Doll.uCurrentActionAnimation = ANIM_AtkMelee; | |
1699 | 504 pMonsterInfoUI_Doll.uCurrentActionLength = 8 * pSpriteFrameTable->pSpriteSFrames[pActors[uActorID].pSpriteIDs[(signed __int16)pMonsterInfoUI_Doll.uCurrentActionAnimation]].uAnimLength; |
1298 | 505 } |
506 } | |
1699 | 507 v10 = pSpriteFrameTable->GetFrame( pActors[uActorID].pSpriteIDs[pMonsterInfoUI_Doll.uCurrentActionAnimation], pMonsterInfoUI_Doll.uCurrentActionTime); |
1298 | 508 v106.pTarget = pRenderer->pTargetSurface; |
509 v106.pTargetZ = pRenderer->pActiveZBuffer; | |
510 v106.uTargetPitch = pRenderer->uTargetSurfacePitch; | |
1699 | 511 v106.uViewportX = window->uFrameX + 13; |
512 v106.uViewportY = window->uFrameY + 52; | |
513 v106.uViewportW = (window->uFrameY + 52) + 128; | |
1298 | 514 v106.uViewportZ = v106.uViewportX + 128; |
515 v106.uScreenSpaceX = (signed int)(v106.uViewportX + 128 + v106.uViewportX) / 2; | |
516 v106._screenspace_x_scaler_packedfloat = 65536; | |
517 v106._screenspace_y_scaler_packedfloat = 65536; | |
1699 | 518 v106.uScreenSpaceY = v115 + (window->uFrameY + 52) + pSprites_LOD->pSpriteHeaders[v10->pHwSpriteIDs[0]].uHeight; |
1298 | 519 v106.pPalette = PaletteManager::Get_Dark_or_Red_LUT(v10->uPaletteIndex, 0, 1); |
520 v106.sZValue = 0; | |
521 v106.uFlags = 0; | |
522 pRenderer->SetRasterClipRect(0, 0, 0x27Fu, 0x1DFu); | |
1699 | 523 pRenderer->RasterLine2D(v106.uViewportX - 1, v106.uViewportY - 1, v106.uViewportX + 129, v106.uViewportY - 1, TargetColor(0xE1u, 255, 0x9Bu)); |
524 pRenderer->RasterLine2D( v106.uViewportX + 129, v106.uViewportY - 1, v106.uViewportX + 129, v106.uViewportW + 1, TargetColor(0xE1u, 255, 0x9Bu)); | |
525 pRenderer->RasterLine2D(v106.uViewportX + 129, v106.uViewportW + 1, v106.uViewportX - 1, v106.uViewportW + 1, TargetColor(0xE1u, 255, 0x9Bu)); | |
526 pRenderer->RasterLine2D(v106.uViewportX - 1, v106.uViewportW + 1, v106.uViewportX - 1, v106.uViewportY - 1, TargetColor(0xE1u, 255, 0x9Bu)); | |
1298 | 527 if ( pRenderer->pRenderD3D ) |
528 { | |
1699 | 529 v106.uScreenSpaceY = v115 + v106.uViewportY + pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uBufferHeight; |
1298 | 530 memset(&Dst, 0, 0x64u); |
531 Dst.dwSize = 100; | |
532 Dst.dwFillColor = 0; | |
533 memset(&pDesc, 0, 0x7Cu); | |
534 pDesc.dwSize = 124; | |
1699 | 535 pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].pTextureSurface->GetSurfaceDesc(&pDesc); |
1298 | 536 v107 = 0; |
1705 | 537 uint i = 0; |
1699 | 538 int dst_x = v106.uScreenSpaceX + pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uAreaX - pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uBufferWidth / 2; |
539 int dst_y = v106.uScreenSpaceY + pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uAreaY - pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uBufferHeight; | |
540 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; | |
541 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 | 542 if (dst_x < v106.uViewportX) |
543 { | |
544 v18 = v106.uViewportX - dst_x; | |
545 dst_x = v106.uViewportX; | |
546 v107 = v18; | |
547 } | |
548 if (dst_y < v106.uViewportY) | |
549 { | |
550 v19 = v106.uViewportY - dst_y; | |
551 dst_y = v106.uViewportY; | |
552 i = v19; | |
553 } | |
554 if (dst_z > v106.uViewportZ) | |
555 dst_z = v106.uViewportZ; | |
556 if (dst_w > v106.uViewportW) | |
557 dst_w = v106.uViewportW; | |
558 pRenderer->FillRectFast(v106.uViewportX, v106.uViewportY, v106.uViewportZ - v106.uViewportX, v106.uViewportW - v106.uViewportY, pRenderer->uTargetBMask | pRenderer->uTargetGMask); | |
559 pRenderer->FillRectFast(v106.uViewportX, v106.uViewportY, v106.uViewportZ - v106.uViewportX, v106.uViewportW - v106.uViewportY, pRenderer->uTargetBMask | pRenderer->uTargetGMask); | |
560 v84.left = v106.uViewportX; | |
561 v84.top = v106.uViewportY; | |
562 v84.right = v106.uViewportZ; | |
563 v84.bottom = v106.uViewportW; | |
564 ErrD3D(pRenderer->pBackBuffer4->Blt(&v84, 0, 0, 16778240u, &Dst)); | |
565 if ( pRenderer->uTargetGBits == 5 ) | |
566 { | |
567 __debugbreak(); // no monster popup for r5g5b5 yet | |
568 memset(&pDesc, 0, 0x7Cu); | |
569 pDesc.dwSize = 124; | |
1699 | 570 if ( pRenderer->LockSurface_DDraw4(pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].pTextureSurface, &pDesc, DDLOCK_WAIT)) |
571 { | |
572 v20 = (char *)dst_y; | |
573 v110 = pDesc.lpSurface; | |
574 if (dst_y < dst_w) | |
575 { | |
576 v21 = dst_x; | |
577 v22 = &pRenderer->pTargetSurface[dst_y * pRenderer->uTargetSurfacePitch + dst_x]; | |
578 auto _v22_2 = v22; | |
579 v23 = i - dst_y; | |
580 v115 = i - dst_y; | |
581 while ( 1 ) | |
582 { | |
583 dst_y = v21; | |
584 if ( v21 < dst_z ) | |
585 { | |
586 v25 = v107 - v21; | |
587 v109 = (int)&v20[v23]; | |
588 for ( i = v107 - v21; ; v25 = i ) | |
589 { | |
590 v108 = (unsigned __int16 *)((pDesc.lPitch >> 1) * pDesc.dwHeight * v109 / pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uAreaHeight); | |
591 v26 = (char *)v108 + pDesc.dwWidth * (v25 + dst_y++) / pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uAreaWidth; | |
592 *v22 = *((short *)v110 + (int)v26); | |
593 ++v22; | |
594 if ( dst_y >= dst_z ) | |
595 break; | |
596 } | |
597 v23 = v115; | |
598 } | |
599 v22 = (unsigned __int16 *)((char *)_v22_2 + 2 * pRenderer->uTargetSurfacePitch); | |
600 _v22_2 = v22; | |
601 v20 = (char *)(dst_y + 1); | |
602 v28 = __OFSUB__(dst_y + 1, dst_w); | |
603 v27 = (signed int)(dst_y++ + 1 - dst_w) < 0; | |
604 if ( !(v27 ^ v28) ) | |
605 break; | |
606 v21 = dst_x; | |
607 } | |
608 } | |
609 pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].pTextureSurface->Unlock(0); | |
610 } | |
1298 | 611 } |
1699 | 612 else |
613 { | |
614 memset(&pDesc, 0, 0x7Cu); | |
615 pDesc.dwSize = 124; | |
616 if ( pRenderer->LockSurface_DDraw4(pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].pTextureSurface, &pDesc, DDLOCK_WAIT) ) | |
617 { | |
618 auto src = (unsigned __int16 *)pDesc.lpSurface; | |
619 uint num_top_scanlines_above_frame_y = i - dst_y; | |
620 for (uint y = dst_y; y < dst_w; ++y) | |
621 { | |
622 auto dst = &pRenderer->pTargetSurface[y * pRenderer->uTargetSurfacePitch + dst_x]; | |
1298 | 623 |
1699 | 624 uint src_y = num_top_scanlines_above_frame_y + y; |
625 for (uint x = dst_x; x < dst_z; ++x) | |
626 { | |
627 uint src_x = v107 - dst_x + x; // num scanlines left to frame_x + current x | |
1298 | 628 |
1699 | 629 uint idx = pDesc.dwHeight * src_y / pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uAreaHeight * (pDesc.lPitch / sizeof(short)) + |
630 pDesc.dwWidth * src_x / pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uAreaWidth; | |
631 uint b = src[idx] & 0x1F; | |
632 *dst++ = b | 2 * (src[idx] & 0xFFE0); | |
633 } | |
634 } | |
635 pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].pTextureSurface->Unlock(0); | |
636 } | |
637 } | |
1298 | 638 } |
639 else | |
640 { | |
641 pRenderer->FillRectFast(v106.uViewportX, v106.uViewportY, v106.uViewportZ - v106.uViewportX, v106.uViewportW - v106.uViewportY, 0); | |
1699 | 642 if ( v10->pHwSpriteIDs[0] >= 0 ) |
643 pSprites_LOD->pSpriteHeaders[v10->pHwSpriteIDs[0]].DrawSprite_sw(&v106, 0); | |
1298 | 644 } |
1705 | 645 //name and profession |
1699 | 646 if ( pActors[uActorID].sNPC_ID ) |
1298 | 647 { |
1699 | 648 if (GetNPCData(pActors[uActorID].sNPC_ID)->uProfession) |
649 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 | |
650 else | |
1705 | 651 strncpy(pTmpBuf.data(), GetNPCData(pActors[uActorID].sNPC_ID)->pName, 2000); |
1298 | 652 } |
653 else | |
654 { | |
1699 | 655 if ( pActors[uActorID].dword_000334_unique_name ) |
1705 | 656 strncpy(pTmpBuf.data(), pMonsterStats->pPlaceStrings[pActors[uActorID].dword_000334_unique_name], 2000); |
1298 | 657 else |
1705 | 658 strncpy(pTmpBuf.data(), pMonsterStats->pInfos[pActors[uActorID].pMonsterInfo.uID].pName, 2000); |
1298 | 659 } |
1699 | 660 window->DrawTitleText(pFontComic, 0, 0xCu, TargetColor(0xFFu, 0xFFu, 0x9Bu), pTmpBuf.data(), 3); |
1705 | 661 //health bar |
1699 | 662 Actor::DrawHealthBar(&pActors[uActorID], window); |
1705 | 663 |
664 normal_level = 0; | |
665 expert_level = 0; | |
666 master_level = 0; | |
667 grandmaster_level = 0; | |
1720 | 668 for_effects = 0; |
1298 | 669 pMonsterInfoUI_Doll.uCurrentActionTime += pMiscTimer->uTimeElapsed; |
1720 | 670 if ( pPlayers[uActiveCharacter]->GetActualSkillLevel(PLAYER_SKILL_MONSTER_ID) ) |
1298 | 671 { |
1720 | 672 skill_points = (unsigned __int8)pPlayers[uActiveCharacter]->GetActualSkillLevel(PLAYER_SKILL_MONSTER_ID) & 0x3F; |
673 skill_level = SkillToMastery(pPlayers[uActiveCharacter]->GetActualSkillLevel(PLAYER_SKILL_MONSTER_ID)) - 1; | |
674 if ( skill_level == 0 )//(normal) | |
1699 | 675 { |
1720 | 676 if ( skill_points + 10 >= pActors[uActorID].pMonsterInfo.uLevel ) |
677 normal_level = 1; | |
678 } | |
679 else if ( skill_level == 1 )//(expert) | |
680 { | |
681 if ( 2 * skill_points + 10 >= pActors[uActorID].pMonsterInfo.uLevel ) | |
1699 | 682 { |
1720 | 683 normal_level = 1; |
684 expert_level = 1; | |
1699 | 685 } |
686 } | |
1720 | 687 else if ( skill_level == 2 )//(master) |
1699 | 688 { |
1720 | 689 if ( 3 * skill_points + 10 >= pActors[uActorID].pMonsterInfo.uLevel ) |
1699 | 690 { |
1720 | 691 normal_level = 1; |
692 expert_level = 1; | |
693 master_level = 1; | |
1699 | 694 } |
1720 | 695 } |
696 else if ( skill_level == 3 )//grandmaster | |
697 { | |
698 normal_level = 1; | |
699 expert_level = 1; | |
700 master_level = 1; | |
701 grandmaster_level = 1; | |
1699 | 702 } |
1298 | 703 } |
1720 | 704 if ( pActors[uActorID].uAIState != Dead |
705 && pActors[uActorID].uAIState != Dying | |
706 && !dword_507BF0_is_there_popup_onscreen && pPlayers[uActiveCharacter]->GetActualSkillLevel(PLAYER_SKILL_MONSTER_ID) ) | |
707 { | |
708 if ( normal_level | expert_level | master_level | grandmaster_level ) | |
709 { | |
710 if ( pActors[uActorID].pMonsterInfo.uLevel >= pPlayers[uActiveCharacter]->uLevel - 5 ) | |
711 speech = SPEECH_IDENTIFY_MONSTER_STRONGER; | |
712 else | |
713 speech = SPEECH_IDENTIFY_MONSTER_WEAKER; | |
714 } | |
715 else | |
716 speech = SPEECH_IDENTIFY_MONSTER_106; | |
717 pPlayers[uActiveCharacter]->PlaySound(speech, 0); | |
718 } | |
1298 | 719 |
1720 | 720 if ( (signed int)SkillToMastery(pParty->pPlayers[uActiveCharacter - 1].GetActualSkillLevel(PLAYER_SKILL_MONSTER_ID)) >= 3 ) |
721 for_effects = 1; | |
1705 | 722 |
723 if ( monster_full_informations == true ) | |
1298 | 724 { |
1705 | 725 normal_level = 1;// |
726 expert_level = 1;// | |
727 master_level = 1;// | |
728 grandmaster_level = 1;// | |
1720 | 729 for_effects = 1; |
1298 | 730 } |
731 | |
1705 | 732 window->DrawText(pFontSmallnum, 12, 196, TargetColor(0xE1u, 255, 0x9Bu), pGlobalTXT_LocalizationStrings[631], 0, 0, 0);//Effects |
1720 | 733 if ( !for_effects ) |
1705 | 734 window->DrawText(pFontSmallnum, 28, LOBYTE(pFontSmallnum->uFontHeight) + 193, TargetColor(0xE1u, 255, 0x9Bu), pGlobalTXT_LocalizationStrings[630], 0, 0, 0);//? |
1298 | 735 else |
736 { | |
1705 | 737 pText = ""; |
738 pTextHeight = LOBYTE(pFontSmallnum->uFontHeight) + 193; | |
739 for ( uint i = 1; i <= 21; ++i ) | |
740 { | |
741 if ( pActors[uActorID].pActorBuffs[i].uExpireTime > 0 ) | |
742 { | |
743 switch ( i - 1 ) | |
744 { | |
745 case 0: | |
746 pTextColorID = 60; | |
747 pText = pGlobalTXT_LocalizationStrings[591];//Charmed | |
748 break; | |
749 case 1: | |
750 pTextColorID = 82; | |
751 pText = pGlobalTXT_LocalizationStrings[649];//Summoned | |
752 break; | |
753 case 2: | |
754 pTextColorID = 92; | |
755 pText = pGlobalTXT_LocalizationStrings[592];//Shrunk | |
756 break; | |
757 case 3: | |
758 pTextColorID = 63; | |
759 pText = pGlobalTXT_LocalizationStrings[4];//Afraid | |
760 break; | |
761 case 4: | |
762 pText = pGlobalTXT_LocalizationStrings[220];//Stoned | |
763 pTextColorID = 81; | |
764 break; | |
765 case 5: | |
766 pText = pGlobalTXT_LocalizationStrings[162];//Paralyzed | |
767 pTextColorID = 81; | |
768 break; | |
769 case 6: | |
770 pText = pGlobalTXT_LocalizationStrings[593];//Slowed | |
771 pTextColorID = 35; | |
772 break; | |
773 case 8: | |
774 pText = pGlobalTXT_LocalizationStrings[608];//Berserk | |
775 pTextColorID = 62; | |
776 break; | |
777 case 7: | |
778 case 9: | |
779 pText = ""; | |
780 pTextColorID = 0; | |
781 continue; | |
782 case 10: | |
783 pTextColorID = 47; | |
784 pText = pGlobalTXT_LocalizationStrings[221];//Fate | |
785 break; | |
786 case 11: | |
787 pTextColorID = 66; | |
788 pText = pGlobalTXT_LocalizationStrings[607];//Enslaved | |
789 break; | |
790 case 12: | |
791 pTextColorID = 85; | |
792 pText = pGlobalTXT_LocalizationStrings[610];//Day of Protection | |
793 break; | |
794 case 13: | |
795 pTextColorID = 86; | |
796 pText = pGlobalTXT_LocalizationStrings[609];//Hour of Power | |
797 break; | |
798 case 14: | |
799 pTextColorID = 17; | |
800 pText = pGlobalTXT_LocalizationStrings[279];//Shield | |
801 break; | |
802 case 15: | |
803 pTextColorID = 38; | |
804 pText = pGlobalTXT_LocalizationStrings[442];//Stoneskin | |
805 break; | |
806 case 16: | |
807 pTextColorID = 46; | |
808 pText = pGlobalTXT_LocalizationStrings[443];//Bless | |
809 break; | |
810 case 17: | |
811 pTextColorID = 51; | |
812 pText = pGlobalTXT_LocalizationStrings[440];//Heroism | |
813 break; | |
814 case 18: | |
815 pTextColorID = 5; | |
816 pText = pGlobalTXT_LocalizationStrings[441];//Haste | |
817 break; | |
818 case 19: | |
819 pTextColorID = 95; | |
820 pText = pGlobalTXT_LocalizationStrings[229];//Pain Reflection | |
821 break; | |
822 case 20: | |
823 pTextColorID = 73; | |
824 pText = pGlobalTXT_LocalizationStrings[228];//Hammerhands | |
825 break; | |
826 default: | |
827 pText = ""; | |
828 break; | |
829 } | |
830 if ( pText != "" ) | |
831 { | |
832 window->DrawText(pFontSmallnum, 28, pTextHeight, GetSpellColor(pTextColorID), pText, 0, 0, 0); | |
833 pTextHeight = pTextHeight + *(char *)((int)pFontSmallnum + 5) - 3; | |
834 } | |
835 } | |
836 } | |
837 if ( pText == "" ) | |
838 window->DrawText(pFontSmallnum, 28, pTextHeight, TargetColor(0xE1u, 255, 0x9Bu), pGlobalTXT_LocalizationStrings[153], 0, 0, 0);//Нет | |
839 } | |
1298 | 840 |
1705 | 841 if ( normal_level ) |
1298 | 842 { |
1699 | 843 sprintf(pTmpBuf.data(), "%s\f%05u\t100%d\n", pGlobalTXT_LocalizationStrings[108], 0, pActors[uActorID].pMonsterInfo.uHP); |
1705 | 844 window->DrawText(pFontSmallnum, 150, (int)v106.uViewportY, TargetColor(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0); |
845 pTextHeight = v106.uViewportY + LOBYTE(pFontSmallnum->uFontHeight) - 3; | |
846 sprintf(pTmpBuf.data(), "%s\f%05u\t100%d\n", pGlobalTXT_LocalizationStrings[12], 0, pActors[uActorID].pMonsterInfo.uAC);//Armor Class | |
1298 | 847 } |
848 else | |
849 { | |
1705 | 850 sprintf(pTmpBuf.data(), "%s\f%05u\t100%s\n", pGlobalTXT_LocalizationStrings[108], 0, pGlobalTXT_LocalizationStrings[630]);//? |
851 window->DrawText(pFontSmallnum, 150, (int)v106.uViewportY, TargetColor(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0); | |
852 pTextHeight = v106.uViewportY + LOBYTE(pFontSmallnum->uFontHeight) - 3; | |
853 sprintf(pTmpBuf.data(), "%s\f%05u\t100%s\n", pGlobalTXT_LocalizationStrings[12], 0, (unsigned int)pGlobalTXT_LocalizationStrings[630]);//? | |
1298 | 854 } |
1705 | 855 window->DrawText(pFontSmallnum, 150, pTextHeight, TargetColor(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0); |
856 pTextHeight = pTextHeight + LOBYTE(pFontSmallnum->uFontHeight) - 6 + LOBYTE(pFontSmallnum->uFontHeight); | |
857 | |
858 content[0] = pGlobalTXT_LocalizationStrings[87]; | |
859 content[1] = pGlobalTXT_LocalizationStrings[6]; | |
860 content[2] = pGlobalTXT_LocalizationStrings[240]; | |
861 content[3] = pGlobalTXT_LocalizationStrings[70]; | |
862 content[4] = pGlobalTXT_LocalizationStrings[624]; | |
863 content[5] = pGlobalTXT_LocalizationStrings[138]; | |
864 content[6] = pGlobalTXT_LocalizationStrings[214]; | |
865 content[7] = pGlobalTXT_LocalizationStrings[142]; | |
866 content[8] = pGlobalTXT_LocalizationStrings[29]; | |
867 content[9] = pGlobalTXT_LocalizationStrings[133]; | |
868 content[10] = pGlobalTXT_LocalizationStrings[54]; | |
869 | |
870 if ( expert_level ) | |
1298 | 871 { |
1705 | 872 sprintf(pTmpBuf.data(), "%s\f%05u\t080%s\n", pGlobalTXT_LocalizationStrings[18], 0, content[pActors[uActorID].pMonsterInfo.uAttack1Type]);//Attack |
873 window->DrawText(pFontSmallnum, 150, (int)pTextHeight, TargetColor(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0); | |
874 pTextHeight = pTextHeight + LOBYTE(pFontSmallnum->uFontHeight) - 3; | |
875 if ( pActors[uActorID].pMonsterInfo.uAttack1DamageBonus ) | |
1298 | 876 sprintf(pTmpBuf.data(), "%s\f%05u\t080%dd%d+%d\n", pGlobalTXT_LocalizationStrings[53], |
1705 | 877 0, pActors[uActorID].pMonsterInfo.uAttack1DamageDiceRolls, pActors[uActorID].pMonsterInfo.uAttack1DamageDiceSides, pActors[uActorID].pMonsterInfo.uAttack1DamageBonus); |
1298 | 878 else |
879 sprintf(pTmpBuf.data(), "%s\f%05u\t080%dd%d\n", pGlobalTXT_LocalizationStrings[53], | |
1699 | 880 0, pActors[uActorID].pMonsterInfo.uAttack1DamageDiceRolls, pActors[uActorID].pMonsterInfo.uAttack1DamageDiceSides); |
1298 | 881 } |
882 else | |
883 { | |
884 sprintf(pTmpBuf.data(), "%s\f%05u\t080%s\n", pGlobalTXT_LocalizationStrings[18], 0, pGlobalTXT_LocalizationStrings[630]); | |
1705 | 885 window->DrawText(pFontSmallnum, 150, (int)pTextHeight, TargetColor(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0); |
886 pTextHeight = pTextHeight + LOBYTE(pFontSmallnum->uFontHeight) - 3; | |
1298 | 887 sprintf(pTmpBuf.data(), "%s\f%05u\t080%s\n", pGlobalTXT_LocalizationStrings[53], 0, pGlobalTXT_LocalizationStrings[630]); |
888 } | |
1705 | 889 window->DrawText(pFontSmallnum, 150, pTextHeight, TargetColor(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0); |
890 pTextHeight = pTextHeight + LOBYTE(pFontSmallnum->uFontHeight) - 6 + LOBYTE(pFontSmallnum->uFontHeight); | |
891 | |
892 if ( !master_level ) | |
1298 | 893 { |
1705 | 894 sprintf(pTmpBuf.data(), "%s\f%05u\t080%s\n", pGlobalTXT_LocalizationStrings[628], 0, pGlobalTXT_LocalizationStrings[630]);//"Spell" "?" |
895 window->DrawText(pFontSmallnum, 150, (int)pTextHeight, TargetColor(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0); | |
896 pTextHeight = pTextHeight + LOBYTE(pFontSmallnum->uFontHeight) - 3; | |
1298 | 897 } |
898 else | |
899 { | |
1705 | 900 pText = pGlobalTXT_LocalizationStrings[628];//Spell |
901 if ( pActors[uActorID].pMonsterInfo.uSpell1ID && pActors[uActorID].pMonsterInfo.uSpell2ID ) | |
902 pText = pGlobalTXT_LocalizationStrings[629];//Spells | |
903 if ( pActors[uActorID].pMonsterInfo.uSpell1ID ) | |
904 { | |
1718 | 905 sprintf(pTmpBuf.data(), "%s\f%05u\t070%s\n", pText, 0, pSpellStats->pInfos[pActors[uActorID].pMonsterInfo.uSpell1ID].pShortName);//"%s\f%05u\t060%s\n" |
1705 | 906 window->DrawText(pFontSmallnum, 150, (int)pTextHeight, TargetColor(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0); |
907 pTextHeight = pTextHeight + LOBYTE(pFontSmallnum->uFontHeight) - 3; | |
908 } | |
909 if ( pActors[uActorID].pMonsterInfo.uSpell2ID ) | |
910 { | |
1718 | 911 sprintf(pTmpBuf.data(), "\f%05u\t070%s\n", 0, pSpellStats->pInfos[pActors[uActorID].pMonsterInfo.uSpell2ID].pShortName);//"%s\f%05u\t060%s\n" |
1705 | 912 window->DrawText(pFontSmallnum, 150, (int)pTextHeight, TargetColor(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0); |
913 pTextHeight = pTextHeight + LOBYTE(pFontSmallnum->uFontHeight) - 3; | |
914 } | |
915 if ( !pActors[uActorID].pMonsterInfo.uSpell1ID && !pActors[uActorID].pMonsterInfo.uSpell2ID ) | |
916 { | |
1718 | 917 sprintf(pTmpBuf.data(), "%s\f%05u\t070%s\n", pGlobalTXT_LocalizationStrings[628], 0, pGlobalTXT_LocalizationStrings[153]);//"%s\f%05u\t060%s\n" |
1705 | 918 window->DrawText(pFontSmallnum, 150, (int)pTextHeight, TargetColor(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0); |
919 pTextHeight = pTextHeight + LOBYTE(pFontSmallnum->uFontHeight) - 3; | |
920 } | |
1298 | 921 } |
1705 | 922 pTextHeight = pTextHeight + LOBYTE(pFontSmallnum->uFontHeight) - 3; |
923 window->DrawText(pFontSmallnum, 150, pTextHeight, TargetColor(0xE1u, 255, 0x9Bu), pGlobalTXT_LocalizationStrings[626], 0, 0, 0);//Immune | |
924 pTextHeight = pTextHeight + LOBYTE(pFontSmallnum->uFontHeight) - 3; | |
925 | |
926 string_name[0] = pGlobalTXT_LocalizationStrings[87];//Fire | |
927 string_name[1] = pGlobalTXT_LocalizationStrings[6];//Air | |
928 string_name[2] = pGlobalTXT_LocalizationStrings[240]; | |
929 string_name[3] = pGlobalTXT_LocalizationStrings[70]; | |
930 string_name[4] = pGlobalTXT_LocalizationStrings[142]; | |
931 string_name[5] = pGlobalTXT_LocalizationStrings[214]; | |
932 string_name[6] = pGlobalTXT_LocalizationStrings[29]; | |
933 string_name[7] = pGlobalTXT_LocalizationStrings[133]; | |
934 string_name[8] = pGlobalTXT_LocalizationStrings[54]; | |
935 string_name[9] = pGlobalTXT_LocalizationStrings[624]; | |
936 | |
937 content[0] = (char *)pActors[uActorID].pMonsterInfo.uResFire; | |
938 content[1] = (char *)pActors[uActorID].pMonsterInfo.uResAir; | |
939 content[2] = (char *)pActors[uActorID].pMonsterInfo.uResWater; | |
940 content[3] = (char *)pActors[uActorID].pMonsterInfo.uResEarth; | |
941 content[4] = (char *)pActors[uActorID].pMonsterInfo.uResMind; | |
942 content[5] = (char *)pActors[uActorID].pMonsterInfo.uResSpirit; | |
943 content[6] = (char *)pActors[uActorID].pMonsterInfo.uResBody; | |
944 content[7] = (char *)pActors[uActorID].pMonsterInfo.uResLight; | |
945 content[8] = (char *)pActors[uActorID].pMonsterInfo.uResPhysical; | |
946 content[9] = (char *)pActors[uActorID].pMonsterInfo.uResDark; | |
947 | |
948 if ( grandmaster_level ) | |
1298 | 949 { |
1705 | 950 for ( uint i = 0; i < 10; i++ ) |
1298 | 951 { |
1705 | 952 if ( content[i] == (char *)200 ) |
1298 | 953 { |
1705 | 954 pText = pGlobalTXT_LocalizationStrings[625];//Immune |
1298 | 955 } |
956 else | |
957 { | |
1705 | 958 if ( content[i] ) |
959 pText = pGlobalTXT_LocalizationStrings[627];//Resistant | |
1298 | 960 else |
1705 | 961 pText = pGlobalTXT_LocalizationStrings[153];//None |
1298 | 962 } |
1705 | 963 sprintf(pTmpBuf.data(), "%s\f%05u\t070%s\n", string_name[i], 0, pText); |
964 window->DrawText(pFontSmallnum, 170, pTextHeight, TargetColor(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0); | |
965 pTextHeight = pTextHeight + LOBYTE(pFontSmallnum->uFontHeight) - 3; | |
1298 | 966 } |
967 } | |
968 else | |
969 { | |
1705 | 970 for ( uint i = 0; i < 10; ++i ) |
1298 | 971 { |
1705 | 972 sprintf(pTmpBuf.data(), "%s\f%05u\t070%s\n", string_name[i], 0, pGlobalTXT_LocalizationStrings[630]); // "?" |
973 window->DrawText(pFontSmallnum, 170, pTextHeight, TargetColor(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0); | |
974 pTextHeight = pTextHeight + LOBYTE(pFontSmallnum->uFontHeight) - 3; | |
1298 | 975 } |
976 } | |
1720 | 977 //cast spell: Detect life |
1298 | 978 if ( (signed __int64)pParty->pPartyBuffs[PARTY_BUFF_DETECT_LIFE].uExpireTime > 0 ) |
979 { | |
1705 | 980 sprintf(pTmpBuf.data(), "%s: %d", pGlobalTXT_LocalizationStrings[650], pActors[uActorID].sCurrentHP);//Current Hit Points |
1298 | 981 pFontSmallnum->GetLineWidth(pTmpBuf.data()); |
1699 | 982 window->DrawTitleText(pFontSmallnum, 0, window->uFrameHeight - LOBYTE(pFontSmallnum->uFontHeight) - 12, 0, pTmpBuf.data(), 3); |
1298 | 983 } |
984 } | |
985 | |
986 //----- (00417BB5) -------------------------------------------------------- | |
987 const char *CharacterUI_GetSkillDescText(unsigned int uPlayerID, PLAYER_SKILL_TYPE uPlayerSkillType) | |
988 { | |
1720 | 989 char a2[1200]; // [sp+Ch] [bp-538h]@7 |
990 char Source[120]; // [sp+4BCh] [bp-88h]@7 | |
991 int v35; // [sp+53Ch] [bp-8h]@1 | |
992 | |
993 v35 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[431]);// Normal | |
994 if ( pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[433]) > (signed int)v35 ) | |
995 v35 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[433]);// Expert | |
996 if ( pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[432]) > (signed int)v35 ) | |
997 v35 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[432]);// Master | |
998 if ( pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[96]) > (signed int)v35 ) | |
999 v35 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[96]);// Grand | |
1298 | 1000 |
1720 | 1001 a2[0] = 0; |
1002 Source[0] = 0; | |
1003 strcpy(a2, "%s\n\n"); | |
1004 sprintf(Source, "\f%05d", GetSkillColor(pParty->pPlayers[uPlayerID].classType, uPlayerSkillType, 1)); | |
1005 strcat(a2, Source); | |
1006 strcat(a2, "%s\t%03d:\t%03d%s\t000\n"); | |
1007 sprintf(Source, "\f%05d", GetSkillColor(pParty->pPlayers[uPlayerID].classType, uPlayerSkillType, 2)); | |
1008 strcat(a2, Source); | |
1009 strcat(a2, "%s\t%03d:\t%03d%s\t000\n"); | |
1010 sprintf(Source, "\f%05d", GetSkillColor(pParty->pPlayers[uPlayerID].classType, uPlayerSkillType, 3)); | |
1011 strcat(a2, Source); | |
1012 strcat(a2, "%s\t%03d:\t%03d%s\t000\n"); | |
1013 sprintf(Source, "\f%05d", GetSkillColor(pParty->pPlayers[uPlayerID].classType, uPlayerSkillType, 4)); | |
1014 strcat(a2, Source); | |
1015 strcat(a2, "%s\t%03d:\t%03d%s\t000\n"); | |
1016 if ( (pParty->pPlayers[uPlayerID].pActiveSkills[uPlayerSkillType] & 0x3F) == (pParty->pPlayers[uPlayerID].GetActualSkillLevel(uPlayerSkillType) & 0x3F) ) | |
1017 { | |
1018 sprintf(static_sub_417BB5_out_string, a2, pSkillDesc[uPlayerSkillType], | |
1019 pGlobalTXT_LocalizationStrings[431], v35 + 3, v35 + 5, pNormalSkillDesc[uPlayerSkillType], // Normal | |
1020 pGlobalTXT_LocalizationStrings[433], v35 + 3, v35 + 5, pExpertSkillDesc[uPlayerSkillType], // Expert | |
1021 pGlobalTXT_LocalizationStrings[432], v35 + 3, v35 + 5, pMasterSkillDesc[uPlayerSkillType], // Master | |
1022 pGlobalTXT_LocalizationStrings[96], v35 + 3, v35 + 5, pGrandSkillDesc[uPlayerSkillType]); // Grand | |
1023 } | |
1024 else | |
1025 { | |
1026 sprintf(Source, "\f%05d", TargetColor(0xFFu, 0xFFu, 0xFFu)); | |
1027 strcat(a2, Source); | |
1028 strcat(a2, "%s: +%d"); | |
1029 sprintf(static_sub_417BB5_out_string, a2, pSkillDesc[uPlayerSkillType], | |
1030 pGlobalTXT_LocalizationStrings[431], v35 + 3, v35 + 5, pNormalSkillDesc[uPlayerSkillType], | |
1031 pGlobalTXT_LocalizationStrings[433], v35 + 3, v35 + 5, pExpertSkillDesc[uPlayerSkillType], | |
1032 pGlobalTXT_LocalizationStrings[432], v35 + 3, v35 + 5, pMasterSkillDesc[uPlayerSkillType], | |
1033 pGlobalTXT_LocalizationStrings[96], v35 + 3, v35 + 5, pGrandSkillDesc[uPlayerSkillType], | |
1034 pGlobalTXT_LocalizationStrings[623], //Bonus | |
1035 (pParty->pPlayers[uPlayerID].GetActualSkillLevel(uPlayerSkillType) & 0x3F) - (pParty->pPlayers[uPlayerID].pActiveSkills[uPlayerSkillType] & 0x3F)); | |
1036 } | |
1037 return static_sub_417BB5_out_string; | |
1038 } | |
1298 | 1039 |
1040 //----- (00417FE5) -------------------------------------------------------- | |
1720 | 1041 void CharacterUI_SkillsTab_ShowHint() |
1042 { | |
1043 GUIButton *pButton; // esi@6 | |
1044 unsigned int pX; // [sp+4h] [bp-8h]@1 | |
1045 unsigned int pY; // [sp+8h] [bp-4h]@1 | |
1298 | 1046 |
1720 | 1047 pMouse->GetClickPos(&pX, &pY); |
1048 if ( (signed int)pX < 24 || (signed int)pX > 455 || (signed int)pY < 18 || (signed int)pY > 36 ) | |
1049 { | |
1050 for ( pButton = pGUIWindow_CurrentMenu->pControlsHead; pButton; pButton = pButton->pNext ) | |
1051 { | |
1052 if ( pButton->msg == UIMSG_SkillUp | |
1053 && (signed int)pX >= (signed int)pButton->uX | |
1054 && (signed int)pX <= (signed int)pButton->uZ | |
1055 && (signed int)pY >= (signed int)pButton->uY | |
1056 && (signed int)pY <= (signed int)pButton->uW ) | |
1057 { | |
1058 CharacterUI_DrawTooltip(pSkillNames[pButton->msg_param], CharacterUI_GetSkillDescText(uActiveCharacter - 1, (PLAYER_SKILL_TYPE)pButton->msg_param)); | |
1059 } | |
1298 | 1060 } |
1720 | 1061 } |
1062 else | |
1063 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[207], pSkillPointsAttributeDescription);//Очки навыков | |
1064 } | |
1298 | 1065 |
1066 //----- (00418083) -------------------------------------------------------- | |
1458 | 1067 void CharacterUI_StatsTab_ShowHint() |
1393 | 1068 { |
1298 | 1069 int pStringNum; // edi@1 |
1070 signed int pTextColor; // eax@15 | |
1071 char *pHourWord; // ecx@17 | |
1072 char *pDayWord; // eax@20 | |
1073 int v15; // ebx@28 | |
1074 POINT a2; // [sp+Ch] [bp-24h]@1 | |
1075 int pHour; // [sp+14h] [bp-1Ch]@15 | |
1076 unsigned int pDay; // [sp+24h] [bp-Ch]@15 | |
1077 | |
1393 | 1078 pMouse->GetCursorPos(&a2); |
1079 for ( pStringNum = 0; pStringNum < stat_string_coord.size(); ++pStringNum ) | |
1298 | 1080 { |
1393 | 1081 if (a2.x >= stat_string_coord[pStringNum].x && a2.x <= stat_string_coord[pStringNum].x + stat_string_coord[pStringNum].width ) |
1298 | 1082 { |
1393 | 1083 if (a2.y >= stat_string_coord[pStringNum].y && a2.y <= stat_string_coord[pStringNum].y + stat_string_coord[pStringNum].height ) |
1298 | 1084 break; |
1085 } | |
1086 } | |
1393 | 1087 |
1298 | 1088 switch ( pStringNum ) |
1089 { | |
1090 case 0:// Attributes | |
1091 case 1: | |
1092 case 2: | |
1093 case 3: | |
1094 case 4: | |
1095 case 5: | |
1096 case 6: | |
1097 if ( aAttributeNames[pStringNum] && pAttributeDescriptions[pStringNum] ) | |
1393 | 1098 CharacterUI_DrawTooltip(aAttributeNames[pStringNum], pAttributeDescriptions[pStringNum]); |
1298 | 1099 break; |
1100 case 7:// Health Points | |
1101 if ( pGlobalTXT_LocalizationStrings[108] && pHealthPointsAttributeDescription ) | |
1393 | 1102 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[108], pHealthPointsAttributeDescription); |
1298 | 1103 break; |
1104 case 8:// Spell Points | |
1105 if ( pGlobalTXT_LocalizationStrings[212] && pSpellPointsAttributeDescription ) | |
1393 | 1106 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[212], pSpellPointsAttributeDescription); |
1298 | 1107 break; |
1108 case 9:// Armor Class | |
1109 if ( pGlobalTXT_LocalizationStrings[12] && pArmourClassAttributeDescription ) | |
1393 | 1110 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[12], pArmourClassAttributeDescription); |
1298 | 1111 break; |
1112 case 10:// Player Condition | |
1113 strcpy(pTmpBuf2.data(), pPlayerConditionAttributeDescription); | |
1114 strcat(pTmpBuf2.data(), "\n"); | |
1115 extern std::array<unsigned int, 18> pConditionImportancyTable; | |
1116 for ( uint i = 0; i < 18; ++i ) | |
1117 { | |
1118 if ( pPlayers[uActiveCharacter]->pConditions[pConditionImportancyTable[i]] ) | |
1119 { | |
1120 strcat(pTmpBuf2.data(), " \n"); | |
1121 pHour = pParty->uTimePlayed - pPlayers[uActiveCharacter]->pConditions[pConditionImportancyTable[i]]; | |
1122 pHour = (unsigned int)((pHour * 0.234375) / 60 / 60); | |
1123 pDay = (unsigned int)pHour / 24; | |
1124 pHour %= 24i64; | |
1125 pTextColor = GetConditionDrawColor(pConditionImportancyTable[i]); | |
1126 sprintfex(pTmpBuf.data(), format_4E2DE8, pTextColor, aCharacterConditionNames[pConditionImportancyTable[i]]); | |
1127 strcat(pTmpBuf2.data(), pTmpBuf.data()); | |
1128 if ( pHour && pHour <= 1 ) | |
1129 pHourWord = pGlobalTXT_LocalizationStrings[109]; | |
1130 else | |
1131 pHourWord = pGlobalTXT_LocalizationStrings[110]; | |
1132 if ( !pDay || (pDayWord = pGlobalTXT_LocalizationStrings[56], pDay > 1) ) | |
1133 pDayWord = pGlobalTXT_LocalizationStrings[57]; | |
1134 sprintfex(pTmpBuf.data(), "%lu %s, %lu %s", pDay, pDayWord, pHour, pHourWord); | |
1135 strcat(pTmpBuf2.data(), pTmpBuf.data()); | |
1136 } | |
1137 } | |
1138 if ( pGlobalTXT_LocalizationStrings[47] && pTmpBuf2.data() ) | |
1393 | 1139 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[47], pTmpBuf2.data()); |
1298 | 1140 break; |
1141 case 11:// Fast Spell | |
1142 if ( pGlobalTXT_LocalizationStrings[172] && pFastSpellAttributeDescription ) | |
1393 | 1143 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[172], pFastSpellAttributeDescription); |
1298 | 1144 break; |
1145 case 12:// Player Age | |
1146 if ( pGlobalTXT_LocalizationStrings[5] && pPlayerAgeAttributeDescription ) | |
1393 | 1147 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[5], pPlayerAgeAttributeDescription); |
1298 | 1148 break; |
1149 case 13:// Player Level | |
1150 if ( pGlobalTXT_LocalizationStrings[131] && pPlayerLevelAttributeDescription ) | |
1393 | 1151 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[131], pPlayerLevelAttributeDescription); |
1298 | 1152 break; |
1153 case 14://Experience | |
1154 v15 = pPlayers[uActiveCharacter]->uLevel; | |
1155 do | |
1156 { | |
1459 | 1157 if ( (signed __int64)pPlayers[uActiveCharacter]->uExperience < (unsigned int)GetExperienceRequiredForLevel(v15) ) |
1298 | 1158 break; |
1159 ++v15; | |
1160 } | |
1161 while ( v15 <= 10000 ); | |
1162 pTmpBuf[0] = 0; | |
1163 pTmpBuf2[0] = 0; | |
1164 if ( v15 > pPlayers[uActiveCharacter]->uLevel ) | |
1165 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[147], v15); | |
1720 | 1166 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[538], GetExperienceRequiredForLevel(v15) - LODWORD(pPlayers[uActiveCharacter]->uExperience), v15 + 1); |
1298 | 1167 strcat(pTmpBuf.data(), "\n"); |
1168 strcat(pTmpBuf.data(), pTmpBuf2.data()); | |
1169 sprintf(pTmpBuf2.data(), "%s\n \n%s", pPlayerExperienceAttributeDescription, pTmpBuf.data()); | |
1170 if ( pGlobalTXT_LocalizationStrings[83] && pTmpBuf2.data() ) | |
1393 | 1171 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[83], pTmpBuf2.data()); |
1298 | 1172 break; |
1173 case 15:// Attack Bonus | |
1174 if ( pGlobalTXT_LocalizationStrings[587] && pAttackBonusAttributeDescription ) | |
1393 | 1175 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[587], pAttackBonusAttributeDescription); |
1298 | 1176 break; |
1177 case 16:// Attack Damage | |
1178 if ( pGlobalTXT_LocalizationStrings[588] && pAttackDamageAttributeDescription ) | |
1393 | 1179 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[588], pAttackDamageAttributeDescription); |
1298 | 1180 break; |
1181 case 17:// Missle Bonus | |
1182 if ( pGlobalTXT_LocalizationStrings[589] && pMissleBonusAttributeDescription ) | |
1393 | 1183 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[589], pMissleBonusAttributeDescription); |
1298 | 1184 break; |
1185 case 18:// Missle Damage | |
1186 if ( pGlobalTXT_LocalizationStrings[590] && pMissleDamageAttributeDescription ) | |
1393 | 1187 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[590], pMissleDamageAttributeDescription); |
1298 | 1188 break; |
1189 case 19:// Fire Resistance | |
1190 if ( pGlobalTXT_LocalizationStrings[87] && pFireResistanceAttributeDescription ) | |
1393 | 1191 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[87], pFireResistanceAttributeDescription); |
1298 | 1192 break; |
1193 case 20:// Air Resistance | |
1194 if ( pGlobalTXT_LocalizationStrings[6] && pAirResistanceAttributeDescription ) | |
1393 | 1195 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[6], pAirResistanceAttributeDescription); |
1298 | 1196 break; |
1197 case 21:// Water Resistance | |
1198 if ( pGlobalTXT_LocalizationStrings[240] && pWaterResistanceAttributeDescription ) | |
1393 | 1199 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[240], pWaterResistanceAttributeDescription); |
1298 | 1200 break; |
1201 case 22:// Earth Resistance | |
1202 if ( pGlobalTXT_LocalizationStrings[70] && pEarthResistanceAttributeDescription ) | |
1393 | 1203 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[70], pEarthResistanceAttributeDescription); |
1298 | 1204 break; |
1205 case 23:// Mind Resistance | |
1206 if ( pGlobalTXT_LocalizationStrings[142] && pMindResistanceAttributeDescription ) | |
1393 | 1207 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[142], pMindResistanceAttributeDescription); |
1298 | 1208 break; |
1209 case 24:// Body Resistance | |
1210 if ( pGlobalTXT_LocalizationStrings[29] && pBodyResistanceAttributeDescription ) | |
1393 | 1211 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[29], pBodyResistanceAttributeDescription); |
1298 | 1212 break; |
1213 case 25: // Skill Points | |
1214 if ( pGlobalTXT_LocalizationStrings[207] && pSkillPointsAttributeDescription ) | |
1393 | 1215 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[207], pSkillPointsAttributeDescription); |
1298 | 1216 break; |
1393 | 1217 case 26: // Class description |
1218 { | |
1678 | 1219 if (pClassDescriptions[pPlayers[uActiveCharacter]->classType] && pClassNames[pPlayers[uActiveCharacter]->classType]) |
1220 CharacterUI_DrawTooltip(pClassNames[pPlayers[uActiveCharacter]->classType], pClassDescriptions[pPlayers[uActiveCharacter]->classType]); | |
1393 | 1221 } |
1222 break; | |
1223 | |
1298 | 1224 default: |
1225 break; | |
1226 } | |
1227 } | |
1228 | |
1720 | 1229 //----- (00410B28) -------------------------------------------------------- |
1230 void DrawSpellDescriptionPopup(int spell_index) | |
1231 { | |
1232 SpellInfo *spell; // esi@1 | |
1233 unsigned int v3; // eax@2 | |
1234 LONG v5; // ecx@4 | |
1235 GUIWindow spell_info_window; // [sp+Ch] [bp-68h]@4 | |
1236 POINT mouse; // [sp+64h] [bp-10h]@1 | |
1298 | 1237 |
1720 | 1238 spell = &pSpellStats->pInfos[spell_index + 11 * pPlayers[uActiveCharacter]->lastOpenedSpellbookPage + 1]; |
1239 if ( pMouse->GetCursorPos(&mouse)->y <= 250 ) | |
1240 v3 = pMouse->GetCursorPos(&mouse)->y + 30; | |
1241 else | |
1242 v3 = 30; | |
1243 spell_info_window.uFrameY = v3; | |
1244 spell_info_window.uFrameWidth = 328; | |
1245 spell_info_window.uFrameHeight = 68; | |
1246 spell_info_window.uFrameX = 90; | |
1247 spell_info_window.uFrameZ = 417; | |
1248 spell_info_window.uFrameW = v3 + 67; | |
1249 spell_info_window.Hint = 0; | |
1250 v5 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[LOCSTR_NORMAL]); | |
1251 if ( pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[LOCSTR_MASTER]) > v5 ) | |
1252 v5 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[LOCSTR_MASTER]); | |
1253 if ( pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[LOCSTR_EXPERT]) > v5 ) | |
1254 v5 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[LOCSTR_EXPERT]); | |
1255 if ( pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[LOCSTR_GRAND]) > v5 ) | |
1256 v5 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[LOCSTR_GRAND]); | |
1257 sprintf(pTmpBuf2.data(), | |
1298 | 1258 "%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", |
1720 | 1259 spell->pDescription, |
1260 pGlobalTXT_LocalizationStrings[LOCSTR_NORMAL], v5 + 3, v5 + 10, spell->pBasicSkillDesc, | |
1261 pGlobalTXT_LocalizationStrings[LOCSTR_EXPERT], v5 + 3, v5 + 10, spell->pExpertSkillDesc, | |
1262 pGlobalTXT_LocalizationStrings[LOCSTR_MASTER], v5 + 3, v5 + 10, spell->pMasterSkillDesc, | |
1263 pGlobalTXT_LocalizationStrings[LOCSTR_GRAND], v5 + 3, v5 + 10, spell->pGrandmasterSkillDesc); | |
1264 spell_info_window.uFrameHeight += pFontSmallnum->CalcTextHeight(pTmpBuf2.data(), &spell_info_window, 0, 0); | |
1265 if ( (signed int)spell_info_window.uFrameHeight < 150 ) | |
1266 spell_info_window.uFrameHeight = 150; | |
1267 spell_info_window.uFrameWidth = game_viewport_width; | |
1268 spell_info_window.DrawMessageBox(0); | |
1269 spell_info_window.uFrameWidth -= 12; | |
1270 spell_info_window.uFrameHeight -= 12; | |
1271 spell_info_window.uFrameZ = spell_info_window.uFrameX + spell_info_window.uFrameWidth - 1; | |
1272 spell_info_window.uFrameW = spell_info_window.uFrameHeight + spell_info_window.uFrameY - 1; | |
1273 spell_info_window.DrawTitleText(pFontArrus, 0x78u, 0xCu, TargetColor(0xFFu, 0xFFu, 0x9Bu), spell->pName, 3); | |
1274 spell_info_window.DrawText(pFontSmallnum, 120, 44, 0, pTmpBuf2.data(), 0, 0, 0); | |
1275 spell_info_window.uFrameWidth = 108; | |
1276 spell_info_window.uFrameZ = spell_info_window.uFrameX + 107; | |
1277 spell_info_window.DrawTitleText(pFontComic, 0xCu, 0x4Bu, 0, pSkillNames[pPlayers[uActiveCharacter]->lastOpenedSpellbookPage + 12], 3); | |
1278 sprintf( pTmpBuf.data(), "%s\n%d", pGlobalTXT_LocalizationStrings[LOCSTR_SP_COST], | |
1279 pSpellDatas[spell_index + 11 * pPlayers[uActiveCharacter]->lastOpenedSpellbookPage + 1].mana_per_skill[pPlayers[uActiveCharacter]->pActiveSkills[pPlayers[uActiveCharacter]->lastOpenedSpellbookPage + PLAYER_SKILL_FIRE]]); | |
1280 spell_info_window.DrawTitleText(pFontComic, 0xCu, spell_info_window.uFrameHeight - LOBYTE(pFontComic->uFontHeight) - 16, 0, pTmpBuf.data(), 3); | |
1281 dword_507B00_spell_info_to_draw_in_popup = 0; | |
1282 } | |
1298 | 1283 // 507B00: using guessed type int dword_507B00_spell_info_to_draw_in_popup; |
1284 | |
1285 //----- (00416D62) -------------------------------------------------------- | |
1286 void sub_416D62_ShowPopupWindow_MonsterRecord_ItemInfo_etcsub_416D62(Vec2_int_ *_this) | |
1287 { | |
1288 signed int pPlayerNum; // eax@12 | |
1720 | 1289 //char *v2; // eax@32 |
1290 //void *v3; // ecx@52 | |
1298 | 1291 unsigned int v4; // eax@59 |
1292 int v5; // esi@62 | |
1720 | 1293 //signed int v6; // esi@64 |
1294 //signed int v7; // esi@69 | |
1298 | 1295 unsigned int v10; // eax@76 |
1296 //char v11; // zf@83 | |
1297 GUIButton *pButton; // esi@84 | |
1298 unsigned int v13; // ecx@85 | |
1299 char *pStr; // edi@85 | |
1300 //signed int pControlID; // eax@92 | |
1301 int v16; // eax@95 | |
1302 int v17; // eax@96 | |
1303 PLAYER_SKILL_TYPE v18; // eax@98 | |
1304 char *pStr2; // eax@99 | |
1305 unsigned int v20; // eax@108 | |
1306 unsigned int pSkillId; // eax@109 | |
1307 const char *pSkillInfo; // eax@111 | |
1308 //char *v23; // ebx@112 | |
1309 char *pHint; // edx@113 | |
1310 unsigned int pColor; // eax@113 | |
1311 GUIWindow pWindow; // [sp+4h] [bp-74h]@32 | |
1720 | 1312 //double v27; // [sp+58h] [bp-20h]@33 |
1298 | 1313 struct tagPOINT Point; // [sp+60h] [bp-18h]@6 |
1720 | 1314 //char *v29; // [sp+68h] [bp-10h]@33 |
1315 //float v30; // [sp+6Ch] [bp-Ch]@33 | |
1298 | 1316 unsigned int pX; // [sp+70h] [bp-8h]@3 |
1317 unsigned int pY; // [sp+74h] [bp-4h]@3 | |
1318 | |
1720 | 1319 if ( pCurrentScreen == SCREEN_VIDEO ) |
1320 return; | |
1321 if ( _this ) | |
1322 { | |
1323 pX = _this->x; | |
1324 pY = _this->y; | |
1325 } | |
1326 else | |
1327 { | |
1328 pMouse->GetClickPos(&pX, &pY); | |
1329 } | |
1330 if ( pRenderer->bWindowMode ) | |
1331 { | |
1332 GetCursorPos(&Point); | |
1333 ScreenToClient(hWnd, &Point); | |
1334 if ( Point.x < 1 || Point.y < 1 || Point.x > 638 || Point.y > 478 ) | |
1335 { | |
1336 back_to_game(); | |
1337 return; | |
1338 } | |
1339 } | |
1340 if ( pParty->pPickedItem.uItemID )//нажатие на портрет перса правой кнопкой мыши с раствором | |
1341 { | |
1342 for ( uint i = 0; i < 4; ++i ) | |
1343 { | |
1344 if ( (signed int)pX > RightClickPortraitXmin[i] && (signed int)pX < RightClickPortraitXmax[i] | |
1345 && (signed int)pY > 375 && (signed int)pY < 466 ) | |
1346 { | |
1347 pPlayers[uActiveCharacter]->UseItem_DrinkPotion_etc(i + 1, 1); | |
1348 return; | |
1349 } | |
1350 } | |
1351 } | |
1298 | 1352 |
1720 | 1353 pEventTimer->Pause(); |
1354 switch(pCurrentScreen) | |
1355 { | |
1356 case SCREEN_CASTING: | |
1357 { | |
1358 OnInventoryItemRightClick(); | |
1359 break; | |
1360 } | |
1361 case SCREEN_CHEST: | |
1362 { | |
1363 if ( !pPlayers[uActiveCharacter]->CanAct() ) | |
1364 { | |
1365 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[427], pPlayers[uActiveCharacter]->pName, pGlobalTXT_LocalizationStrings[541]);//%s не в состоянии %s Опознать предметы | |
1366 pWindow.Hint = pTmpBuf.data(); | |
1367 pWindow.uFrameWidth = 384; | |
1368 pWindow.uFrameHeight = 180; | |
1369 pWindow.uFrameY = 40; | |
1370 if ( (signed int)pX <= 320 ) | |
1371 v10 = pX + 30; | |
1372 else | |
1373 v10 = pX - 414; | |
1374 pWindow.uFrameX = v10; | |
1375 pWindow.DrawMessageBox(0); | |
1376 } | |
1377 else | |
1378 { | |
1379 if ( pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]] & 0xFFFF ) | |
1380 { | |
1381 v10 = pChests[pChestWindow->par1C].pInventoryIndices[(pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]] & 0xFFFF)-1]; | |
1382 GameUI_DrawItemInfo(&pChests[pChestWindow->par1C].igChestItems[v10 - 1]); | |
1383 } | |
1384 } | |
1385 break; | |
1386 } | |
1387 case SCREEN_GAME: | |
1388 { | |
1389 if (GetCurrentMenuID() > 0) | |
1390 break; | |
1391 if ( (signed int)pY > (signed int)pViewport->uViewportBR_Y ) | |
1392 { | |
1393 pWindow.ptr_1C = (void *)((signed int)pX / 118); | |
1394 if ( (signed int)pX / 118 < 4 )//portaits zone | |
1395 { | |
1396 pWindow.Hint = 0; | |
1397 pWindow.uFrameWidth = 400; | |
1398 pWindow.uFrameHeight = 200; | |
1399 pWindow.uFrameX = 38; | |
1400 pWindow.uFrameY = 60; | |
1401 pAudioPlayer->StopChannels(-1, -1); | |
1402 GameUI_CharacterQuickRecord_Draw(&pWindow, pPlayers[(int)pWindow.ptr_1C + 1]); | |
1403 } | |
1404 } | |
1405 else if ( (signed int)pX > (signed int)pViewport->uViewportBR_X ) | |
1406 { | |
1407 if ( (signed int)pY >= 130 ) | |
1408 { | |
1409 if ( (signed int)pX >= 476 && (signed int)pX <= 636 && (signed int)pY >= 240 && (signed int)pY <= 300 )//buff_tooltip zone | |
1410 { | |
1411 pWindow.Hint = 0; | |
1412 pWindow.uFrameWidth = 400; | |
1413 pWindow.uFrameHeight = 200; | |
1414 pWindow.uFrameX = 38; | |
1415 pWindow.uFrameY = 60; | |
1416 pAudioPlayer->StopChannels(-1, -1); | |
1417 pWindow._41D73D_draw_buff_tooltip(); | |
1418 } | |
1419 else if ( (signed int)pX < 485 || (signed int)pX > 548 || (signed int)pY < 156 || (signed int)pY > 229 )//NPC zone | |
1420 { | |
1421 if (!( (signed int)pX < 566 || (signed int)pX > 629 || (signed int)pY < 156 || (signed int)pY > 229 )) | |
1422 { | |
1423 pAudioPlayer->StopChannels(-1, -1); | |
1424 GameUI_DrawNPCPopup((void *)1);//NPC 2 | |
1298 | 1425 } |
1720 | 1426 } |
1427 else | |
1428 { | |
1298 | 1429 pAudioPlayer->StopChannels(-1, -1); |
1720 | 1430 GameUI_DrawNPCPopup(0);//NPC 1 |
1431 } | |
1432 } | |
1433 else//minimap zone | |
1434 { | |
1435 pWindow.Hint = (char *)GameUI_GetMinimapHintText(); | |
1436 pWindow.uFrameWidth = 256; | |
1437 pWindow.uFrameX = 130; | |
1438 pWindow.uFrameY = 140; | |
1439 pWindow.uFrameHeight = 64; | |
1440 pAudioPlayer->StopChannels(-1, -1); | |
1441 pWindow.DrawMessageBox(0); | |
1442 } | |
1443 } | |
1444 else//game zone | |
1445 { | |
1446 pWindow.Hint = 0; | |
1447 pWindow.uFrameWidth = 320; | |
1448 pWindow.uFrameHeight = 320; | |
1449 v4 = pX - 350; | |
1450 if ( (signed int)pX <= 320 ) | |
1451 v4 = pX + 30; | |
1452 pWindow.uFrameX = v4; | |
1453 pWindow.uFrameY = 40; | |
1454 if ( pRenderer->pRenderD3D ) | |
1455 LOWORD(v5) = pGame->pVisInstance->get_picked_object_zbuf_val(); | |
1456 else | |
1457 v5 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]]; | |
1458 if (PID_TYPE((unsigned __int16)v5) == OBJECT_Actor) | |
1459 { | |
1460 if ( pRenderer->uNumSceneBegins ) | |
1461 { | |
1462 pWindow.DrawMessageBox(1); | |
1463 MonsterPopup_Draw(PID_ID((unsigned __int16)v5), &pWindow); | |
1464 } | |
1465 else | |
1466 { | |
1467 pRenderer->BeginScene(); | |
1468 pWindow.DrawMessageBox(1); | |
1469 MonsterPopup_Draw(PID_ID((unsigned __int16)v5), &pWindow); | |
1470 pRenderer->EndScene(); | |
1471 } | |
1472 } | |
1473 if (PID_TYPE((unsigned __int16)v5) == OBJECT_Item) | |
1474 { | |
1475 if ( !(pObjectList->pObjects[pSpriteObjects[PID_ID((unsigned __int16)v5)].uObjectDescID].uFlags & 0x10 ) ) | |
1476 { | |
1477 GameUI_DrawItemInfo(&pSpriteObjects[PID_ID((unsigned __int16)v5)].stru_24); | |
1478 } | |
1479 } | |
1480 } | |
1481 break; | |
1482 } | |
1483 case SCREEN_BOOKS: | |
1484 { | |
1485 if ( !dword_506364 | |
1486 || (signed int)pX < (signed int)pViewport->uViewportTL_X || (signed int)pX > (signed int)pViewport->uViewportBR_X | |
1487 || (signed int)pY < (signed int)pViewport->uViewportTL_Y || (signed int)pY > (signed int)pViewport->uViewportBR_Y | |
1488 || ((pWindow.Hint = (char *)GetMapBookHintText()) == 0) ) | |
1489 break; | |
1490 pWindow.uFrameWidth = (pFontArrus->GetLineWidth(pWindow.Hint) + 32) + 0.5f; | |
1491 pWindow.uFrameX = pX + 5; | |
1492 pWindow.uFrameY = pY + 5; | |
1493 pWindow.uFrameHeight = 64; | |
1494 pAudioPlayer->StopChannels(-1, -1); | |
1495 pWindow.DrawMessageBox(0); | |
1496 break; | |
1497 } | |
1498 case SCREEN_CHARACTERS: | |
1298 | 1499 case SCREEN_E: |
1500 case SCREEN_CHEST_INVENTORY: | |
1501 { | |
1502 if ( (signed int)pX > 467 && pCurrentScreen != SCREEN_E ) | |
1503 { | |
1575 | 1504 OnInventoryItemRightClick(); |
1298 | 1505 } |
1506 else if ( (signed int)pY >= 345 ) | |
1507 break; | |
1508 else if ( pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] == 100 )//2DEvent - CharacerScreenStats | |
1509 { | |
1510 CharacterUI_StatsTab_ShowHint(); | |
1511 } | |
1512 else if ( pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] == 101 )//2DEvent - CharacerScreenSkills | |
1513 { | |
1514 CharacterUI_SkillsTab_ShowHint(); | |
1515 } | |
1516 else | |
1517 { | |
1518 if ( pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] == 103 )//2DEvent - CharacerScreenInventory | |
1575 | 1519 OnInventoryItemRightClick(); |
1298 | 1520 } |
1521 break; | |
1522 } | |
1523 case SCREEN_SPELL_BOOK: | |
1524 { | |
1525 if ( dword_507B00_spell_info_to_draw_in_popup ) | |
1526 DrawSpellDescriptionPopup(dword_507B00_spell_info_to_draw_in_popup - 1); | |
1527 break; | |
1528 } | |
1529 case SCREEN_HOUSE: | |
1530 { | |
1531 if ( (signed int)pY < 345 && (signed int)pX < 469 ) | |
1532 ShowPopupShopItem(); | |
1533 break; | |
1534 } | |
1535 case SCREEN_PARTY_CREATION: | |
1536 { | |
1537 pWindow.Hint = 0; | |
1538 pStr = 0; | |
1539 for ( pButton = pGUIWindow_CurrentMenu->pControlsHead; pButton; pButton = pButton->pNext) | |
1540 { | |
1541 if ( pButton->uButtonType == 1 && pButton->uButtonType != 3 && (signed int)pX > (signed int)pButton->uX && (signed int)pX < (signed int)pButton->uZ | |
1542 && (signed int)pY > (signed int)pButton->uY && (signed int)pY < (signed int)pButton->uW ) | |
1543 { | |
1544 switch ( pButton->msg ) | |
1545 { | |
1546 case UIMSG_0: //stats info | |
1547 pWindow.Hint = pAttributeDescriptions[(signed int)pButton->msg_param % 7]; | |
1548 pStr = aAttributeNames[(signed int)pButton->msg_param % 7]; | |
1549 break; | |
1550 case UIMSG_PlayerCreationClickPlus: //Plus button info | |
1551 pStr = pGlobalTXT_LocalizationStrings[670];//Добавить | |
1552 pWindow.Hint = pGlobalTXT_LocalizationStrings[671];//"Добавляет очко к выделенному навыку, забирая его из накопителя очков" | |
1553 break; | |
1554 case UIMSG_PlayerCreationClickMinus: //Minus button info | |
1555 pStr = pGlobalTXT_LocalizationStrings[668];//Вычесть | |
1556 pWindow.Hint = pGlobalTXT_LocalizationStrings[669];//"Вычитает очко из выделенного навыка, возвращая его в накопитель очков" | |
1557 break; | |
1558 case UIMSG_PlayerCreationSelectActiveSkill: //Available skill button info | |
1559 v18 = pParty->pPlayers[uPlayerCreationUI_SelectedCharacter].GetSkillIdxByOrder(pButton->msg_param + 4); | |
1560 pStr = pSkillNames[v18]; | |
1561 pWindow.Hint = pSkillDesc[v18]; | |
1562 break; | |
1563 case UIMSG_PlayerCreationSelectClass: //Available Class Info | |
1564 pWindow.Hint = pClassDescriptions[pButton->msg_param]; | |
1565 pStr = pClassNames[pButton->msg_param]; | |
1566 break; | |
1567 case UIMSG_PlayerCreationClickOK: //OK Info | |
1568 pWindow.Hint = pGlobalTXT_LocalizationStrings[664];//Щелкните здесь для утверждения состава отряда и продолжения игры. | |
1569 pStr = pGlobalTXT_LocalizationStrings[665];//Кнопка ОК | |
1570 break; | |
1571 case UIMSG_PlayerCreationClickReset: //Clear info | |
1572 pWindow.Hint = pGlobalTXT_LocalizationStrings[666];//Сбрасывает все параметры и навыки отряда. | |
1573 pStr = pGlobalTXT_LocalizationStrings[667];//Кнопка Очистить | |
1574 break; | |
1575 case UIMSG_PlayerCreation_SelectAttribute: // Character info | |
1576 pStr = pParty->pPlayers[pButton->msg_param].pName; | |
1577 pWindow.Hint = pClassDescriptions[pParty->pPlayers[pButton->msg_param].classType]; | |
1578 break; | |
1579 } | |
1580 if ( pButton->msg > UIMSG_44 && pButton->msg <= UIMSG_PlayerCreationRemoveDownSkill ) //Sellected skills info | |
1581 { | |
1582 pSkillId = pParty->pPlayers[pButton->msg_param].GetSkillIdxByOrder(pButton->msg - UIMSG_48); | |
1583 pY = 0; | |
1584 if ( (signed int)pSkillId < 37 ) | |
1585 { | |
1586 pSkillInfo = CharacterUI_GetSkillDescText(pButton->msg_param, (PLAYER_SKILL_TYPE)pSkillId); | |
1587 strcpy(pTmpBuf2.data(), pSkillInfo); | |
1588 pWindow.Hint = pTmpBuf2.data(); | |
1589 pStr = pSkillNames[pSkillId]; | |
1590 } | |
1591 } | |
1592 } | |
1593 } | |
1594 if ( pWindow.Hint ) | |
1595 { | |
1596 pHint = (char*)pWindow.Hint; | |
1597 pWindow.Hint = 0; | |
1598 pWindow.uFrameWidth = 384; | |
1599 pWindow.uFrameHeight = 256; | |
1600 pWindow.uFrameX = 128; | |
1601 pWindow.uFrameY = 40; | |
1602 pWindow.uFrameHeight = pFontSmallnum->CalcTextHeight(pHint, &pWindow, 24, 0) + 2 * LOBYTE(pFontLucida->uFontHeight) + 24; | |
1603 pWindow.uFrameZ = pWindow.uFrameX + pWindow.uFrameWidth - 1; | |
1604 pWindow.uFrameW = pWindow.uFrameY + pWindow.uFrameHeight - 1; | |
1605 pWindow.DrawMessageBox(0); | |
1606 pWindow.uFrameX += 12; | |
1607 pWindow.uFrameWidth -= 24; | |
1608 pWindow.uFrameY += 12; | |
1609 pWindow.uFrameHeight -= 12; | |
1610 pWindow.uFrameZ = pWindow.uFrameX + pWindow.uFrameWidth - 1; | |
1611 pWindow.uFrameW = pWindow.uFrameY + pWindow.uFrameHeight - 1; | |
1612 pColor = TargetColor(0xFF, 0xFF, 0x9B); | |
1613 sprintf(pTmpBuf.data(), format_4E2D80, pColor, pStr);//"\f%05d%s\f00000\n" | |
1614 pWindow.DrawTitleText(pFontCreate, 0, 0, 0, pTmpBuf.data(), 3); | |
1615 pWindow.DrawText(pFontSmallnum, 1, pFontLucida->uFontHeight, 0, pHint, 0, 0, 0); | |
1616 } | |
1617 break; | |
1618 } | |
1619 default: | |
1620 { | |
1621 break; | |
1622 } | |
1623 } | |
1624 dword_507BF0_is_there_popup_onscreen = 1; | |
1625 viewparams->bRedrawGameUI = 1; | |
1626 } |