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