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