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