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