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