Mercurial > mm7
annotate UI/UIPopup.cpp @ 1710:0f6cd60ca987
Merge
author | Grumpy7 |
---|---|
date | Tue, 24 Sep 2013 07:32:24 +0200 |
parents | 8251e59fd7c1 a395359afc8f |
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; | |
1709
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1699
diff
changeset
|
138 v78 = 100 - pIcons_LOD->LoadTexturePtr(inspect_item->GetIconName(), TEXTURE_16BIT_PALETTE)->uTextureWidth; |
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1699
diff
changeset
|
139 v81 = 144 - pIcons_LOD->LoadTexturePtr(inspect_item->GetIconName(), TEXTURE_16BIT_PALETTE)->uTextureHeight; |
1699 | 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; | |
1709
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1699
diff
changeset
|
149 if (inspect_item->GetItemEquipType() == EQUIP_GOLD) |
1699 | 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; | |
1709
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1699
diff
changeset
|
200 pRenderer->DrawTransparentRedShade(iteminfo_window.uFrameX + v78, v81 + iteminfo_window.uFrameY + 30, pIcons_LOD->LoadTexturePtr(inspect_item->GetIconName(), TEXTURE_16BIT_PALETTE)); |
1699 | 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 { | |
1709
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1699
diff
changeset
|
211 pIcons_LOD->LoadTexturePtr(inspect_item->GetIconName(), TEXTURE_16BIT_PALETTE)->Release(); |
1699 | 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; | |
1709
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1699
diff
changeset
|
225 pRenderer->DrawTextureTransparent(iteminfo_window.uFrameX + v78, v81 + iteminfo_window.uFrameY + 30, pIcons_LOD->LoadTexturePtr(inspect_item->GetIconName(), TEXTURE_16BIT_PALETTE)); |
1699 | 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 { | |
1709
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1699
diff
changeset
|
232 pIcons_LOD->LoadTexturePtr(inspect_item->GetIconName(), TEXTURE_16BIT_PALETTE)->Release(); |
1699 | 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; | |
1709
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1699
diff
changeset
|
240 switch (inspect_item->GetItemEquipType()) |
1699 | 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], |
1709
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1699
diff
changeset
|
245 (int)inspect_item->GetDamageMod(), pGlobalTXT_LocalizationStrings[53], |
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1699
diff
changeset
|
246 (int)inspect_item->GetDamageDice(), (int)inspect_item->GetDamageRoll()); //"Damage" |
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1699
diff
changeset
|
247 if (inspect_item->GetDamageMod()) |
1699 | 248 { |
249 char mod[16]; | |
1709
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1699
diff
changeset
|
250 sprintf(mod, "+%d", (int)inspect_item->GetDamageMod()); |
1699 | 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" |
1709
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1699
diff
changeset
|
257 (int)inspect_item->GetDamageMod(), pGlobalTXT_LocalizationStrings[53], //"Damage" |
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1699
diff
changeset
|
258 (int)inspect_item->GetDamageDice(), (int)inspect_item->GetDamageRoll()); |
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1699
diff
changeset
|
259 if (inspect_item->GetDamageMod()) |
1699 | 260 { |
261 char mod[16]; | |
1709
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1699
diff
changeset
|
262 sprintf(mod, "+%d", (int)inspect_item->GetDamageMod()); |
1699 | 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: | |
1709
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1699
diff
changeset
|
276 if (inspect_item->GetDamageDice()) //"Armor" |
1699 | 277 sprintfex(out_text + 100, "%s: +%d", pGlobalTXT_LocalizationStrings[11], |
1709
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1699
diff
changeset
|
278 inspect_item->GetDamageDice() + inspect_item->GetDamageMod()); |
1699 | 279 break; |
280 } | |
1298 | 281 |
1699 | 282 if ( !v77 ) |
283 { | |
1709
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1699
diff
changeset
|
284 if (inspect_item->GetItemEquipType() ==EQUIP_POTION) //this is CORRECT! do not move to switch! |
1699 | 285 { |
286 if ( inspect_item->uEnchantmentType ) | |
287 sprintf(out_text + 200, "%s: %d",pGlobalTXT_LocalizationStrings[449] , inspect_item->uEnchantmentType); //"Power" | |
288 } | |
1709
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1699
diff
changeset
|
289 else if (inspect_item->GetItemEquipType() == EQUIP_REAGENT) |
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1699
diff
changeset
|
290 sprintf(out_text + 200, "%s: %d", pGlobalTXT_LocalizationStrings[449], inspect_item->GetDamageDice()); //"Power" |
1699 | 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); | |
1709
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1699
diff
changeset
|
312 iteminfo_window.uFrameHeight = pIcons_LOD->LoadTexturePtr(inspect_item->GetIconName(), |
1699 | 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, | |
1709
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1699
diff
changeset
|
338 iteminfo_window.uFrameY + (signed int)(iteminfo_window.uFrameHeight - pIcons_LOD->LoadTexturePtr(inspect_item->GetIconName(), TEXTURE_16BIT_PALETTE)->uTextureHeight) / 2, |
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1699
diff
changeset
|
339 pIcons_LOD->LoadTexturePtr(inspect_item->GetIconName(), 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 { | |
1709
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1699
diff
changeset
|
404 pIcons_LOD->LoadTexturePtr(inspect_item->GetIconName(), TEXTURE_16BIT_PALETTE)->Release(); |
1699 | 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 { | |
1709
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1699
diff
changeset
|
418 pIcons_LOD->LoadTexturePtr(inspect_item->GetIconName(), TEXTURE_16BIT_PALETTE)->Release(); |
1699 | 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 | |
443 int v41; // edi@61 | |
444 unsigned int v42; // eax@61 | |
445 int v43; // eax@62 | |
446 int v44; // eax@63 | |
447 signed int v45; // edi@65 | |
1705 | 448 int pTextHeight; // edi@90 |
1298 | 449 int v73; // [sp-8h] [bp-1F4h]@79 |
450 DDBLTFX Dst; // [sp+Ch] [bp-1E0h]@18 | |
451 DDSURFACEDESC2 pDesc; // [sp+70h] [bp-17Ch]@18 | |
452 RECT v84; // [sp+ECh] [bp-100h]@26 | |
1705 | 453 char *string_name[10]; // [sp+FCh] [bp-F0h]@145 |
454 char *content[11]; // [sp+124h] [bp-C8h]@127 | |
1298 | 455 RenderBillboardTransform_local0 v106; // [sp+150h] [bp-9Ch]@3 |
456 unsigned int v107; // [sp+1A0h] [bp-4Ch]@18 | |
457 unsigned __int16 *v108; // [sp+1A4h] [bp-48h]@34 | |
458 unsigned int v109; // [sp+1A8h] [bp-44h]@32 | |
459 LPVOID v110; // [sp+1ACh] [bp-40h]@28 | |
460 int v115; // [sp+1C0h] [bp-2Ch]@3 | |
1705 | 461 bool normal_level; // [sp+1D0h] [bp-1Ch]@18 |
462 bool expert_level; // [sp+1C4h] [bp-28h]@18 | |
463 bool master_level; // [sp+1C8h] [bp-24h]@18 | |
464 bool grandmaster_level; // [sp+1B4h] [bp-38h]@3 | |
465 char *pText; // [sp+1D4h] [bp-18h]@18 | |
466 int pTextColorID; // [sp+1E4h] [bp-8h]@18 | |
1298 | 467 int a4; // [sp+1E8h] [bp-4h]@18 |
468 | |
1705 | 469 bool monster_full_informations = true; |
1298 | 470 static Actor pMonsterInfoUI_Doll; |
471 /*if ( !(bMonsterInfoUI_bDollInitialized & 1) ) | |
472 { | |
473 bMonsterInfoUI_bDollInitialized |= 1u; | |
474 Actor::Actor(&pMonsterInfoUI_Doll); | |
475 atexit(nullsub_3); | |
476 }*/ | |
477 v106.uParentBillboardID = -1; | |
1699 | 478 v115 = monster_popup_y_offsets[((signed __int16)pActors[uActorID].pMonsterInfo.uID - 1) / 3] - 40; |
479 if ( pActors[uActorID].pMonsterInfo.uID == pMonsterInfoUI_Doll.pMonsterInfo.uID ) | |
1298 | 480 v9 = pMonsterInfoUI_Doll.uCurrentActionLength; |
481 else | |
482 { | |
1699 | 483 memcpy(&pMonsterInfoUI_Doll, &pActors[uActorID], sizeof(pMonsterInfoUI_Doll)); |
1298 | 484 pMonsterInfoUI_Doll.uCurrentActionAnimation = ANIM_Bored; |
485 pMonsterInfoUI_Doll.uCurrentActionTime = 0; | |
486 v8 = rand(); | |
487 v9 = v8 % 256 + 128; | |
488 pMonsterInfoUI_Doll.uCurrentActionLength = v8 % 256 + 128; | |
489 } | |
490 | |
491 if ( (signed int)pMonsterInfoUI_Doll.uCurrentActionTime > (signed __int16)v9 ) | |
492 { | |
493 pMonsterInfoUI_Doll.uCurrentActionTime = 0; | |
494 if ( pMonsterInfoUI_Doll.uCurrentActionAnimation == ANIM_Bored || pMonsterInfoUI_Doll.uCurrentActionAnimation == ANIM_AtkMelee) | |
495 { | |
496 pMonsterInfoUI_Doll.uCurrentActionAnimation = ANIM_Standing; | |
497 pMonsterInfoUI_Doll.uCurrentActionLength = rand() % 128 + 128; | |
498 } | |
499 else | |
500 { | |
501 //rand(); | |
502 pMonsterInfoUI_Doll.uCurrentActionAnimation = ANIM_Bored; | |
503 if ( (pMonsterInfoUI_Doll.pMonsterInfo.uID < 115 || pMonsterInfoUI_Doll.pMonsterInfo.uID > 186) && | |
504 (pMonsterInfoUI_Doll.pMonsterInfo.uID < 232 || pMonsterInfoUI_Doll.pMonsterInfo.uID > 249) && rand() % 30 < 100 ) | |
505 pMonsterInfoUI_Doll.uCurrentActionAnimation = ANIM_AtkMelee; | |
1699 | 506 pMonsterInfoUI_Doll.uCurrentActionLength = 8 * pSpriteFrameTable->pSpriteSFrames[pActors[uActorID].pSpriteIDs[(signed __int16)pMonsterInfoUI_Doll.uCurrentActionAnimation]].uAnimLength; |
1298 | 507 } |
508 } | |
1699 | 509 v10 = pSpriteFrameTable->GetFrame( pActors[uActorID].pSpriteIDs[pMonsterInfoUI_Doll.uCurrentActionAnimation], pMonsterInfoUI_Doll.uCurrentActionTime); |
1298 | 510 v106.pTarget = pRenderer->pTargetSurface; |
511 v106.pTargetZ = pRenderer->pActiveZBuffer; | |
512 v106.uTargetPitch = pRenderer->uTargetSurfacePitch; | |
1699 | 513 v106.uViewportX = window->uFrameX + 13; |
514 v106.uViewportY = window->uFrameY + 52; | |
515 v106.uViewportW = (window->uFrameY + 52) + 128; | |
1298 | 516 v106.uViewportZ = v106.uViewportX + 128; |
517 v106.uScreenSpaceX = (signed int)(v106.uViewportX + 128 + v106.uViewportX) / 2; | |
518 v106._screenspace_x_scaler_packedfloat = 65536; | |
519 v106._screenspace_y_scaler_packedfloat = 65536; | |
1699 | 520 v106.uScreenSpaceY = v115 + (window->uFrameY + 52) + pSprites_LOD->pSpriteHeaders[v10->pHwSpriteIDs[0]].uHeight; |
1298 | 521 v106.pPalette = PaletteManager::Get_Dark_or_Red_LUT(v10->uPaletteIndex, 0, 1); |
522 v106.sZValue = 0; | |
523 v106.uFlags = 0; | |
524 pRenderer->SetRasterClipRect(0, 0, 0x27Fu, 0x1DFu); | |
1699 | 525 pRenderer->RasterLine2D(v106.uViewportX - 1, v106.uViewportY - 1, v106.uViewportX + 129, v106.uViewportY - 1, TargetColor(0xE1u, 255, 0x9Bu)); |
526 pRenderer->RasterLine2D( v106.uViewportX + 129, v106.uViewportY - 1, v106.uViewportX + 129, v106.uViewportW + 1, TargetColor(0xE1u, 255, 0x9Bu)); | |
527 pRenderer->RasterLine2D(v106.uViewportX + 129, v106.uViewportW + 1, v106.uViewportX - 1, v106.uViewportW + 1, TargetColor(0xE1u, 255, 0x9Bu)); | |
528 pRenderer->RasterLine2D(v106.uViewportX - 1, v106.uViewportW + 1, v106.uViewportX - 1, v106.uViewportY - 1, TargetColor(0xE1u, 255, 0x9Bu)); | |
1298 | 529 if ( pRenderer->pRenderD3D ) |
530 { | |
1699 | 531 v106.uScreenSpaceY = v115 + v106.uViewportY + pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uBufferHeight; |
1298 | 532 memset(&Dst, 0, 0x64u); |
533 Dst.dwSize = 100; | |
534 Dst.dwFillColor = 0; | |
535 memset(&pDesc, 0, 0x7Cu); | |
536 pDesc.dwSize = 124; | |
1699 | 537 pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].pTextureSurface->GetSurfaceDesc(&pDesc); |
1298 | 538 v107 = 0; |
1705 | 539 uint i = 0; |
1699 | 540 int dst_x = v106.uScreenSpaceX + pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uAreaX - pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uBufferWidth / 2; |
541 int dst_y = v106.uScreenSpaceY + pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uAreaY - pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uBufferHeight; | |
542 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; | |
543 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 | 544 if (dst_x < v106.uViewportX) |
545 { | |
546 v18 = v106.uViewportX - dst_x; | |
547 dst_x = v106.uViewportX; | |
548 v107 = v18; | |
549 } | |
550 if (dst_y < v106.uViewportY) | |
551 { | |
552 v19 = v106.uViewportY - dst_y; | |
553 dst_y = v106.uViewportY; | |
554 i = v19; | |
555 } | |
556 if (dst_z > v106.uViewportZ) | |
557 dst_z = v106.uViewportZ; | |
558 if (dst_w > v106.uViewportW) | |
559 dst_w = v106.uViewportW; | |
560 pRenderer->FillRectFast(v106.uViewportX, v106.uViewportY, v106.uViewportZ - v106.uViewportX, v106.uViewportW - v106.uViewportY, pRenderer->uTargetBMask | pRenderer->uTargetGMask); | |
561 pRenderer->FillRectFast(v106.uViewportX, v106.uViewportY, v106.uViewportZ - v106.uViewportX, v106.uViewportW - v106.uViewportY, pRenderer->uTargetBMask | pRenderer->uTargetGMask); | |
562 v84.left = v106.uViewportX; | |
563 v84.top = v106.uViewportY; | |
564 v84.right = v106.uViewportZ; | |
565 v84.bottom = v106.uViewportW; | |
566 ErrD3D(pRenderer->pBackBuffer4->Blt(&v84, 0, 0, 16778240u, &Dst)); | |
567 if ( pRenderer->uTargetGBits == 5 ) | |
568 { | |
569 __debugbreak(); // no monster popup for r5g5b5 yet | |
570 memset(&pDesc, 0, 0x7Cu); | |
571 pDesc.dwSize = 124; | |
1699 | 572 if ( pRenderer->LockSurface_DDraw4(pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].pTextureSurface, &pDesc, DDLOCK_WAIT)) |
573 { | |
574 v20 = (char *)dst_y; | |
575 v110 = pDesc.lpSurface; | |
576 if (dst_y < dst_w) | |
577 { | |
578 v21 = dst_x; | |
579 v22 = &pRenderer->pTargetSurface[dst_y * pRenderer->uTargetSurfacePitch + dst_x]; | |
580 auto _v22_2 = v22; | |
581 v23 = i - dst_y; | |
582 v115 = i - dst_y; | |
583 while ( 1 ) | |
584 { | |
585 dst_y = v21; | |
586 if ( v21 < dst_z ) | |
587 { | |
588 v25 = v107 - v21; | |
589 v109 = (int)&v20[v23]; | |
590 for ( i = v107 - v21; ; v25 = i ) | |
591 { | |
592 v108 = (unsigned __int16 *)((pDesc.lPitch >> 1) * pDesc.dwHeight * v109 / pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uAreaHeight); | |
593 v26 = (char *)v108 + pDesc.dwWidth * (v25 + dst_y++) / pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uAreaWidth; | |
594 *v22 = *((short *)v110 + (int)v26); | |
595 ++v22; | |
596 if ( dst_y >= dst_z ) | |
597 break; | |
598 } | |
599 v23 = v115; | |
600 } | |
601 v22 = (unsigned __int16 *)((char *)_v22_2 + 2 * pRenderer->uTargetSurfacePitch); | |
602 _v22_2 = v22; | |
603 v20 = (char *)(dst_y + 1); | |
604 v28 = __OFSUB__(dst_y + 1, dst_w); | |
605 v27 = (signed int)(dst_y++ + 1 - dst_w) < 0; | |
606 if ( !(v27 ^ v28) ) | |
607 break; | |
608 v21 = dst_x; | |
609 } | |
610 } | |
611 pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].pTextureSurface->Unlock(0); | |
612 } | |
1298 | 613 } |
1699 | 614 else |
615 { | |
616 memset(&pDesc, 0, 0x7Cu); | |
617 pDesc.dwSize = 124; | |
618 if ( pRenderer->LockSurface_DDraw4(pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].pTextureSurface, &pDesc, DDLOCK_WAIT) ) | |
619 { | |
620 auto src = (unsigned __int16 *)pDesc.lpSurface; | |
621 uint num_top_scanlines_above_frame_y = i - dst_y; | |
622 for (uint y = dst_y; y < dst_w; ++y) | |
623 { | |
624 auto dst = &pRenderer->pTargetSurface[y * pRenderer->uTargetSurfacePitch + dst_x]; | |
1298 | 625 |
1699 | 626 uint src_y = num_top_scanlines_above_frame_y + y; |
627 for (uint x = dst_x; x < dst_z; ++x) | |
628 { | |
629 uint src_x = v107 - dst_x + x; // num scanlines left to frame_x + current x | |
1298 | 630 |
1699 | 631 uint idx = pDesc.dwHeight * src_y / pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uAreaHeight * (pDesc.lPitch / sizeof(short)) + |
632 pDesc.dwWidth * src_x / pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uAreaWidth; | |
633 uint b = src[idx] & 0x1F; | |
634 *dst++ = b | 2 * (src[idx] & 0xFFE0); | |
635 } | |
636 } | |
637 pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].pTextureSurface->Unlock(0); | |
638 } | |
639 } | |
1298 | 640 } |
641 else | |
642 { | |
643 pRenderer->FillRectFast(v106.uViewportX, v106.uViewportY, v106.uViewportZ - v106.uViewportX, v106.uViewportW - v106.uViewportY, 0); | |
1699 | 644 if ( v10->pHwSpriteIDs[0] >= 0 ) |
645 pSprites_LOD->pSpriteHeaders[v10->pHwSpriteIDs[0]].DrawSprite_sw(&v106, 0); | |
1298 | 646 } |
1705 | 647 //name and profession |
1699 | 648 if ( pActors[uActorID].sNPC_ID ) |
1298 | 649 { |
1699 | 650 if (GetNPCData(pActors[uActorID].sNPC_ID)->uProfession) |
651 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 | |
652 else | |
1705 | 653 strncpy(pTmpBuf.data(), GetNPCData(pActors[uActorID].sNPC_ID)->pName, 2000); |
1298 | 654 } |
655 else | |
656 { | |
1699 | 657 if ( pActors[uActorID].dword_000334_unique_name ) |
1705 | 658 strncpy(pTmpBuf.data(), pMonsterStats->pPlaceStrings[pActors[uActorID].dword_000334_unique_name], 2000); |
1298 | 659 else |
1705 | 660 strncpy(pTmpBuf.data(), pMonsterStats->pInfos[pActors[uActorID].pMonsterInfo.uID].pName, 2000); |
1298 | 661 } |
1699 | 662 window->DrawTitleText(pFontComic, 0, 0xCu, TargetColor(0xFFu, 0xFFu, 0x9Bu), pTmpBuf.data(), 3); |
1705 | 663 //health bar |
1699 | 664 Actor::DrawHealthBar(&pActors[uActorID], window); |
1705 | 665 |
666 normal_level = 0; | |
667 expert_level = 0; | |
668 master_level = 0; | |
669 grandmaster_level = 0; | |
1298 | 670 pMonsterInfoUI_Doll.uCurrentActionTime += pMiscTimer->uTimeElapsed; |
671 v115 = 0; | |
672 if ( !uActiveCharacter ) | |
673 v45 = 1; | |
674 else | |
675 { | |
1705 | 676 int i = pPlayers[uActiveCharacter]->GetActualSkillLevel(PLAYER_SKILL_MONSTER_ID); |
677 if ( !i ) | |
1699 | 678 v45 = 1; |
679 else | |
680 { | |
1705 | 681 v41 = (unsigned __int8)i & 0x3F; |
682 v42 = SkillToMastery(i) - 1; | |
683 if ( !v42 )//not master | |
1699 | 684 { |
685 if ( v41 + 10 >= pActors[uActorID].pMonsterInfo.uLevel ) | |
686 { | |
687 v45 = 1; | |
1705 | 688 normal_level = 1; |
1699 | 689 } |
690 else | |
691 v45 = 1; | |
692 } | |
1705 | 693 else//he is master |
1699 | 694 { |
695 v43 = v42 - 1; | |
696 if ( !v43 ) | |
697 { | |
698 if ( 2 * v41 + 10 >= pActors[uActorID].pMonsterInfo.uLevel ) | |
699 { | |
700 v45 = 1; | |
1705 | 701 normal_level = 1; |
702 expert_level = 1; | |
1699 | 703 } |
704 else | |
705 v45 = 1; | |
706 } | |
707 else | |
708 { | |
709 v44 = v43 - 1; | |
710 if ( !v44 ) | |
711 { | |
712 if ( 3 * v41 + 10 >= pActors[uActorID].pMonsterInfo.uLevel ) | |
713 { | |
714 v45 = 1; | |
1705 | 715 normal_level = 1; |
716 expert_level = 1; | |
717 master_level = 1; | |
1699 | 718 } |
719 else | |
720 v45 = 1; | |
721 } | |
722 else | |
723 { | |
724 if ( v44 != 1 ) | |
725 v45 = 1; | |
726 else | |
727 { | |
728 v45 = 1; | |
1705 | 729 normal_level = 1; |
730 expert_level = 1; | |
731 master_level = 1; | |
732 grandmaster_level = 1; | |
1699 | 733 } |
734 } | |
735 } | |
736 } | |
737 } | |
738 if ( pActors[uActorID].uAIState != Dead | |
739 && pActors[uActorID].uAIState != Dying | |
1705 | 740 && !dword_507BF0_is_there_popup_onscreen && i ) |
1699 | 741 { |
1705 | 742 if ( normal_level | expert_level | master_level | grandmaster_level ) |
1699 | 743 { |
744 if ( pActors[uActorID].pMonsterInfo.uLevel >= pPlayers[uActiveCharacter]->uLevel - 5 ) | |
745 v73 = SPEECH_105; | |
746 else | |
747 v73 = SPEECH_104; | |
748 } | |
749 else | |
750 v73 = SPEECH_106; | |
751 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)v73, 0); | |
752 } | |
1298 | 753 } |
754 | |
1705 | 755 if ( (signed int)SkillToMastery(pParty->pPlayers[uActiveCharacter].GetActualSkillLevel(PLAYER_SKILL_MONSTER_ID)) >= 3 ) |
756 v115 = v45; | |
757 | |
758 if ( monster_full_informations == true ) | |
1298 | 759 { |
1705 | 760 normal_level = 1;// |
761 expert_level = 1;// | |
762 master_level = 1;// | |
763 grandmaster_level = 1;// | |
764 v115 = 1; | |
1298 | 765 } |
766 | |
1705 | 767 window->DrawText(pFontSmallnum, 12, 196, TargetColor(0xE1u, 255, 0x9Bu), pGlobalTXT_LocalizationStrings[631], 0, 0, 0);//Effects |
1298 | 768 if ( !v115 ) |
1705 | 769 window->DrawText(pFontSmallnum, 28, LOBYTE(pFontSmallnum->uFontHeight) + 193, TargetColor(0xE1u, 255, 0x9Bu), pGlobalTXT_LocalizationStrings[630], 0, 0, 0);//? |
1298 | 770 else |
771 { | |
1705 | 772 pText = ""; |
773 pTextHeight = LOBYTE(pFontSmallnum->uFontHeight) + 193; | |
774 for ( uint i = 1; i <= 21; ++i ) | |
775 { | |
776 if ( pActors[uActorID].pActorBuffs[i].uExpireTime > 0 ) | |
777 { | |
778 switch ( i - 1 ) | |
779 { | |
780 case 0: | |
781 pTextColorID = 60; | |
782 pText = pGlobalTXT_LocalizationStrings[591];//Charmed | |
783 break; | |
784 case 1: | |
785 pTextColorID = 82; | |
786 pText = pGlobalTXT_LocalizationStrings[649];//Summoned | |
787 break; | |
788 case 2: | |
789 pTextColorID = 92; | |
790 pText = pGlobalTXT_LocalizationStrings[592];//Shrunk | |
791 break; | |
792 case 3: | |
793 pTextColorID = 63; | |
794 pText = pGlobalTXT_LocalizationStrings[4];//Afraid | |
795 break; | |
796 case 4: | |
797 pText = pGlobalTXT_LocalizationStrings[220];//Stoned | |
798 pTextColorID = 81; | |
799 break; | |
800 case 5: | |
801 pText = pGlobalTXT_LocalizationStrings[162];//Paralyzed | |
802 pTextColorID = 81; | |
803 break; | |
804 case 6: | |
805 pText = pGlobalTXT_LocalizationStrings[593];//Slowed | |
806 pTextColorID = 35; | |
807 break; | |
808 case 8: | |
809 pText = pGlobalTXT_LocalizationStrings[608];//Berserk | |
810 pTextColorID = 62; | |
811 break; | |
812 case 7: | |
813 case 9: | |
814 pText = ""; | |
815 pTextColorID = 0; | |
816 continue; | |
817 case 10: | |
818 pTextColorID = 47; | |
819 pText = pGlobalTXT_LocalizationStrings[221];//Fate | |
820 break; | |
821 case 11: | |
822 pTextColorID = 66; | |
823 pText = pGlobalTXT_LocalizationStrings[607];//Enslaved | |
824 break; | |
825 case 12: | |
826 pTextColorID = 85; | |
827 pText = pGlobalTXT_LocalizationStrings[610];//Day of Protection | |
828 break; | |
829 case 13: | |
830 pTextColorID = 86; | |
831 pText = pGlobalTXT_LocalizationStrings[609];//Hour of Power | |
832 break; | |
833 case 14: | |
834 pTextColorID = 17; | |
835 pText = pGlobalTXT_LocalizationStrings[279];//Shield | |
836 break; | |
837 case 15: | |
838 pTextColorID = 38; | |
839 pText = pGlobalTXT_LocalizationStrings[442];//Stoneskin | |
840 break; | |
841 case 16: | |
842 pTextColorID = 46; | |
843 pText = pGlobalTXT_LocalizationStrings[443];//Bless | |
844 break; | |
845 case 17: | |
846 pTextColorID = 51; | |
847 pText = pGlobalTXT_LocalizationStrings[440];//Heroism | |
848 break; | |
849 case 18: | |
850 pTextColorID = 5; | |
851 pText = pGlobalTXT_LocalizationStrings[441];//Haste | |
852 break; | |
853 case 19: | |
854 pTextColorID = 95; | |
855 pText = pGlobalTXT_LocalizationStrings[229];//Pain Reflection | |
856 break; | |
857 case 20: | |
858 pTextColorID = 73; | |
859 pText = pGlobalTXT_LocalizationStrings[228];//Hammerhands | |
860 break; | |
861 default: | |
862 pText = ""; | |
863 break; | |
864 } | |
865 if ( pText != "" ) | |
866 { | |
867 window->DrawText(pFontSmallnum, 28, pTextHeight, GetSpellColor(pTextColorID), pText, 0, 0, 0); | |
868 pTextHeight = pTextHeight + *(char *)((int)pFontSmallnum + 5) - 3; | |
869 } | |
870 } | |
871 } | |
872 if ( pText == "" ) | |
873 window->DrawText(pFontSmallnum, 28, pTextHeight, TargetColor(0xE1u, 255, 0x9Bu), pGlobalTXT_LocalizationStrings[153], 0, 0, 0);//Нет | |
874 } | |
1298 | 875 |
1705 | 876 if ( normal_level ) |
1298 | 877 { |
1699 | 878 sprintf(pTmpBuf.data(), "%s\f%05u\t100%d\n", pGlobalTXT_LocalizationStrings[108], 0, pActors[uActorID].pMonsterInfo.uHP); |
1705 | 879 window->DrawText(pFontSmallnum, 150, (int)v106.uViewportY, TargetColor(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0); |
880 pTextHeight = v106.uViewportY + LOBYTE(pFontSmallnum->uFontHeight) - 3; | |
881 sprintf(pTmpBuf.data(), "%s\f%05u\t100%d\n", pGlobalTXT_LocalizationStrings[12], 0, pActors[uActorID].pMonsterInfo.uAC);//Armor Class | |
1298 | 882 } |
883 else | |
884 { | |
1705 | 885 sprintf(pTmpBuf.data(), "%s\f%05u\t100%s\n", pGlobalTXT_LocalizationStrings[108], 0, pGlobalTXT_LocalizationStrings[630]);//? |
886 window->DrawText(pFontSmallnum, 150, (int)v106.uViewportY, TargetColor(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0); | |
887 pTextHeight = v106.uViewportY + LOBYTE(pFontSmallnum->uFontHeight) - 3; | |
888 sprintf(pTmpBuf.data(), "%s\f%05u\t100%s\n", pGlobalTXT_LocalizationStrings[12], 0, (unsigned int)pGlobalTXT_LocalizationStrings[630]);//? | |
1298 | 889 } |
1705 | 890 window->DrawText(pFontSmallnum, 150, pTextHeight, TargetColor(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0); |
891 pTextHeight = pTextHeight + LOBYTE(pFontSmallnum->uFontHeight) - 6 + LOBYTE(pFontSmallnum->uFontHeight); | |
892 | |
893 content[0] = pGlobalTXT_LocalizationStrings[87]; | |
894 content[1] = pGlobalTXT_LocalizationStrings[6]; | |
895 content[2] = pGlobalTXT_LocalizationStrings[240]; | |
896 content[3] = pGlobalTXT_LocalizationStrings[70]; | |
897 content[4] = pGlobalTXT_LocalizationStrings[624]; | |
898 content[5] = pGlobalTXT_LocalizationStrings[138]; | |
899 content[6] = pGlobalTXT_LocalizationStrings[214]; | |
900 content[7] = pGlobalTXT_LocalizationStrings[142]; | |
901 content[8] = pGlobalTXT_LocalizationStrings[29]; | |
902 content[9] = pGlobalTXT_LocalizationStrings[133]; | |
903 content[10] = pGlobalTXT_LocalizationStrings[54]; | |
904 | |
905 if ( expert_level ) | |
1298 | 906 { |
1705 | 907 sprintf(pTmpBuf.data(), "%s\f%05u\t080%s\n", pGlobalTXT_LocalizationStrings[18], 0, content[pActors[uActorID].pMonsterInfo.uAttack1Type]);//Attack |
908 window->DrawText(pFontSmallnum, 150, (int)pTextHeight, TargetColor(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0); | |
909 pTextHeight = pTextHeight + LOBYTE(pFontSmallnum->uFontHeight) - 3; | |
910 if ( pActors[uActorID].pMonsterInfo.uAttack1DamageBonus ) | |
1298 | 911 sprintf(pTmpBuf.data(), "%s\f%05u\t080%dd%d+%d\n", pGlobalTXT_LocalizationStrings[53], |
1705 | 912 0, pActors[uActorID].pMonsterInfo.uAttack1DamageDiceRolls, pActors[uActorID].pMonsterInfo.uAttack1DamageDiceSides, pActors[uActorID].pMonsterInfo.uAttack1DamageBonus); |
1298 | 913 else |
914 sprintf(pTmpBuf.data(), "%s\f%05u\t080%dd%d\n", pGlobalTXT_LocalizationStrings[53], | |
1699 | 915 0, pActors[uActorID].pMonsterInfo.uAttack1DamageDiceRolls, pActors[uActorID].pMonsterInfo.uAttack1DamageDiceSides); |
1298 | 916 } |
917 else | |
918 { | |
919 sprintf(pTmpBuf.data(), "%s\f%05u\t080%s\n", pGlobalTXT_LocalizationStrings[18], 0, pGlobalTXT_LocalizationStrings[630]); | |
1705 | 920 window->DrawText(pFontSmallnum, 150, (int)pTextHeight, TargetColor(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0); |
921 pTextHeight = pTextHeight + LOBYTE(pFontSmallnum->uFontHeight) - 3; | |
1298 | 922 sprintf(pTmpBuf.data(), "%s\f%05u\t080%s\n", pGlobalTXT_LocalizationStrings[53], 0, pGlobalTXT_LocalizationStrings[630]); |
923 } | |
1705 | 924 window->DrawText(pFontSmallnum, 150, pTextHeight, TargetColor(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0); |
925 pTextHeight = pTextHeight + LOBYTE(pFontSmallnum->uFontHeight) - 6 + LOBYTE(pFontSmallnum->uFontHeight); | |
926 | |
927 if ( !master_level ) | |
1298 | 928 { |
1705 | 929 sprintf(pTmpBuf.data(), "%s\f%05u\t080%s\n", pGlobalTXT_LocalizationStrings[628], 0, pGlobalTXT_LocalizationStrings[630]);//"Spell" "?" |
930 window->DrawText(pFontSmallnum, 150, (int)pTextHeight, TargetColor(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0); | |
931 pTextHeight = pTextHeight + LOBYTE(pFontSmallnum->uFontHeight) - 3; | |
1298 | 932 } |
933 else | |
934 { | |
1705 | 935 pText = pGlobalTXT_LocalizationStrings[628];//Spell |
936 if ( pActors[uActorID].pMonsterInfo.uSpell1ID && pActors[uActorID].pMonsterInfo.uSpell2ID ) | |
937 pText = pGlobalTXT_LocalizationStrings[629];//Spells | |
938 if ( pActors[uActorID].pMonsterInfo.uSpell1ID ) | |
939 { | |
940 sprintf(pTmpBuf.data(), "%s\f%05u\t070%s\n", pText, 0, pSpellStats->pInfos[pActors[uActorID].pMonsterInfo.uSpell1ID].pShortName); | |
941 window->DrawText(pFontSmallnum, 150, (int)pTextHeight, TargetColor(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0); | |
942 pTextHeight = pTextHeight + LOBYTE(pFontSmallnum->uFontHeight) - 3; | |
943 } | |
944 if ( pActors[uActorID].pMonsterInfo.uSpell2ID ) | |
945 { | |
946 sprintf(pTmpBuf.data(), "\f%05u\t070%s\n", 0, pSpellStats->pInfos[pActors[uActorID].pMonsterInfo.uSpell2ID].pShortName); | |
947 window->DrawText(pFontSmallnum, 150, (int)pTextHeight, TargetColor(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0); | |
948 pTextHeight = pTextHeight + LOBYTE(pFontSmallnum->uFontHeight) - 3; | |
949 } | |
950 if ( !pActors[uActorID].pMonsterInfo.uSpell1ID && !pActors[uActorID].pMonsterInfo.uSpell2ID ) | |
951 { | |
952 sprintf(pTmpBuf.data(), "%s\f%05u\t070%s\n", pGlobalTXT_LocalizationStrings[628], 0, pGlobalTXT_LocalizationStrings[153]); | |
953 window->DrawText(pFontSmallnum, 150, (int)pTextHeight, TargetColor(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0); | |
954 pTextHeight = pTextHeight + LOBYTE(pFontSmallnum->uFontHeight) - 3; | |
955 } | |
1298 | 956 } |
1705 | 957 pTextHeight = pTextHeight + LOBYTE(pFontSmallnum->uFontHeight) - 3; |
958 window->DrawText(pFontSmallnum, 150, pTextHeight, TargetColor(0xE1u, 255, 0x9Bu), pGlobalTXT_LocalizationStrings[626], 0, 0, 0);//Immune | |
959 pTextHeight = pTextHeight + LOBYTE(pFontSmallnum->uFontHeight) - 3; | |
960 | |
961 string_name[0] = pGlobalTXT_LocalizationStrings[87];//Fire | |
962 string_name[1] = pGlobalTXT_LocalizationStrings[6];//Air | |
963 string_name[2] = pGlobalTXT_LocalizationStrings[240]; | |
964 string_name[3] = pGlobalTXT_LocalizationStrings[70]; | |
965 string_name[4] = pGlobalTXT_LocalizationStrings[142]; | |
966 string_name[5] = pGlobalTXT_LocalizationStrings[214]; | |
967 string_name[6] = pGlobalTXT_LocalizationStrings[29]; | |
968 string_name[7] = pGlobalTXT_LocalizationStrings[133]; | |
969 string_name[8] = pGlobalTXT_LocalizationStrings[54]; | |
970 string_name[9] = pGlobalTXT_LocalizationStrings[624]; | |
971 | |
972 content[0] = (char *)pActors[uActorID].pMonsterInfo.uResFire; | |
973 content[1] = (char *)pActors[uActorID].pMonsterInfo.uResAir; | |
974 content[2] = (char *)pActors[uActorID].pMonsterInfo.uResWater; | |
975 content[3] = (char *)pActors[uActorID].pMonsterInfo.uResEarth; | |
976 content[4] = (char *)pActors[uActorID].pMonsterInfo.uResMind; | |
977 content[5] = (char *)pActors[uActorID].pMonsterInfo.uResSpirit; | |
978 content[6] = (char *)pActors[uActorID].pMonsterInfo.uResBody; | |
979 content[7] = (char *)pActors[uActorID].pMonsterInfo.uResLight; | |
980 content[8] = (char *)pActors[uActorID].pMonsterInfo.uResPhysical; | |
981 content[9] = (char *)pActors[uActorID].pMonsterInfo.uResDark; | |
982 | |
983 if ( grandmaster_level ) | |
1298 | 984 { |
1705 | 985 for ( uint i = 0; i < 10; i++ ) |
1298 | 986 { |
1705 | 987 if ( content[i] == (char *)200 ) |
1298 | 988 { |
1705 | 989 pText = pGlobalTXT_LocalizationStrings[625];//Immune |
1298 | 990 } |
991 else | |
992 { | |
1705 | 993 if ( content[i] ) |
994 pText = pGlobalTXT_LocalizationStrings[627];//Resistant | |
1298 | 995 else |
1705 | 996 pText = pGlobalTXT_LocalizationStrings[153];//None |
1298 | 997 } |
1705 | 998 sprintf(pTmpBuf.data(), "%s\f%05u\t070%s\n", string_name[i], 0, pText); |
999 window->DrawText(pFontSmallnum, 170, pTextHeight, TargetColor(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0); | |
1000 pTextHeight = pTextHeight + LOBYTE(pFontSmallnum->uFontHeight) - 3; | |
1298 | 1001 } |
1002 } | |
1003 else | |
1004 { | |
1705 | 1005 for ( uint i = 0; i < 10; ++i ) |
1298 | 1006 { |
1705 | 1007 sprintf(pTmpBuf.data(), "%s\f%05u\t070%s\n", string_name[i], 0, pGlobalTXT_LocalizationStrings[630]); // "?" |
1008 window->DrawText(pFontSmallnum, 170, pTextHeight, TargetColor(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0); | |
1009 pTextHeight = pTextHeight + LOBYTE(pFontSmallnum->uFontHeight) - 3; | |
1298 | 1010 } |
1011 } | |
1012 if ( (signed __int64)pParty->pPartyBuffs[PARTY_BUFF_DETECT_LIFE].uExpireTime > 0 ) | |
1013 { | |
1705 | 1014 sprintf(pTmpBuf.data(), "%s: %d", pGlobalTXT_LocalizationStrings[650], pActors[uActorID].sCurrentHP);//Current Hit Points |
1298 | 1015 pFontSmallnum->GetLineWidth(pTmpBuf.data()); |
1699 | 1016 window->DrawTitleText(pFontSmallnum, 0, window->uFrameHeight - LOBYTE(pFontSmallnum->uFontHeight) - 12, 0, pTmpBuf.data(), 3); |
1298 | 1017 } |
1018 } | |
1019 | |
1020 | |
1021 //----- (00417BB5) -------------------------------------------------------- | |
1022 const char *CharacterUI_GetSkillDescText(unsigned int uPlayerID, PLAYER_SKILL_TYPE uPlayerSkillType) | |
1023 { | |
1024 //enum PLAYER_SKILL_TYPE v2; // esi@1 | |
1025 //unsigned int v3; // ebx@1 | |
1026 int v4; // edi@1 | |
1027 int v5; // eax@1 | |
1028 Player *pPlayer; // ebx@7 | |
1029 char v7; // al@7 | |
1030 char v8; // cl@7 | |
1031 unsigned int v9; // eax@8 | |
1032 unsigned int v10; // eax@8 | |
1033 unsigned int v11; // eax@8 | |
1034 PLAYER_SKILL_TYPE v12; // edi@8 | |
1035 unsigned int v13; // eax@8 | |
1036 unsigned int v14; // eax@8 | |
1037 PLAYER_SKILL_TYPE v15; // esi@8 | |
1038 int v16; // edi@8 | |
1039 char v17; // al@8 | |
1040 int v18; // ST5C_4@8 | |
1041 int v19; // ST4C_4@8 | |
1042 int v20; // ST3C_4@8 | |
1043 int v21; // ST2C_4@8 | |
1044 int v22; // ST1C_4@8 | |
1045 char *v23; // esi@8 | |
1046 unsigned int v24; // eax@9 | |
1047 unsigned int v25; // eax@9 | |
1048 unsigned int v26; // eax@9 | |
1049 unsigned int v27; // ecx@9 | |
1050 PLAYER_SKILL_TYPE v28; // ebx@9 | |
1051 unsigned int v29; // eax@9 | |
1052 char a2[1200]; // [sp+Ch] [bp-538h]@7 | |
1053 char Source[120]; // [sp+4BCh] [bp-88h]@7 | |
1054 unsigned __int16 *v33; // [sp+534h] [bp-10h]@1 | |
1055 int v34; // [sp+538h] [bp-Ch]@1 | |
1056 unsigned __int16 *v35; // [sp+53Ch] [bp-8h]@1 | |
1057 //enum PLAYER_SKILL_TYPE v36; // [sp+540h] [bp-4h]@1 | |
1058 | |
1059 //v2 = uPlayerSkillType; | |
1060 //v3 = uPlayerID; | |
1061 //v36 = uPlayerSkillType; | |
1062 v4 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[431]);// Normal | |
1063 v34 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[433]);// Expert | |
1064 v33 = (unsigned __int16 *)pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[432]);// Master | |
1065 v5 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[96]);// Grand | |
1066 v35 = (unsigned __int16 *)v4; | |
1067 if ( v34 > v4 ) | |
1068 v35 = (unsigned __int16 *)v34; | |
1069 if ( (signed int)v33 > (signed int)v35 ) | |
1070 v35 = v33; | |
1071 if ( v5 > (signed int)v35 ) | |
1072 v35 = (unsigned __int16 *)v5; | |
1073 pPlayer = &pParty->pPlayers[uPlayerID]; | |
1074 //v33 = &pPlayer->pActiveSkills[uPlayerSkillType]; | |
1075 v7 = pPlayer->GetActualSkillLevel(uPlayerSkillType); | |
1076 v8 = pPlayer->pActiveSkills[uPlayerSkillType]; | |
1077 a2[0] = 0; | |
1078 Source[0] = 0; | |
1079 if ( (v8 & 0x3F) == (v7 & 0x3F) ) | |
1080 { | |
1081 strcpy(a2, "%s\n\n"); | |
1082 v24 = GetSkillColor(pPlayer->classType, uPlayerSkillType, 1); | |
1083 sprintf(Source, "\f%05d", v24); | |
1084 strcat(a2, Source); | |
1085 strcat(a2, "%s\t%03d:\t%03d%s\t000\n"); | |
1086 v25 = GetSkillColor(pPlayer->classType, uPlayerSkillType, 2); | |
1087 sprintf(Source, "\f%05d", v25); | |
1088 strcat(a2, Source); | |
1089 strcat(a2, "%s\t%03d:\t%03d%s\t000\n"); | |
1090 v26 = GetSkillColor(pPlayer->classType, uPlayerSkillType, 3); | |
1091 sprintf(Source, "\f%05d", v26); | |
1092 strcat(a2, Source); | |
1093 strcat(a2, "%s\t%03d:\t%03d%s\t000\n"); | |
1094 v27 = pPlayer->classType; | |
1095 v28 = uPlayerSkillType; | |
1096 v29 = GetSkillColor(v27, uPlayerSkillType, 4); | |
1097 sprintf(Source, "\f%05d", v29); | |
1098 strcat(a2, Source); | |
1099 strcat(a2, "%s\t%03d:\t%03d%s\t000\n"); | |
1100 | |
1101 v23 = static_sub_417BB5_out_string; | |
1102 sprintf(static_sub_417BB5_out_string, a2, pSkillDesc[v28], pGlobalTXT_LocalizationStrings[431], // Normal | |
1103 (char *)v35 + 3, v35 + 5, pNormalSkillDesc[v28], pGlobalTXT_LocalizationStrings[433], // Expert | |
1104 (char *)v35 + 3, v35 + 5, pExpertSkillDesc[v28], pGlobalTXT_LocalizationStrings[432], // Master | |
1105 (char *)v35 + 3, v35 + 5, pMasterSkillDesc[v28], pGlobalTXT_LocalizationStrings[96], // Grand | |
1106 (char *)v35 + 3, v35 + 5, pGrandSkillDesc[v28]); | |
1107 } | |
1108 else | |
1109 { | |
1110 strcpy(a2, "%s\n\n"); | |
1111 v9 = GetSkillColor(pPlayer->classType, uPlayerSkillType, 1); | |
1112 sprintf(Source, "\f%05d", v9); | |
1113 strcat(a2, Source); | |
1114 strcat(a2, "%s\t%03d:\t%03d%s\t000\n"); | |
1115 v10 = GetSkillColor(pPlayer->classType, uPlayerSkillType, 2); | |
1116 sprintf(Source, "\f%05d", v10); | |
1117 strcat(a2, Source); | |
1118 strcat(a2, "%s\t%03d:\t%03d%s\t000\n"); | |
1119 v11 = GetSkillColor(pPlayer->classType, uPlayerSkillType, 3); | |
1120 sprintf(Source, "\f%05d", v11); | |
1121 strcat(a2, Source); | |
1122 strcat(a2, "%s\t%03d:\t%03d%s\t000\n"); | |
1123 v12 = uPlayerSkillType; | |
1124 v13 = GetSkillColor(pPlayer->classType, uPlayerSkillType, 4); | |
1125 sprintf(Source, "\f%05d", v13); | |
1126 strcat(a2, Source); | |
1127 strcat(a2, "%s\t%03d:\t%03d%s\t000\n\n"); | |
1128 v14 = TargetColor(0xFFu, 0xFFu, 0xFFu); | |
1129 sprintf(Source, "\f%05d", v14); | |
1130 strcat(a2, Source); | |
1131 strcat(a2, "%s: +%d"); | |
1132 v15 = v12; | |
1133 v16 = (int)(v35 + 5); | |
1134 v15 = (PLAYER_SKILL_TYPE)((int)v15 * 4); | |
1135 v34 = (int)((char *)v35 + 3); | |
1136 v17 = pPlayer->GetActualSkillLevel(uPlayerSkillType); | |
1137 v18 = *(int *)(pGrandSkillDesc[v15]); | |
1138 v19 = *(int *)(pMasterSkillDesc[v15]); | |
1139 v20 = *(int *)(pExpertSkillDesc[v15]); | |
1140 v21 = *(int *)(pNormalSkillDesc[v15]); | |
1141 v22 = *(int *)(pSkillDesc[v15]); | |
1142 v23 = static_sub_417BB5_out_string; | |
1143 sprintf( | |
1144 static_sub_417BB5_out_string, | |
1145 a2, | |
1146 v22, | |
1147 pGlobalTXT_LocalizationStrings[431], | |
1148 v34, | |
1149 v16, | |
1150 v21, | |
1151 pGlobalTXT_LocalizationStrings[433], | |
1152 v34, | |
1153 v16, | |
1154 v20, | |
1155 pGlobalTXT_LocalizationStrings[432], | |
1156 v34, | |
1157 v16, | |
1158 v19, | |
1159 pGlobalTXT_LocalizationStrings[96], | |
1160 v34, | |
1161 v16, | |
1162 v18, | |
1163 pGlobalTXT_LocalizationStrings[623], | |
1164 (v17 & 0x3F) - (*(char *)v33 & 0x3F)); | |
1165 } | |
1166 return v23; | |
1167 } | |
1168 | |
1169 //----- (00417FE5) -------------------------------------------------------- | |
1170 void CharacterUI_SkillsTab_ShowHint() | |
1171 { | |
1172 unsigned int v0; // ecx@1 | |
1173 unsigned int v1; // eax@1 | |
1174 GUIButton *i; // esi@6 | |
1175 const char *v3; // eax@12 | |
1176 unsigned int pX; // [sp+4h] [bp-8h]@1 | |
1177 unsigned int pY; // [sp+8h] [bp-4h]@1 | |
1178 | |
1179 pMouse->GetClickPos(&pX, &pY); | |
1180 v0 = pX; | |
1181 v1 = pY; | |
1182 if ( (signed int)pX < 24 || (signed int)pX > 455 || (signed int)pY < 18 || (signed int)pY > 36 ) | |
1183 { | |
1184 for ( i = pGUIWindow_CurrentMenu->pControlsHead; i; i = i->pNext ) | |
1185 { | |
1186 if ( i->msg == UIMSG_SkillUp | |
1187 && (signed int)v0 >= (signed int)i->uX | |
1188 && (signed int)v0 <= (signed int)i->uZ | |
1189 && (signed int)v1 >= (signed int)i->uY | |
1190 && (signed int)v1 <= (signed int)i->uW ) | |
1191 { | |
1192 v3 = CharacterUI_GetSkillDescText(uActiveCharacter - 1, (PLAYER_SKILL_TYPE)i->msg_param); | |
1393 | 1193 CharacterUI_DrawTooltip(pSkillNames[i->msg_param], v3); |
1298 | 1194 v1 = pY; |
1195 v0 = pX; | |
1196 } | |
1197 } | |
1198 } | |
1199 else | |
1200 { | |
1393 | 1201 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[207], pSkillPointsAttributeDescription); |
1298 | 1202 } |
1203 | |
1204 } | |
1205 | |
1206 //----- (00418083) -------------------------------------------------------- | |
1458 | 1207 void CharacterUI_StatsTab_ShowHint() |
1393 | 1208 { |
1298 | 1209 int pStringNum; // edi@1 |
1210 signed int pTextColor; // eax@15 | |
1211 char *pHourWord; // ecx@17 | |
1212 char *pDayWord; // eax@20 | |
1213 int v15; // ebx@28 | |
1214 int v16; // eax@33 | |
1215 POINT a2; // [sp+Ch] [bp-24h]@1 | |
1216 int pHour; // [sp+14h] [bp-1Ch]@15 | |
1217 unsigned int pDay; // [sp+24h] [bp-Ch]@15 | |
1218 | |
1393 | 1219 pMouse->GetCursorPos(&a2); |
1220 for ( pStringNum = 0; pStringNum < stat_string_coord.size(); ++pStringNum ) | |
1298 | 1221 { |
1393 | 1222 if (a2.x >= stat_string_coord[pStringNum].x && a2.x <= stat_string_coord[pStringNum].x + stat_string_coord[pStringNum].width ) |
1298 | 1223 { |
1393 | 1224 if (a2.y >= stat_string_coord[pStringNum].y && a2.y <= stat_string_coord[pStringNum].y + stat_string_coord[pStringNum].height ) |
1298 | 1225 break; |
1226 } | |
1227 } | |
1393 | 1228 |
1298 | 1229 switch ( pStringNum ) |
1230 { | |
1231 case 0:// Attributes | |
1232 case 1: | |
1233 case 2: | |
1234 case 3: | |
1235 case 4: | |
1236 case 5: | |
1237 case 6: | |
1238 if ( aAttributeNames[pStringNum] && pAttributeDescriptions[pStringNum] ) | |
1393 | 1239 CharacterUI_DrawTooltip(aAttributeNames[pStringNum], pAttributeDescriptions[pStringNum]); |
1298 | 1240 break; |
1241 case 7:// Health Points | |
1242 if ( pGlobalTXT_LocalizationStrings[108] && pHealthPointsAttributeDescription ) | |
1393 | 1243 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[108], pHealthPointsAttributeDescription); |
1298 | 1244 break; |
1245 case 8:// Spell Points | |
1246 if ( pGlobalTXT_LocalizationStrings[212] && pSpellPointsAttributeDescription ) | |
1393 | 1247 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[212], pSpellPointsAttributeDescription); |
1298 | 1248 break; |
1249 case 9:// Armor Class | |
1250 if ( pGlobalTXT_LocalizationStrings[12] && pArmourClassAttributeDescription ) | |
1393 | 1251 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[12], pArmourClassAttributeDescription); |
1298 | 1252 break; |
1253 case 10:// Player Condition | |
1254 strcpy(pTmpBuf2.data(), pPlayerConditionAttributeDescription); | |
1255 strcat(pTmpBuf2.data(), "\n"); | |
1256 extern std::array<unsigned int, 18> pConditionImportancyTable; | |
1257 for ( uint i = 0; i < 18; ++i ) | |
1258 { | |
1259 if ( pPlayers[uActiveCharacter]->pConditions[pConditionImportancyTable[i]] ) | |
1260 { | |
1261 strcat(pTmpBuf2.data(), " \n"); | |
1262 pHour = pParty->uTimePlayed - pPlayers[uActiveCharacter]->pConditions[pConditionImportancyTable[i]]; | |
1263 pHour = (unsigned int)((pHour * 0.234375) / 60 / 60); | |
1264 pDay = (unsigned int)pHour / 24; | |
1265 pHour %= 24i64; | |
1266 pTextColor = GetConditionDrawColor(pConditionImportancyTable[i]); | |
1267 sprintfex(pTmpBuf.data(), format_4E2DE8, pTextColor, aCharacterConditionNames[pConditionImportancyTable[i]]); | |
1268 strcat(pTmpBuf2.data(), pTmpBuf.data()); | |
1269 if ( pHour && pHour <= 1 ) | |
1270 pHourWord = pGlobalTXT_LocalizationStrings[109]; | |
1271 else | |
1272 pHourWord = pGlobalTXT_LocalizationStrings[110]; | |
1273 if ( !pDay || (pDayWord = pGlobalTXT_LocalizationStrings[56], pDay > 1) ) | |
1274 pDayWord = pGlobalTXT_LocalizationStrings[57]; | |
1275 sprintfex(pTmpBuf.data(), "%lu %s, %lu %s", pDay, pDayWord, pHour, pHourWord); | |
1276 strcat(pTmpBuf2.data(), pTmpBuf.data()); | |
1277 } | |
1278 } | |
1279 if ( pGlobalTXT_LocalizationStrings[47] && pTmpBuf2.data() ) | |
1393 | 1280 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[47], pTmpBuf2.data()); |
1298 | 1281 break; |
1282 case 11:// Fast Spell | |
1283 if ( pGlobalTXT_LocalizationStrings[172] && pFastSpellAttributeDescription ) | |
1393 | 1284 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[172], pFastSpellAttributeDescription); |
1298 | 1285 break; |
1286 case 12:// Player Age | |
1287 if ( pGlobalTXT_LocalizationStrings[5] && pPlayerAgeAttributeDescription ) | |
1393 | 1288 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[5], pPlayerAgeAttributeDescription); |
1298 | 1289 break; |
1290 case 13:// Player Level | |
1291 if ( pGlobalTXT_LocalizationStrings[131] && pPlayerLevelAttributeDescription ) | |
1393 | 1292 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[131], pPlayerLevelAttributeDescription); |
1298 | 1293 break; |
1294 case 14://Experience | |
1295 v15 = pPlayers[uActiveCharacter]->uLevel; | |
1296 do | |
1297 { | |
1459 | 1298 if ( (signed __int64)pPlayers[uActiveCharacter]->uExperience < (unsigned int)GetExperienceRequiredForLevel(v15) ) |
1298 | 1299 break; |
1300 ++v15; | |
1301 } | |
1302 while ( v15 <= 10000 ); | |
1303 pTmpBuf[0] = 0; | |
1304 pTmpBuf2[0] = 0; | |
1305 if ( v15 > pPlayers[uActiveCharacter]->uLevel ) | |
1306 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[147], v15); | |
1459 | 1307 v16 = GetExperienceRequiredForLevel(v15) - LODWORD(pPlayers[uActiveCharacter]->uExperience); |
1298 | 1308 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[538], v16, v15 + 1); |
1309 strcat(pTmpBuf.data(), "\n"); | |
1310 strcat(pTmpBuf.data(), pTmpBuf2.data()); | |
1311 sprintf(pTmpBuf2.data(), "%s\n \n%s", pPlayerExperienceAttributeDescription, pTmpBuf.data()); | |
1312 if ( pGlobalTXT_LocalizationStrings[83] && pTmpBuf2.data() ) | |
1393 | 1313 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[83], pTmpBuf2.data()); |
1298 | 1314 break; |
1315 case 15:// Attack Bonus | |
1316 if ( pGlobalTXT_LocalizationStrings[587] && pAttackBonusAttributeDescription ) | |
1393 | 1317 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[587], pAttackBonusAttributeDescription); |
1298 | 1318 break; |
1319 case 16:// Attack Damage | |
1320 if ( pGlobalTXT_LocalizationStrings[588] && pAttackDamageAttributeDescription ) | |
1393 | 1321 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[588], pAttackDamageAttributeDescription); |
1298 | 1322 break; |
1323 case 17:// Missle Bonus | |
1324 if ( pGlobalTXT_LocalizationStrings[589] && pMissleBonusAttributeDescription ) | |
1393 | 1325 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[589], pMissleBonusAttributeDescription); |
1298 | 1326 break; |
1327 case 18:// Missle Damage | |
1328 if ( pGlobalTXT_LocalizationStrings[590] && pMissleDamageAttributeDescription ) | |
1393 | 1329 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[590], pMissleDamageAttributeDescription); |
1298 | 1330 break; |
1331 case 19:// Fire Resistance | |
1332 if ( pGlobalTXT_LocalizationStrings[87] && pFireResistanceAttributeDescription ) | |
1393 | 1333 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[87], pFireResistanceAttributeDescription); |
1298 | 1334 break; |
1335 case 20:// Air Resistance | |
1336 if ( pGlobalTXT_LocalizationStrings[6] && pAirResistanceAttributeDescription ) | |
1393 | 1337 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[6], pAirResistanceAttributeDescription); |
1298 | 1338 break; |
1339 case 21:// Water Resistance | |
1340 if ( pGlobalTXT_LocalizationStrings[240] && pWaterResistanceAttributeDescription ) | |
1393 | 1341 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[240], pWaterResistanceAttributeDescription); |
1298 | 1342 break; |
1343 case 22:// Earth Resistance | |
1344 if ( pGlobalTXT_LocalizationStrings[70] && pEarthResistanceAttributeDescription ) | |
1393 | 1345 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[70], pEarthResistanceAttributeDescription); |
1298 | 1346 break; |
1347 case 23:// Mind Resistance | |
1348 if ( pGlobalTXT_LocalizationStrings[142] && pMindResistanceAttributeDescription ) | |
1393 | 1349 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[142], pMindResistanceAttributeDescription); |
1298 | 1350 break; |
1351 case 24:// Body Resistance | |
1352 if ( pGlobalTXT_LocalizationStrings[29] && pBodyResistanceAttributeDescription ) | |
1393 | 1353 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[29], pBodyResistanceAttributeDescription); |
1298 | 1354 break; |
1355 case 25: // Skill Points | |
1356 if ( pGlobalTXT_LocalizationStrings[207] && pSkillPointsAttributeDescription ) | |
1393 | 1357 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[207], pSkillPointsAttributeDescription); |
1298 | 1358 break; |
1393 | 1359 case 26: // Class description |
1360 { | |
1678 | 1361 if (pClassDescriptions[pPlayers[uActiveCharacter]->classType] && pClassNames[pPlayers[uActiveCharacter]->classType]) |
1362 CharacterUI_DrawTooltip(pClassNames[pPlayers[uActiveCharacter]->classType], pClassDescriptions[pPlayers[uActiveCharacter]->classType]); | |
1393 | 1363 } |
1364 break; | |
1365 | |
1298 | 1366 default: |
1367 break; | |
1368 } | |
1369 } | |
1370 | |
1371 //----- (00410B28) -------------------------------------------------------- | |
1458 | 1372 void DrawSpellDescriptionPopup(int spell_index) |
1298 | 1373 { |
1374 Player *v1; // edi@1 | |
1375 SpellInfo *v2; // esi@1 | |
1376 unsigned int v3; // eax@2 | |
1377 int v4; // eax@4 | |
1378 LONG v5; // ecx@4 | |
1379 int v6; // eax@10 | |
1380 char *v7; // ST44_4@12 | |
1381 unsigned __int16 v8; // ax@12 | |
1382 GUIWindow a1; // [sp+Ch] [bp-68h]@4 | |
1383 int v10; // [sp+60h] [bp-14h]@1 | |
1384 POINT a2; // [sp+64h] [bp-10h]@1 | |
1385 int v12; // [sp+6Ch] [bp-8h]@4 | |
1386 int v13; // [sp+70h] [bp-4h]@4 | |
1387 | |
1388 v1 = pPlayers[uActiveCharacter]; | |
1389 v10 = spell_index; | |
1390 v2 = &pSpellStats->pInfos[spell_index + 11 * v1->lastOpenedSpellbookPage + 1]; | |
1391 if ( pMouse->GetCursorPos(&a2)->y <= 250 ) | |
1392 v3 = pMouse->GetCursorPos(&a2)->y + 30; | |
1393 else | |
1394 v3 = 30; | |
1395 a1.uFrameY = v3; | |
1396 a1.uFrameWidth = 328; | |
1397 a1.uFrameHeight = 68; | |
1398 a1.uFrameX = 90; | |
1399 a1.uFrameZ = 417; | |
1400 a1.uFrameW = v3 + 67; | |
1401 a1.Hint = 0; | |
1402 a2.y = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[LOCSTR_NORMAL]); | |
1403 v13 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[LOCSTR_MASTER]); | |
1404 v12 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[LOCSTR_EXPERT]); | |
1405 v4 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[LOCSTR_GRAND]); | |
1406 v5 = a2.y; | |
1407 if ( v13 > a2.y ) | |
1408 v5 = v13; | |
1409 if ( v12 > v5 ) | |
1410 v5 = v12; | |
1411 if ( v4 > v5 ) | |
1412 v5 = v4; | |
1413 sprintf( pTmpBuf2.data(), | |
1414 "%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", | |
1415 v2->pDescription, | |
1416 pGlobalTXT_LocalizationStrings[LOCSTR_NORMAL], | |
1417 v5 + 3, v5 + 10, | |
1418 v2->pBasicSkillDesc, | |
1419 pGlobalTXT_LocalizationStrings[LOCSTR_EXPERT], | |
1420 v5 + 3, v5 + 10, | |
1421 v2->pExpertSkillDesc, | |
1422 pGlobalTXT_LocalizationStrings[LOCSTR_MASTER], | |
1423 v5 + 3, v5 + 10, | |
1424 v2->pMasterSkillDesc, | |
1425 pGlobalTXT_LocalizationStrings[LOCSTR_GRAND], | |
1426 v5 + 3, v5 + 10, | |
1427 v2->pGrandmasterSkillDesc); | |
1428 v6 = pFontSmallnum->CalcTextHeight(pTmpBuf2.data(), &a1, 0, 0); | |
1429 a1.uFrameHeight += v6; | |
1430 if ( (signed int)a1.uFrameHeight < 150 ) | |
1431 a1.uFrameHeight = 150; | |
1432 a1.uFrameWidth = game_viewport_width; | |
1433 a1.DrawMessageBox(0); | |
1434 a1.uFrameWidth -= 12; | |
1435 a1.uFrameHeight -= 12; | |
1436 v7 = v2->pName; | |
1437 a1.uFrameZ = a1.uFrameX + a1.uFrameWidth - 1; | |
1438 a1.uFrameW = a1.uFrameHeight + a1.uFrameY - 1; | |
1439 v8 = TargetColor(0xFFu, 0xFFu, 0x9Bu); | |
1440 a1.DrawTitleText(pFontArrus, 0x78u, 0xCu, v8, v7, 3u); | |
1441 a1.DrawText(pFontSmallnum, 120, 44, 0, pTmpBuf2.data(), 0, 0, 0); | |
1442 a1.uFrameWidth = 108; | |
1443 a1.uFrameZ = a1.uFrameX + 107; | |
1444 a1.DrawTitleText(pFontComic, 0xCu, 0x4Bu, 0, pSkillNames[v1->lastOpenedSpellbookPage + 12], 3u); | |
1445 sprintf( pTmpBuf.data(), "%s\n%d", pGlobalTXT_LocalizationStrings[LOCSTR_SP_COST], | |
1446 pSpellDatas[spell_index + 11 * v1->lastOpenedSpellbookPage + 1].mana_per_skill[v1->pActiveSkills[v1->lastOpenedSpellbookPage + PLAYER_SKILL_FIRE]]); | |
1447 // *(&[0].field_12 //temp_fix field_14 | |
1448 // + ((unsigned int)LOBYTE(v1->pActiveSkills[v1->lastOpenedSpellbookPage + 12]) >> 6) | |
1449 // + 10 * (int)((char *)v10 + 11 * v1->lastOpenedSpellbookPage))); | |
1450 a1.DrawTitleText(pFontComic, 0xCu, a1.uFrameHeight - LOBYTE(pFontComic->uFontHeight) - 16, 0, pTmpBuf.data(), 3u); | |
1451 dword_507B00_spell_info_to_draw_in_popup = 0; | |
1452 } | |
1453 // 507B00: using guessed type int dword_507B00_spell_info_to_draw_in_popup; | |
1454 | |
1455 | |
1456 | |
1457 | |
1458 | |
1459 //----- (00416D62) -------------------------------------------------------- | |
1460 void sub_416D62_ShowPopupWindow_MonsterRecord_ItemInfo_etcsub_416D62(Vec2_int_ *_this) | |
1461 { | |
1462 signed int pPlayerNum; // eax@12 | |
1463 char *v2; // eax@32 | |
1464 void *v3; // ecx@52 | |
1465 unsigned int v4; // eax@59 | |
1466 int v5; // esi@62 | |
1467 signed int v6; // esi@64 | |
1468 signed int v7; // esi@69 | |
1469 ItemGen *v8; // ecx@70 | |
1470 unsigned int v9; // eax@72 | |
1471 unsigned int v10; // eax@76 | |
1472 //char v11; // zf@83 | |
1473 GUIButton *pButton; // esi@84 | |
1474 unsigned int v13; // ecx@85 | |
1475 char *pStr; // edi@85 | |
1476 //signed int pControlID; // eax@92 | |
1477 int v16; // eax@95 | |
1478 int v17; // eax@96 | |
1479 PLAYER_SKILL_TYPE v18; // eax@98 | |
1480 char *pStr2; // eax@99 | |
1481 unsigned int v20; // eax@108 | |
1482 unsigned int pSkillId; // eax@109 | |
1483 const char *pSkillInfo; // eax@111 | |
1484 //char *v23; // ebx@112 | |
1485 char *pHint; // edx@113 | |
1486 unsigned int pColor; // eax@113 | |
1487 GUIWindow pWindow; // [sp+4h] [bp-74h]@32 | |
1488 double v27; // [sp+58h] [bp-20h]@33 | |
1489 struct tagPOINT Point; // [sp+60h] [bp-18h]@6 | |
1490 char *v29; // [sp+68h] [bp-10h]@33 | |
1491 float v30; // [sp+6Ch] [bp-Ch]@33 | |
1492 unsigned int pX; // [sp+70h] [bp-8h]@3 | |
1493 unsigned int pY; // [sp+74h] [bp-4h]@3 | |
1494 | |
1495 if ( pCurrentScreen == SCREEN_VIDEO ) | |
1496 return; | |
1497 if ( _this ) | |
1498 { | |
1499 pX = _this->x; | |
1500 pY = _this->y; | |
1501 } | |
1502 else | |
1503 { | |
1504 pMouse->GetClickPos(&pX, &pY); | |
1505 } | |
1506 if ( pRenderer->bWindowMode ) | |
1507 { | |
1508 GetCursorPos(&Point); | |
1509 ScreenToClient(hWnd, &Point); | |
1510 if ( Point.x < 1 || Point.y < 1 || Point.x > 638 || Point.y > 478 ) | |
1511 { | |
1512 back_to_game(); | |
1513 return; | |
1514 } | |
1515 } | |
1516 | |
1517 if ( pParty->pPickedItem.uItemID )//нажатие на портрет перса правой кнопкой мыши с раствором | |
1518 { | |
1519 //v1 = 0; | |
1520 //do | |
1521 for ( pPlayerNum = 0; pPlayerNum < 4; ++pPlayerNum) | |
1522 { | |
1523 if ( (signed int)pX > RightClickPortraitXmin[pPlayerNum] && (signed int)pX < RightClickPortraitXmax[pPlayerNum] | |
1524 && (signed int)pY > 375 && (signed int)pY < 466 ) | |
1525 { | |
1526 pPlayers[uActiveCharacter]->UseItem_DrinkPotion_etc(pPlayerNum + 1, 1); | |
1527 return; | |
1528 } | |
1529 //++v1; | |
1530 } | |
1531 //while ( v1 < 4 ); | |
1532 } | |
1533 | |
1534 pEventTimer->Pause(); | |
1535 | |
1536 switch(pCurrentScreen) | |
1537 { | |
1538 case SCREEN_CASTING: | |
1539 { | |
1575 | 1540 OnInventoryItemRightClick(); |
1298 | 1541 break; |
1542 } | |
1543 | |
1544 case SCREEN_CHEST: | |
1545 { | |
1546 if ( !pPlayers[uActiveCharacter]->CanAct() ) | |
1547 { | |
1548 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[427],//%s не в состоянии %s | |
1549 pPlayers[uActiveCharacter]->pName, pGlobalTXT_LocalizationStrings[541]);//Опознать предметы | |
1550 pWindow.Hint = pTmpBuf.data(); | |
1551 pWindow.uFrameWidth = 384; | |
1552 pWindow.uFrameHeight = 180; | |
1553 pWindow.uFrameY = 40; | |
1554 if ( (signed int)pX <= 320 ) | |
1555 v10 = pX + 30; | |
1556 else | |
1557 v10 = pX - 414; | |
1558 pWindow.uFrameX = v10; | |
1559 pWindow.DrawMessageBox(0); | |
1560 } | |
1561 else | |
1562 { | |
1563 v9 = pX + pSRZBufferLineOffsets[pY]; | |
1564 if ( pRenderer->pActiveZBuffer[v9] & 0xFFFF ) | |
1565 { | |
1566 | |
1567 // __debugbreak(); // invalid indexing will result in invalid object ptr | |
1568 // v8 = (ItemGen *)(&pOtherOverlayList->pOverlays[49].field_4 + 2662 * (unsigned int)pChestWindow->ptr_1C + 18* *((short *)&pChests[0].igChestItems[139].uExpireTime | |
1569 // + (pRenderer->pActiveZBuffer[v9] & 0xFFFF) + 2662 * (unsigned int)pChestWindow->ptr_1C + 3)); | |
1570 v10=pChests[pChestWindow->par1C].pInventoryIndices[(pRenderer->pActiveZBuffer[v9] & 0xFFFF)-1]; | |
1571 v8 =&pChests[pChestWindow->par1C].igChestItems[v10-1]; | |
1572 GameUI_DrawItemInfo(v8); | |
1573 } | |
1574 } | |
1575 break; | |
1576 } | |
1577 case SCREEN_GAME: | |
1578 { | |
1579 if (GetCurrentMenuID() > 0) | |
1580 break; | |
1581 | |
1582 if ( (signed int)pY > (signed int)pViewport->uViewportBR_Y ) | |
1583 { | |
1584 pWindow.ptr_1C = (void *)((signed int)pX / 118); | |
1585 if ( (signed int)pX / 118 < 4 ) | |
1586 { | |
1587 pWindow.Hint = 0; | |
1588 pWindow.uFrameWidth = 400; | |
1589 pWindow.uFrameHeight = 200; | |
1590 pWindow.uFrameX = 38; | |
1591 pWindow.uFrameY = 60; | |
1592 pAudioPlayer->StopChannels(-1, -1); | |
1593 GameUI_CharacterQuickRecord_Draw(&pWindow, pPlayers[(int)pWindow.ptr_1C + 1]); | |
1594 } | |
1595 } | |
1596 else if ( (signed int)pX > (signed int)pViewport->uViewportBR_X ) | |
1597 { | |
1598 if ( (signed int)pY >= 130 ) | |
1599 { | |
1600 if ( (signed int)pX >= 476 && (signed int)pX <= 636 && (signed int)pY >= 240 && (signed int)pY <= 300 ) | |
1601 { | |
1602 pWindow.Hint = 0; | |
1603 pWindow.uFrameWidth = 400; | |
1604 pWindow.uFrameHeight = 200; | |
1605 pWindow.uFrameX = 38; | |
1606 pWindow.uFrameY = 60; | |
1607 pAudioPlayer->StopChannels(-1, -1); | |
1608 pWindow._41D73D_draw_buff_tooltip(); | |
1609 } | |
1610 else if ( (signed int)pX < 485 || (signed int)pX > 548 || (signed int)pY < 156 || (signed int)pY > 229 ) | |
1611 { | |
1612 if (!( (signed int)pX < 566 || (signed int)pX > 629 || (signed int)pY < 156 || (signed int)pY > 229 )) | |
1613 { | |
1614 pAudioPlayer->StopChannels(-1, -1); | |
1615 v3 = (void *)1; | |
1616 GameUI_DrawNPCPopup(v3); | |
1617 } | |
1618 } | |
1619 else | |
1620 { | |
1621 pAudioPlayer->StopChannels(-1, -1); | |
1622 v3 = 0; | |
1623 GameUI_DrawNPCPopup(v3); | |
1624 } | |
1625 } | |
1626 else | |
1627 { | |
1628 pWindow.Hint = (char *)GameUI_GetMinimapHintText(); | |
1629 pWindow.uFrameWidth = 256; | |
1630 pWindow.uFrameX = 130; | |
1631 pWindow.uFrameY = 140; | |
1632 pWindow.uFrameHeight = 64; | |
1633 pAudioPlayer->StopChannels(-1, -1); | |
1634 pWindow.DrawMessageBox(0); | |
1635 } | |
1636 } | |
1637 else | |
1638 { | |
1639 pWindow.Hint = 0; | |
1640 pWindow.uFrameWidth = 320; | |
1641 pWindow.uFrameHeight = 320; | |
1642 v4 = pX - 350; | |
1643 if ( (signed int)pX <= 320 ) | |
1644 v4 = pX + 30; | |
1645 pWindow.uFrameX = v4; | |
1646 pWindow.uFrameY = 40; | |
1647 if ( pRenderer->pRenderD3D ) | |
1648 LOWORD(v5) = pGame->pVisInstance->get_picked_object_zbuf_val(); | |
1649 else | |
1650 v5 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]]; | |
1651 v6 = (unsigned __int16)v5; | |
1652 if (PID_TYPE(v6) != OBJECT_Item) | |
1653 { | |
1654 if (PID_TYPE(v6) == OBJECT_Actor) | |
1655 { | |
1656 if ( pRenderer->uNumSceneBegins ) | |
1657 { | |
1658 pWindow.DrawMessageBox(1); | |
1659 MonsterPopup_Draw(PID_ID(v6), &pWindow); | |
1660 } | |
1661 else | |
1662 { | |
1663 pRenderer->BeginScene(); | |
1664 pWindow.DrawMessageBox(1); | |
1665 MonsterPopup_Draw(PID_ID(v6), &pWindow); | |
1666 pRenderer->EndScene(); | |
1667 } | |
1668 } | |
1669 } | |
1670 else | |
1671 { | |
1672 v7 = PID_ID(v6); | |
1673 if ( ! (pObjectList->pObjects[pSpriteObjects[v7].uObjectDescID].uFlags & 0x10 ) ) | |
1674 { | |
1675 v8 = &pSpriteObjects[v7].stru_24; | |
1676 GameUI_DrawItemInfo(v8); | |
1677 } | |
1678 } | |
1679 } | |
1680 break; | |
1681 } | |
1682 case SCREEN_BOOKS: | |
1683 { | |
1684 if ( !dword_506364 | |
1685 || (signed int)pX < (signed int)pViewport->uViewportTL_X | |
1686 || (signed int)pX > (signed int)pViewport->uViewportBR_X | |
1687 || (signed int)pY < (signed int)pViewport->uViewportTL_Y | |
1688 || (signed int)pY > (signed int)pViewport->uViewportBR_Y | |
1689 || (v2 = (char *)sub_444564(), (pWindow.Hint = v2) == 0) ) | |
1690 break; | |
1691 v30 = (double)(pFontArrus->GetLineWidth(v2) + 32); | |
1692 v27 = v30 + 6.7553994e15; | |
1693 v29 = (char *)LODWORD(v27); | |
1694 pWindow.uFrameWidth = LODWORD(v27); | |
1695 pWindow.uFrameX = pX + 5; | |
1696 pWindow.uFrameY = pY + 5; | |
1697 pWindow.uFrameHeight = 64; | |
1698 pAudioPlayer->StopChannels(-1, -1); | |
1699 pWindow.DrawMessageBox(0); | |
1700 break; | |
1701 } | |
1702 case SCREEN_CHARACTERS: | |
1703 case SCREEN_E: | |
1704 case SCREEN_CHEST_INVENTORY: | |
1705 { | |
1706 if ( (signed int)pX > 467 && pCurrentScreen != SCREEN_E ) | |
1707 { | |
1575 | 1708 OnInventoryItemRightClick(); |
1298 | 1709 } |
1710 else if ( (signed int)pY >= 345 ) | |
1711 break; | |
1712 else if ( pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] == 100 )//2DEvent - CharacerScreenStats | |
1713 { | |
1714 CharacterUI_StatsTab_ShowHint(); | |
1715 } | |
1716 else if ( pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] == 101 )//2DEvent - CharacerScreenSkills | |
1717 { | |
1718 CharacterUI_SkillsTab_ShowHint(); | |
1719 } | |
1720 else | |
1721 { | |
1722 if ( pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] == 103 )//2DEvent - CharacerScreenInventory | |
1575 | 1723 OnInventoryItemRightClick(); |
1298 | 1724 } |
1725 break; | |
1726 } | |
1727 case SCREEN_SPELL_BOOK: | |
1728 { | |
1729 if ( dword_507B00_spell_info_to_draw_in_popup ) | |
1730 DrawSpellDescriptionPopup(dword_507B00_spell_info_to_draw_in_popup - 1); | |
1731 break; | |
1732 } | |
1733 case SCREEN_HOUSE: | |
1734 { | |
1735 if ( (signed int)pY < 345 && (signed int)pX < 469 ) | |
1736 ShowPopupShopItem(); | |
1737 break; | |
1738 } | |
1739 case SCREEN_PARTY_CREATION: | |
1740 { | |
1741 pWindow.Hint = 0; | |
1742 pStr = 0; | |
1743 for ( pButton = pGUIWindow_CurrentMenu->pControlsHead; pButton; pButton = pButton->pNext) | |
1744 { | |
1745 if ( pButton->uButtonType == 1 && pButton->uButtonType != 3 && (signed int)pX > (signed int)pButton->uX && (signed int)pX < (signed int)pButton->uZ | |
1746 && (signed int)pY > (signed int)pButton->uY && (signed int)pY < (signed int)pButton->uW ) | |
1747 { | |
1748 switch ( pButton->msg ) | |
1749 { | |
1750 case UIMSG_0: //stats info | |
1751 pWindow.Hint = pAttributeDescriptions[(signed int)pButton->msg_param % 7]; | |
1752 pStr = aAttributeNames[(signed int)pButton->msg_param % 7]; | |
1753 break; | |
1754 case UIMSG_PlayerCreationClickPlus: //Plus button info | |
1755 pStr = pGlobalTXT_LocalizationStrings[670];//Добавить | |
1756 pWindow.Hint = pGlobalTXT_LocalizationStrings[671];//"Добавляет очко к выделенному навыку, забирая его из накопителя очков" | |
1757 break; | |
1758 case UIMSG_PlayerCreationClickMinus: //Minus button info | |
1759 pStr = pGlobalTXT_LocalizationStrings[668];//Вычесть | |
1760 pWindow.Hint = pGlobalTXT_LocalizationStrings[669];//"Вычитает очко из выделенного навыка, возвращая его в накопитель очков" | |
1761 break; | |
1762 case UIMSG_PlayerCreationSelectActiveSkill: //Available skill button info | |
1763 v18 = pParty->pPlayers[uPlayerCreationUI_SelectedCharacter].GetSkillIdxByOrder(pButton->msg_param + 4); | |
1764 pStr = pSkillNames[v18]; | |
1765 pWindow.Hint = pSkillDesc[v18]; | |
1766 break; | |
1767 case UIMSG_PlayerCreationSelectClass: //Available Class Info | |
1768 pWindow.Hint = pClassDescriptions[pButton->msg_param]; | |
1769 pStr = pClassNames[pButton->msg_param]; | |
1770 break; | |
1771 case UIMSG_PlayerCreationClickOK: //OK Info | |
1772 pWindow.Hint = pGlobalTXT_LocalizationStrings[664];//Щелкните здесь для утверждения состава отряда и продолжения игры. | |
1773 pStr = pGlobalTXT_LocalizationStrings[665];//Кнопка ОК | |
1774 break; | |
1775 case UIMSG_PlayerCreationClickReset: //Clear info | |
1776 pWindow.Hint = pGlobalTXT_LocalizationStrings[666];//Сбрасывает все параметры и навыки отряда. | |
1777 pStr = pGlobalTXT_LocalizationStrings[667];//Кнопка Очистить | |
1778 break; | |
1779 case UIMSG_PlayerCreation_SelectAttribute: // Character info | |
1780 pStr = pParty->pPlayers[pButton->msg_param].pName; | |
1781 pWindow.Hint = pClassDescriptions[pParty->pPlayers[pButton->msg_param].classType]; | |
1782 break; | |
1783 } | |
1784 if ( pButton->msg > UIMSG_44 && pButton->msg <= UIMSG_PlayerCreationRemoveDownSkill ) //Sellected skills info | |
1785 { | |
1786 pSkillId = pParty->pPlayers[pButton->msg_param].GetSkillIdxByOrder(pButton->msg - UIMSG_48); | |
1787 pY = 0; | |
1788 if ( (signed int)pSkillId < 37 ) | |
1789 { | |
1790 pSkillInfo = CharacterUI_GetSkillDescText(pButton->msg_param, (PLAYER_SKILL_TYPE)pSkillId); | |
1791 strcpy(pTmpBuf2.data(), pSkillInfo); | |
1792 pWindow.Hint = pTmpBuf2.data(); | |
1793 pStr = pSkillNames[pSkillId]; | |
1794 } | |
1795 } | |
1796 } | |
1797 } | |
1798 if ( pWindow.Hint ) | |
1799 { | |
1800 pHint = (char*)pWindow.Hint; | |
1801 pWindow.Hint = 0; | |
1802 pWindow.uFrameWidth = 384; | |
1803 pWindow.uFrameHeight = 256; | |
1804 pWindow.uFrameX = 128; | |
1805 pWindow.uFrameY = 40; | |
1806 pWindow.uFrameHeight = pFontSmallnum->CalcTextHeight(pHint, &pWindow, 24, 0) + 2 * LOBYTE(pFontLucida->uFontHeight) + 24; | |
1807 pWindow.uFrameZ = pWindow.uFrameX + pWindow.uFrameWidth - 1; | |
1808 pWindow.uFrameW = pWindow.uFrameY + pWindow.uFrameHeight - 1; | |
1809 pWindow.DrawMessageBox(0); | |
1810 pWindow.uFrameX += 12; | |
1811 pWindow.uFrameWidth -= 24; | |
1812 pWindow.uFrameY += 12; | |
1813 pWindow.uFrameHeight -= 12; | |
1814 pWindow.uFrameZ = pWindow.uFrameX + pWindow.uFrameWidth - 1; | |
1815 pWindow.uFrameW = pWindow.uFrameY + pWindow.uFrameHeight - 1; | |
1816 pColor = TargetColor(0xFF, 0xFF, 0x9B); | |
1817 sprintf(pTmpBuf.data(), format_4E2D80, pColor, pStr);//"\f%05d%s\f00000\n" | |
1818 pWindow.DrawTitleText(pFontCreate, 0, 0, 0, pTmpBuf.data(), 3); | |
1819 pWindow.DrawText(pFontSmallnum, 1, pFontLucida->uFontHeight, 0, pHint, 0, 0, 0); | |
1820 } | |
1821 break; | |
1822 } | |
1823 default: | |
1824 { | |
1825 break; | |
1826 } | |
1827 } | |
1828 dword_507BF0_is_there_popup_onscreen = 1; | |
1829 viewparams->bRedrawGameUI = 1; | |
1830 } |