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