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