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