Mercurial > mm7
comparison mm7_1.cpp @ 549:f146781c5c2d
Draw_item_info fixing
author | Gloval |
---|---|
date | Mon, 04 Mar 2013 00:15:39 +0400 |
parents | 214d9d47cf1f |
children | 09108e73f2f4 8b9cbf1f87fb |
comparison
equal
deleted
inserted
replaced
546:0193f10fecbf | 549:f146781c5c2d |
---|---|
2231 return a1->DrawText(a2, 32, uY, 0, pTmpBuf, 0, 0, 0); | 2231 return a1->DrawText(a2, 32, uY, 0, pTmpBuf, 0, 0, 0); |
2232 } | 2232 } |
2233 | 2233 |
2234 | 2234 |
2235 //----- (0041D895) -------------------------------------------------------- | 2235 //----- (0041D895) -------------------------------------------------------- |
2236 void GameUI_DrawItemInfo(ItemGen *ecx0) | 2236 void GameUI_DrawItemInfo( struct ItemGen* inspect_item ) |
2237 { | 2237 { |
2238 ItemGen *v1; // esi@1 | 2238 ItemGen *v1; // esi@1 |
2239 unsigned int v2; // eax@3 | 2239 unsigned int v2; // eax@3 |
2240 //char *v3; // edi@5 | 2240 //char *v3; // edi@5 |
2241 //unsigned int v4; // eax@5 | 2241 //unsigned int v4; // eax@5 |
2242 //unsigned int v5; // esi@5 | 2242 //unsigned int v5; // esi@5 |
2243 signed int v6; // eax@5 | 2243 signed int v6; // eax@5 |
2244 int v7; // edx@5 | 2244 int v7; // edx@5 |
2245 ItemGen *v8; // ecx@10 | |
2246 //unsigned int v9; // eax@12 | 2245 //unsigned int v9; // eax@12 |
2247 char v10; // zf@16 | 2246 char v10; // zf@16 |
2248 ItemGen *v11; // eax@16 | 2247 ItemGen *v11; // eax@16 |
2249 ItemGen *v12; // eax@25 | 2248 ItemGen *v12; // eax@25 |
2250 //unsigned int v13; // ecx@32 | 2249 //unsigned int v13; // ecx@32 |
2262 int v25; // eax@57 | 2261 int v25; // eax@57 |
2263 int v26; // eax@60 | 2262 int v26; // eax@60 |
2264 int v27; // eax@67 | 2263 int v27; // eax@67 |
2265 const char *v28; // edi@69 | 2264 const char *v28; // edi@69 |
2266 int v29; // eax@70 | 2265 int v29; // eax@70 |
2267 char *v30; // edi@78 | 2266 char v30; // edi@78 |
2268 const char *v31; // eax@78 | 2267 const char *v31; // eax@78 |
2269 int v32; // ecx@81 | 2268 int v32; // ecx@81 |
2270 unsigned int v33; // eax@81 | 2269 unsigned int v33; // eax@81 |
2271 int v34; // esi@81 | 2270 int v34; // esi@81 |
2272 const char *v35; // eax@85 | 2271 const char *v35; // eax@85 |
2294 unsigned int v57; // [sp-8h] [bp-280h]@36 | 2293 unsigned int v57; // [sp-8h] [bp-280h]@36 |
2295 //int v58; // [sp-8h] [bp-280h]@46 | 2294 //int v58; // [sp-8h] [bp-280h]@46 |
2296 int v59; // [sp-8h] [bp-280h]@56 | 2295 int v59; // [sp-8h] [bp-280h]@56 |
2297 int v60; // [sp-8h] [bp-280h]@58 | 2296 int v60; // [sp-8h] [bp-280h]@58 |
2298 unsigned int v61; // [sp-8h] [bp-280h]@110 | 2297 unsigned int v61; // [sp-8h] [bp-280h]@110 |
2299 char a1[300]; // [sp+8h] [bp-270h]@40 | 2298 char out_text[300]; // [sp+8h] [bp-270h]@40 |
2300 //char Dest[100]; // [sp+6Ch] [bp-20Ch]@40 | 2299 //char Dest[100]; // [sp+6Ch] [bp-20Ch]@40 |
2301 //char v64[100]; // [sp+D0h] [bp-1A8h]@40 | 2300 //char v64[100]; // [sp+D0h] [bp-1A8h]@40 |
2302 char v65[120]; // [sp+134h] [bp-144h]@92 | 2301 char v65[120]; // [sp+134h] [bp-144h]@92 |
2303 char Source[40]; // [sp+1ACh] [bp-CCh]@49 | 2302 char Source[40]; // [sp+1ACh] [bp-CCh]@49 |
2304 stru351_summoned_item v67; | 2303 stru351_summoned_item v67; |
2312 Texture *v73; // [sp+1F4h] [bp-84h]@5 | 2311 Texture *v73; // [sp+1F4h] [bp-84h]@5 |
2313 //unsigned int v75; // [sp+1F8h] [bp-80h]@5 | 2312 //unsigned int v75; // [sp+1F8h] [bp-80h]@5 |
2314 //char *v76; // [sp+1FCh] [bp-7Ch]@5 | 2313 //char *v76; // [sp+1FCh] [bp-7Ch]@5 |
2315 int v77; // [sp+200h] [bp-78h]@12 | 2314 int v77; // [sp+200h] [bp-78h]@12 |
2316 int v78; // [sp+204h] [bp-74h]@5 | 2315 int v78; // [sp+204h] [bp-74h]@5 |
2317 GUIWindow v79; // [sp+208h] [bp-70h]@2 | 2316 GUIWindow wHintWindow; // [sp+208h] [bp-70h]@2 |
2318 POINT a2; // [sp+25Ch] [bp-1Ch]@2 | 2317 POINT a2; // [sp+25Ch] [bp-1Ch]@2 |
2319 int v81; // [sp+264h] [bp-14h]@5 | 2318 int v81; // [sp+264h] [bp-14h]@5 |
2320 GUIFont *v82; // [sp+268h] [bp-10h]@1 | 2319 // GUIFont *pFontComic; // [sp+268h] [bp-10h]@1 |
2321 char *v83; // [sp+26Ch] [bp-Ch]@18 | 2320 PlayerSpeech v83; // [sp+26Ch] [bp-Ch]@18 |
2321 char* v84; | |
2322 int v85; | |
2322 char *Str; // [sp+270h] [bp-8h]@65 | 2323 char *Str; // [sp+270h] [bp-8h]@65 |
2323 ItemGen *_this; // [sp+274h] [bp-4h]@1 | 2324 |
2324 | 2325 v1 = inspect_item; |
2325 v1 = ecx0; | |
2326 _this = ecx0; | |
2327 var88 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); | 2326 var88 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); |
2328 v82 = pFontComic; | 2327 if (!inspect_item->uItemID) |
2329 if (!v1->uItemID) | |
2330 return; | 2328 return; |
2331 | 2329 |
2332 v79.Hint = 0; | 2330 wHintWindow.Hint = 0; |
2333 v79.uFrameWidth = 384; | 2331 wHintWindow.uFrameWidth = 384; |
2334 v79.uFrameHeight = 180; | 2332 wHintWindow.uFrameHeight = 180; |
2335 v79.uFrameY = 40; | 2333 wHintWindow.uFrameY = 40; |
2336 if ( pMouse->GetCursorPos(&a2)->x <= 320 ) | 2334 if ( pMouse->GetCursorPos(&a2)->x <= 320 ) |
2337 v2 = pMouse->GetCursorPos(&a2)->x + 30; | 2335 v2 = pMouse->GetCursorPos(&a2)->x + 30; |
2338 else | 2336 else |
2339 v2 = pMouse->GetCursorPos(&a2)->x - v79.uFrameWidth - 30; | 2337 v2 = pMouse->GetCursorPos(&a2)->x - wHintWindow.uFrameWidth - 30; |
2340 v79.uFrameX = v2; | 2338 wHintWindow.uFrameX = v2; |
2341 auto item_desc = &pItemsTable->pItems[_this->uItemID]; | 2339 auto item_desc = &pItemsTable->pItems[inspect_item->uItemID]; |
2342 //v3 = (char *)&pItemsTable->pItems[_this->uItemID].pIconName; | 2340 //v3 = (char *)&pItemsTable->pItems[_this->uItemID].pIconName; |
2343 //v76 = v3; | 2341 //v76 = v3; |
2344 //v4 = pIcons_LOD->LoadTexture(pItemsTable->pItems[_this->uItemID].pIconName, TEXTURE_16BIT_PALETTE); | 2342 //v4 = pIcons_LOD->LoadTexture(pItemsTable->pItems[_this->uItemID].pIconName, TEXTURE_16BIT_PALETTE); |
2345 //v5 = v4; | 2343 //v5 = v4; |
2346 //v4 *= 72; | 2344 //v4 *= 72; |
2355 v78 = v6 >> 1; | 2353 v78 = v6 >> 1; |
2356 if ( v81 <= 0 ) | 2354 if ( v81 <= 0 ) |
2357 v81 = 0; | 2355 v81 = 0; |
2358 else | 2356 else |
2359 v81 >>= 1; | 2357 v81 >>= 1; |
2360 v8 = _this; | |
2361 if ( !item_desc->uItemID_Rep_St ) | 2358 if ( !item_desc->uItemID_Rep_St ) |
2362 _this->SetIdentified(); | 2359 inspect_item->SetIdentified(); |
2363 //v9 = v8->uAttributes; | 2360 //v9 = v8->uAttributes; |
2364 v77 = 0; | 2361 v77 = 0; |
2365 //a2.y = v8->uAttributes & 2; | 2362 //a2.y = v8->uAttributes & 2; |
2366 if (pItemsTable->pItems[v8->uItemID].uEquipType == EQUIP_GOLD) | 2363 if (pItemsTable->pItems[inspect_item->uItemID].uEquipType == EQUIP_GOLD) |
2367 v77 = v8->uSpecEnchantmentType; | 2364 v77 = inspect_item->uSpecEnchantmentType; |
2368 if ( uActiveCharacter ) | 2365 if ( uActiveCharacter ) |
2369 { | 2366 { |
2370 if (!v8->Identified()) | 2367 //try to identify |
2371 { | 2368 if (!inspect_item->Identified()) |
2372 v10 = pPlayers[uActiveCharacter]->CanIdentify(_this) == 1; | 2369 { |
2373 v11 = _this; | 2370 |
2374 if ( v10 ) | 2371 v11 = inspect_item; |
2375 _this->SetIdentified(); | 2372 if ( pPlayers[uActiveCharacter]->CanIdentify(inspect_item) == 1 ) |
2376 v10 = !v11->Identified(); | 2373 inspect_item->SetIdentified(); |
2377 v83 = (char *)9; | 2374 v83 = SPEECH_9; |
2378 if ( v10 ) | 2375 if ( !inspect_item->Identified() ) |
2379 { | 2376 { |
2380 ShowStatusBarString(pGlobalTXT_LocalizationStrings[446], 2u); | 2377 ShowStatusBarString(pGlobalTXT_LocalizationStrings[446], 2u);//"Identify Failed" |
2381 } | 2378 } |
2382 else | 2379 else |
2383 { | 2380 { |
2384 v83 = (char *)SPEECH_8; | 2381 v83 = SPEECH_8; |
2385 if ( _this->GetValue() < 100 * (pPlayers[uActiveCharacter]->uLevel + 5) ) | 2382 if ( inspect_item->GetValue() < 100 * (pPlayers[uActiveCharacter]->uLevel + 5) ) |
2386 v83 = (char *)SPEECH_7; | 2383 v83 = SPEECH_7; |
2387 } | 2384 } |
2388 if ( dword_4E455C ) | 2385 if ( dword_4E455C ) |
2389 { | 2386 { |
2390 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)(int)v83, 0); | 2387 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)(int)v83, 0); |
2391 dword_4E455C = 0; | 2388 dword_4E455C = 0; |
2392 } | 2389 } |
2393 } | 2390 } |
2394 _this->UpdateTempBonus(pParty->uTimePlayed); | 2391 inspect_item->UpdateTempBonus(pParty->uTimePlayed); |
2395 if (v8->Broken()) | 2392 if (inspect_item->Broken()) |
2396 { | 2393 { |
2397 v10 = pPlayers[uActiveCharacter]->CanRepair(_this) == 1; | 2394 if ( pPlayers[uActiveCharacter]->CanRepair(inspect_item) == 1 ) |
2398 v12 = _this; | 2395 inspect_item->uAttributes = inspect_item->uAttributes & 0xFFFFFFFD | 1; |
2399 if ( v10 ) | 2396 v83 = SPEECH_11; |
2400 _this->uAttributes = _this->uAttributes & 0xFFFFFFFD | 1; | 2397 if ( !inspect_item->Broken() ) |
2401 v10 = !v12->Broken(); | 2398 v83 = SPEECH_10; |
2402 v83 = (char *)SPEECH_11; | |
2403 if ( v10 ) | |
2404 v83 = (char *)SPEECH_10; | |
2405 else | 2399 else |
2406 ShowStatusBarString(pGlobalTXT_LocalizationStrings[448], 2u); | 2400 ShowStatusBarString(pGlobalTXT_LocalizationStrings[448], 2u);//"Repair Failed" |
2407 if ( dword_4E455C ) | 2401 if ( dword_4E455C ) |
2408 { | 2402 { |
2409 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)(int)v83, 0); | 2403 pPlayers[uActiveCharacter]->PlaySound(v83, 0); |
2410 dword_4E455C = 0; | 2404 dword_4E455C = 0; |
2411 } | 2405 } |
2412 } | 2406 } |
2413 } | 2407 } |
2414 //v13 = _this->uAttributes; | 2408 //v13 = _this->uAttributes; |
2415 //v14 = _this->Identified(); | 2409 //v14 = _this->Identified(); |
2416 a2.y = _this->Identified(); | 2410 //a2.y = inspect_item->Identified(); |
2417 if (_this->Broken()) | 2411 if (inspect_item->Broken()) |
2418 { | 2412 { |
2419 v79.DrawMessageBox(0); | 2413 wHintWindow.DrawMessageBox(0); |
2420 //v15 = &; | 2414 //v15 = &; |
2421 pRenderer->Clip(v79.uFrameX + 12, v79.uFrameY + 12, | 2415 pRenderer->Clip(wHintWindow.uFrameX + 12, wHintWindow.uFrameY + 12, |
2422 v79.uFrameX + v79.uFrameWidth - 12, v79.uFrameY + v79.uFrameHeight - 12); | 2416 wHintWindow.uFrameX + wHintWindow.uFrameWidth - 12, |
2423 v79.uFrameWidth -= 24; | 2417 wHintWindow.uFrameY + wHintWindow.uFrameHeight - 12); |
2424 v79.uFrameHeight -= 12; | 2418 wHintWindow.uFrameWidth -= 24; |
2425 v79.uFrameZ = v79.uFrameX + v79.uFrameWidth - 1; | 2419 wHintWindow.uFrameHeight -= 12; |
2426 v79.uFrameW = v79.uFrameY + v79.uFrameHeight - 1; | 2420 wHintWindow.uFrameZ = wHintWindow.uFrameX + wHintWindow.uFrameWidth - 1; |
2427 pRenderer->DrawTransparentRedShade(v79.uFrameX + v78, v81 + v79.uFrameY + 30, v73); | 2421 wHintWindow.uFrameW = wHintWindow.uFrameY + wHintWindow.uFrameHeight - 1; |
2428 if ( a2.y ) | 2422 pRenderer->DrawTransparentRedShade(wHintWindow.uFrameX + v78, v81 + wHintWindow.uFrameY + 30, v73); |
2429 v16 = _this->GetIdentifiedName(); | 2423 if ( inspect_item->Identified()) |
2424 v16 = inspect_item->GetIdentifiedName(); | |
2430 else | 2425 else |
2431 v16 = item_desc->pUnidentifiedName; | 2426 v16 = item_desc->pUnidentifiedName; |
2432 v79.DrawTitleText(pFontArrus, 0, 0xCu, var88, v16, 3u); | 2427 wHintWindow.DrawTitleText(pFontArrus, 0, 0xCu, var88, v16, 3u); |
2433 v17 = pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[32], &v79, 0, 0); | 2428 v17 = pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[32], &wHintWindow, 0, 0); //"Broken Item" |
2434 v57 = 3; | |
2435 v52 = pGlobalTXT_LocalizationStrings[32]; | |
2436 goto LABEL_37; | |
2437 } | |
2438 if (!_this->Identified()) | |
2439 { | |
2440 v79.DrawMessageBox(0); | |
2441 //v15 = pRenderer; | |
2442 pRenderer->Clip(v79.uFrameX + 12, v79.uFrameY + 12, | |
2443 v79.uFrameX + v79.uFrameWidth - 12, v79.uFrameY + v79.uFrameHeight - 12); | |
2444 v79.uFrameWidth -= 24; | |
2445 v79.uFrameHeight -= 12; | |
2446 v79.uFrameZ = v79.uFrameX + v79.uFrameWidth - 1; | |
2447 v79.uFrameW = v79.uFrameY + v79.uFrameHeight - 1; | |
2448 pRenderer->DrawTextureTransparent(v79.uFrameX + v78, v81 + v79.uFrameY + 30, v73); | |
2449 v79.DrawTitleText(pFontArrus, 0, 0xCu, var88, item_desc->pUnidentifiedName, 3u); | |
2450 v17 = pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[232], &v79, 0, 0); | |
2451 v57 = 3; | |
2452 v52 = pGlobalTXT_LocalizationStrings[232]; | |
2453 LABEL_37: | |
2454 v18 = v17 >> 1; | 2429 v18 = v17 >> 1; |
2455 v19 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0x19u, 0x19u); | 2430 v19 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0x19u, 0x19u); |
2456 v79.DrawTitleText(pFontArrus, 0x64u, ((signed int)v79.uFrameHeight >> 1) - v18, v19, v52, v57); | 2431 wHintWindow.DrawTitleText(pFontArrus, 0x64u, ((signed int)wHintWindow.uFrameHeight >> 1) - v18, v19, pGlobalTXT_LocalizationStrings[32], 3); //"Broken Item" |
2432 goto LABEL_116; | |
2433 } | |
2434 if (!inspect_item->Identified()) | |
2435 { | |
2436 wHintWindow.DrawMessageBox(0); | |
2437 pRenderer->Clip(wHintWindow.uFrameX + 12, wHintWindow.uFrameY + 12, | |
2438 wHintWindow.uFrameX + wHintWindow.uFrameWidth - 12, | |
2439 wHintWindow.uFrameY + wHintWindow.uFrameHeight - 12); | |
2440 wHintWindow.uFrameWidth -= 24; | |
2441 wHintWindow.uFrameHeight -= 12; | |
2442 wHintWindow.uFrameZ = wHintWindow.uFrameX + wHintWindow.uFrameWidth - 1; | |
2443 wHintWindow.uFrameW = wHintWindow.uFrameY + wHintWindow.uFrameHeight - 1; | |
2444 pRenderer->DrawTextureTransparent(wHintWindow.uFrameX + v78, v81 + wHintWindow.uFrameY + 30, v73); | |
2445 wHintWindow.DrawTitleText(pFontArrus, 0, 0xCu, var88, item_desc->pUnidentifiedName, 3u); | |
2446 v17 = pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[232], &wHintWindow, 0, 0); ///"Not Identified" | |
2447 v18 = v17 >> 1; | |
2448 v19 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0x19u, 0x19u); | |
2449 wHintWindow.DrawTitleText(pFontArrus, 0x64u, ((signed int)wHintWindow.uFrameHeight >> 1) - v18, v19, pGlobalTXT_LocalizationStrings[232], 3); | |
2457 goto LABEL_116; | 2450 goto LABEL_116; |
2458 } | 2451 } |
2459 | 2452 |
2460 sprintfex(a1, pGlobalTXT_LocalizationStrings[463], item_desc->pUnidentifiedName); | 2453 sprintfex(out_text, pGlobalTXT_LocalizationStrings[463], item_desc->pUnidentifiedName); //"Type: %s" |
2461 a1[100] = 0; | 2454 out_text[100] = 0; |
2462 a1[200] = 0; | 2455 out_text[200] = 0; |
2463 //v20 = item_desc->uEquipType; | 2456 //v20 = item_desc->uEquipType; |
2464 switch (item_desc->uEquipType) | 2457 switch (item_desc->uEquipType) |
2465 { | 2458 { |
2466 case EQUIP_ONE_OR_TWO_HANDS: | 2459 case EQUIP_ONE_OR_TWO_HANDS: |
2467 case EQUIP_TWO_HANDED: | 2460 case EQUIP_TWO_HANDED: |
2468 sprintfex(a1 + 100, "%s: +%d %s: %dd%d", pGlobalTXT_LocalizationStrings[18], (int)item_desc->uDamageMod, pGlobalTXT_LocalizationStrings[53], (int)item_desc->uDamageDice, (int)item_desc->uDamageRoll); | 2461 sprintfex(out_text + 100, "%s: +%d %s: %dd%d", pGlobalTXT_LocalizationStrings[LOCSTR_ATTACK], |
2462 (int)item_desc->uDamageMod, pGlobalTXT_LocalizationStrings[53], (int)item_desc->uDamageDice, (int)item_desc->uDamageRoll); //"Damage" | |
2469 if (item_desc->uDamageMod) | 2463 if (item_desc->uDamageMod) |
2470 { | 2464 { |
2471 char mod[16]; | 2465 char mod[16]; |
2472 sprintf(mod, "+%d", (int)item_desc->uDamageMod); | 2466 sprintf(mod, "+%d", (int)item_desc->uDamageMod); |
2473 strcat(a1 + 100, mod); | 2467 strcat(out_text + 100, mod); |
2474 } | 2468 } |
2475 break; | 2469 break; |
2476 | 2470 |
2477 case EQUIP_BOW: | 2471 case EQUIP_BOW: |
2478 sprintfex(a1 + 100, "%s: +%d %s: %dd%d", pGlobalTXT_LocalizationStrings[203], (int)item_desc->uDamageMod, pGlobalTXT_LocalizationStrings[53], (int)item_desc->uDamageDice, (int)item_desc->uDamageRoll); | 2472 sprintfex(out_text + 100, "%s: +%d %s: %dd%d", pGlobalTXT_LocalizationStrings[203], //"Shoot" |
2473 (int)item_desc->uDamageMod, pGlobalTXT_LocalizationStrings[53], //"Damage" | |
2474 (int)item_desc->uDamageDice, (int)item_desc->uDamageRoll); | |
2479 if (item_desc->uDamageMod) | 2475 if (item_desc->uDamageMod) |
2480 { | 2476 { |
2481 char mod[16]; | 2477 char mod[16]; |
2482 sprintf(mod, "+%d", (int)item_desc->uDamageMod); | 2478 sprintf(mod, "+%d", (int)item_desc->uDamageMod); |
2483 strcat(a1 + 100, mod); | 2479 strcat(out_text + 100, mod); |
2484 } | 2480 } |
2485 break; | 2481 break; |
2486 | 2482 |
2487 case EQUIP_ARMOUR: | 2483 case EQUIP_ARMOUR: |
2488 case EQUIP_SHIELD: | 2484 case EQUIP_SHIELD: |
2491 case EQUIP_CLOAK: | 2487 case EQUIP_CLOAK: |
2492 case EQUIP_GAUNTLETS: | 2488 case EQUIP_GAUNTLETS: |
2493 case EQUIP_BOOTS: | 2489 case EQUIP_BOOTS: |
2494 case EQUIP_RING: | 2490 case EQUIP_RING: |
2495 case EQUIP_AMULET: | 2491 case EQUIP_AMULET: |
2496 if (item_desc->uDamageDice) | 2492 if (item_desc->uDamageDice) //"Armor" |
2497 sprintfex(a1 + 100, "%s: +%d", pGlobalTXT_LocalizationStrings[11], item_desc->uDamageDice + item_desc->uDamageMod); | 2493 sprintfex(out_text + 100, "%s: +%d", pGlobalTXT_LocalizationStrings[11], item_desc->uDamageDice + item_desc->uDamageMod); |
2498 break; | 2494 break; |
2495 case EQUIP_POTION: | |
2496 if ( inspect_item->uEncantmentType ) | |
2497 sprintf(out_text + 200, "%s: %d",pGlobalTXT_LocalizationStrings[449] , inspect_item->uEncantmentType); //"Power" | |
2498 break; | |
2499 case EQUIP_REAGENT: | |
2500 sprintf(out_text + 200, "%s: %d", pGlobalTXT_LocalizationStrings[449], pItemsTable->pItems[inspect_item->uItemID].uDamageDice); //"Power" | |
2501 break; | |
2499 } | 2502 } |
2500 | 2503 |
2501 if ( v77 ) | 2504 if ( v77 ) |
2502 goto LABEL_65; | 2505 goto LABEL_65; |
2503 //v23 = item_desc->uEquipType; | 2506 //v23 = item_desc->uEquipType; |
2504 if (item_desc->uEquipType == 14) | 2507 |
2505 { | 2508 |
2506 v24 = _this->uEncantmentType; | 2509 if ( inspect_item->uEncantmentType ) |
2507 if ( v24 ) | 2510 { |
2508 goto LABEL_56; | 2511 sprintf(out_text + 200, "%s: %s +%d", pGlobalTXT_LocalizationStrings[210], |
2512 pItemsTable->pEnchantments[inspect_item->uEncantmentType-1].pOfName, inspect_item->_bonus_strength); //"Special" | |
2513 } | |
2514 else if ( inspect_item->uSpecEnchantmentType ) | |
2515 { | |
2516 | |
2517 | |
2518 sprintf(out_text + 200, "%s: %s", pGlobalTXT_LocalizationStrings[210], | |
2519 pItemsTable->pSpecialEnchantments[inspect_item->uSpecEnchantmentType-1].pNameAdd, inspect_item->_bonus_strength); | |
2520 } | |
2521 | |
2522 else if ( inspect_item->uNumCharges ) | |
2523 { | |
2524 sprintf(out_text + 200, "%s: %lu", pGlobalTXT_LocalizationStrings[464], inspect_item->uNumCharges); //"Charges" | |
2525 | |
2526 } | |
2527 | |
2509 LABEL_65: | 2528 LABEL_65: |
2510 v79.uFrameWidth -= 12; | 2529 wHintWindow.uFrameWidth -= 12; |
2511 a2.y = 3; | 2530 v85 = 3; |
2512 v79.uFrameZ = v79.uFrameX + v79.uFrameWidth - 1; | 2531 wHintWindow.uFrameZ = wHintWindow.uFrameX + wHintWindow.uFrameWidth - 1; |
2513 v79.uFrameW = v79.uFrameY + v79.uFrameHeight - 1; | 2532 wHintWindow.uFrameW = wHintWindow.uFrameY + wHintWindow.uFrameHeight - 1; |
2514 Str = (char *)(3 * (LOBYTE(pFontArrus->uFontHeight) + 8)); | 2533 Str = (char *)(3 * (LOBYTE(pFontArrus->uFontHeight) + 8)); |
2515 v83 = a1; | 2534 v84 = &out_text[0]; |
2516 do | 2535 do |
2517 { | |
2518 if ( *v83 ) | |
2519 { | 2536 { |
2520 v27 = v82->CalcTextHeight(v83, &v79, 100, 0); | 2537 if ( *v84 ) |
2521 Str += v27 + 3; | 2538 { |
2539 v27 = pFontComic->CalcTextHeight(v84, &wHintWindow, 100, 0); | |
2540 Str += v27 + 3; | |
2541 } | |
2542 v84 += 100; | |
2543 --v85; | |
2522 } | 2544 } |
2523 v83 += 100; | 2545 while ( v85 ); |
2524 --a2.y; | 2546 v28 = item_desc->pDescription; |
2525 } | 2547 if ( *v28 ) |
2526 while ( a2.y ); | 2548 { |
2527 v28 = item_desc->pDescription; | 2549 v29 = pFontSmallnum->CalcTextHeight(v28, &wHintWindow, 100, 0); |
2528 if ( *v28 ) | 2550 Str += v29; |
2529 { | 2551 } |
2530 v29 = pFontSmallnum->CalcTextHeight(v28, &v79, 100, 0); | 2552 wHintWindow.uFrameHeight = v73->uTextureHeight + v81 + 54; |
2531 Str += v29; | 2553 if ( (signed int)Str > (signed int)wHintWindow.uFrameHeight ) |
2532 } | 2554 wHintWindow.uFrameHeight = (unsigned int)Str; |
2533 v79.uFrameHeight = v73->uTextureHeight + v81 + 54; | 2555 if ( inspect_item->uAttributes & 8 && (inspect_item->uSpecEnchantmentType || inspect_item->uEncantmentType) ) |
2534 if ( (signed int)Str > (signed int)v79.uFrameHeight ) | 2556 wHintWindow.uFrameHeight += LOBYTE(pFontComic->uFontHeight); |
2535 v79.uFrameHeight = (unsigned int)Str; | 2557 v85 = 0; |
2536 if ( _this->uAttributes & 8 && (_this->uSpecEnchantmentType || _this->uEncantmentType) ) | 2558 if ( pFontArrus->uFontHeight ) |
2537 v79.uFrameHeight += LOBYTE(v82->uFontHeight); | 2559 { |
2538 v83 = 0; | 2560 wHintWindow.uFrameWidth -= 24; |
2539 if ( LOBYTE(pFontArrus->uFontHeight) ) | 2561 v30 = pFontArrus->uFontHeight; |
2540 { | 2562 v31 = inspect_item->GetIdentifiedName(); |
2541 v79.uFrameWidth -= 24; | 2563 if ( pFontArrus->CalcTextHeight(v31, &wHintWindow, 0, 0) / (signed int)v30 ) |
2542 v30 = (char *)LOBYTE(pFontArrus->uFontHeight); | 2564 v85 = v30; |
2543 v31 = _this->GetIdentifiedName(); | 2565 wHintWindow.uFrameWidth += 24; |
2544 if ( pFontArrus->CalcTextHeight(v31, &v79, 0, 0) / (signed int)v30 ) | 2566 } |
2545 v83 = v30; | 2567 wHintWindow.uFrameWidth += 12; |
2546 v79.uFrameWidth += 24; | 2568 wHintWindow.uFrameHeight += (unsigned int)v85; |
2547 } | 2569 wHintWindow.uFrameW = wHintWindow.uFrameY + wHintWindow.uFrameHeight - 1; |
2548 v79.uFrameWidth += 12; | 2570 wHintWindow.uFrameZ = wHintWindow.uFrameX + wHintWindow.uFrameWidth - 1; |
2549 v79.uFrameHeight += (unsigned int)v83; | 2571 wHintWindow.DrawMessageBox(0); |
2550 v79.uFrameW = v79.uFrameY + v79.uFrameHeight - 1; | 2572 //v15 = pRenderer; |
2551 v79.uFrameZ = v79.uFrameX + v79.uFrameWidth - 1; | 2573 pRenderer->Clip(wHintWindow.uFrameX + 12, wHintWindow.uFrameY + 12, |
2552 v79.DrawMessageBox(0); | 2574 wHintWindow.uFrameX + wHintWindow.uFrameWidth - 12, wHintWindow.uFrameY + wHintWindow.uFrameHeight - 12); |
2553 //v15 = pRenderer; | 2575 wHintWindow.uFrameWidth -= 12; |
2554 pRenderer->Clip(v79.uFrameX + 12, v79.uFrameY + 12, | 2576 v32 = v73->uTextureHeight; |
2555 v79.uFrameX + v79.uFrameWidth - 12, v79.uFrameY + v79.uFrameHeight - 12); | 2577 v33 = wHintWindow.uFrameHeight; |
2556 v79.uFrameWidth -= 12; | 2578 wHintWindow.uFrameHeight -= 12; |
2557 v32 = v73->uTextureHeight; | 2579 wHintWindow.uFrameZ = wHintWindow.uFrameX + wHintWindow.uFrameWidth - 1; |
2558 v33 = v79.uFrameHeight; | 2580 wHintWindow.uFrameW = wHintWindow.uFrameY + wHintWindow.uFrameHeight - 1; |
2559 v79.uFrameHeight -= 12; | 2581 pRenderer->DrawTextureTransparent( |
2560 v79.uFrameZ = v79.uFrameX + v79.uFrameWidth - 1; | 2582 wHintWindow.uFrameX + v78, |
2561 v79.uFrameW = v79.uFrameY + v79.uFrameHeight - 1; | 2583 wHintWindow.uFrameY + (signed int)(v33 - v32) / 2, |
2562 pRenderer->DrawTextureTransparent( | 2584 v73); |
2563 v79.uFrameX + v78, | 2585 |
2564 v79.uFrameY + (signed int)(v33 - v32) / 2, | 2586 v34 = (int)(v85 + 35); |
2565 v73); | 2587 v85 = 3; |
2566 a2.y = 3; | 2588 Str = out_text; |
2567 v34 = (int)(v83 + 35); | 2589 do |
2568 Str = a1; | 2590 { |
2569 do | 2591 if ( *Str ) |
2570 { | 2592 { |
2571 if ( *Str ) | 2593 wHintWindow.DrawText(pFontComic, 100, v34, 0, Str, 0, 0, 0); |
2572 { | 2594 v34 += pFontComic->CalcTextHeight(Str, &wHintWindow, 100, 0) + 3; |
2573 v79.DrawText(v82, 100, v34, 0, Str, 0, 0, 0); | 2595 } |
2574 v34 += v82->CalcTextHeight(Str, &v79, 100, 0) + 3; | 2596 Str += 100; |
2575 } | 2597 --v85; |
2576 Str += 100; | 2598 } |
2577 --a2.y; | 2599 while (v85 ); |
2578 } | 2600 v35 = item_desc->pDescription; |
2579 while ( a2.y ); | 2601 if ( *v35 ) |
2580 v35 = item_desc->pDescription; | 2602 wHintWindow.DrawText(pFontSmallnum, 100, v34, 0, v35, 0, 0, 0); |
2581 if ( *v35 ) | 2603 wHintWindow.uFrameX += 12; |
2582 v79.DrawText(pFontSmallnum, 100, v34, 0, v35, 0, 0, 0); | 2604 wHintWindow.uFrameWidth -= 24; |
2583 v79.uFrameX += 12; | 2605 v36 = inspect_item->GetIdentifiedName(); |
2584 v79.uFrameWidth -= 24; | 2606 wHintWindow.DrawTitleText(pFontArrus, 0, 0xCu, var88, v36, 3u); |
2585 v36 = _this->GetIdentifiedName(); | 2607 wHintWindow.uFrameWidth += 24; |
2586 v79.DrawTitleText(pFontArrus, 0, 0xCu, var88, v36, 3u); | 2608 wHintWindow.uFrameX -= 12; |
2587 v79.uFrameWidth += 24; | 2609 if ( v77 ) |
2588 v79.uFrameX -= 12; | 2610 { |
2589 if ( v77 ) | 2611 sprintf(pTmpBuf, "%s: %lu", pGlobalTXT_LocalizationStrings[465], v77);//"Value" |
2590 { | 2612 v40 = pFontComic; |
2591 sprintf(pTmpBuf, "%s: %lu", pGlobalTXT_LocalizationStrings[465], v77); | 2613 v61 = 0; |
2592 v40 = v82; | 2614 v56 = 0; |
2593 v61 = 0; | 2615 v51 = 0; |
2594 v56 = 0; | 2616 v47 = pTmpBuf; |
2595 v51 = 0; | 2617 v44 = 0; |
2596 v47 = pTmpBuf; | 2618 v42 = wHintWindow.uFrameHeight - LOBYTE(pFontComic->uFontHeight); |
2597 v44 = 0; | 2619 v41 = 100; |
2598 v42 = v79.uFrameHeight - LOBYTE(v82->uFontHeight); | 2620 } |
2599 v41 = 100; | 2621 else |
2600 } | 2622 { |
2601 else | 2623 if ( (inspect_item->uAttributes & 8) && (inspect_item->uSpecEnchantmentType || inspect_item->uEncantmentType) ) |
2602 { | 2624 { |
2603 if ( _this->uAttributes & 8 && (_this->uSpecEnchantmentType || _this->uEncantmentType) ) | 2625 sub_493F79(&v67, inspect_item->uExpireTime - pParty->uTimePlayed); |
2604 { | 2626 strcpy(pTmpBuf, "Duration:"); |
2605 sub_493F79(&v67, _this->uExpireTime - pParty->uTimePlayed); | 2627 Str = (char *)(v67.field_18_expire_year - game_starting_year); |
2606 strcpy(pTmpBuf, "Duration:"); | 2628 if (v67.field_18_expire_year != 1168 ) |
2607 Str = (char *)(v67.field_18_expire_year - game_starting_year); | 2629 { |
2608 if (v67.field_18_expire_year != 1168 ) | 2630 sprintf(v65, " %d:yr", v67.field_18_expire_year - game_starting_year); |
2609 { | 2631 strcat(pTmpBuf, v65); |
2610 sprintf(v65, " %d:yr", v67.field_18_expire_year - game_starting_year); | 2632 } |
2611 strcat(pTmpBuf, v65); | 2633 if ( (((v67.field_14_exprie_month || Str) && |
2612 } | 2634 ((sprintf(v65, " %d:mo", v67.field_14_exprie_month), strcat(pTmpBuf, v65), v67.field_14_exprie_month) || Str) |
2613 if ( (((v67.field_14_exprie_month || Str) && ((sprintf(v65, " %d:mo", v67.field_14_exprie_month), strcat(pTmpBuf, v65), v67.field_14_exprie_month) || Str) || v67.field_C_expire_day) | 2635 || v67.field_C_expire_day) |
2614 && ((sprintf(v65, " %d:dy", v67.field_C_expire_day), strcat(pTmpBuf, v65), v67.field_14_exprie_month) || Str || v67.field_C_expire_day) | 2636 && ((sprintf(v65, " %d:dy", v67.field_C_expire_day), strcat(pTmpBuf, v65), v67.field_14_exprie_month) || Str || |
2615 || v67.field_8_expire_hour) | 2637 v67.field_C_expire_day) |
2616 && ((sprintf(v65, " %d:hr", v67.field_8_expire_hour), strcat(pTmpBuf, v65), v67.field_14_exprie_month) || Str || v67.field_C_expire_day || v67.field_8_expire_hour) | 2638 || v67.field_8_expire_hour) |
2617 || v67.field_4_expire_minute ) | 2639 && ((sprintf(v65, " %d:hr", v67.field_8_expire_hour), strcat(pTmpBuf, v65), v67.field_14_exprie_month) || Str || |
2618 { | 2640 v67.field_C_expire_day || v67.field_8_expire_hour) |
2619 sprintf(v65, " %d:mn", v67.field_4_expire_minute); | 2641 || v67.field_4_expire_minute ) |
2620 strcat(pTmpBuf, v65); | 2642 { |
2621 } | 2643 sprintf(v65, " %d:mn", v67.field_4_expire_minute); |
2622 v79.DrawText(v82, 100, v79.uFrameHeight - 2 * LOBYTE(v82->uFontHeight), 0, pTmpBuf, 0, 0, 0); | 2644 strcat(pTmpBuf, v65); |
2623 } | 2645 } |
2624 v37 = _this->GetValue(); | 2646 wHintWindow.DrawText(pFontComic, 100, wHintWindow.uFrameHeight - 2 * LOBYTE(pFontComic->uFontHeight), 0, pTmpBuf, 0, 0, 0); |
2625 sprintf(pTmpBuf, "%s: %lu", pGlobalTXT_LocalizationStrings[465], v37); | 2647 } |
2626 v79.DrawText(v82, 100, v79.uFrameHeight - LOBYTE(v82->uFontHeight), 0, pTmpBuf, 0, 0, 0); | 2648 v37 = inspect_item->GetValue(); |
2627 v38 = _this->uAttributes; | 2649 sprintf(pTmpBuf, "%s: %lu", pGlobalTXT_LocalizationStrings[465], v37); |
2628 if ( BYTE1(v38) & 1 ) | 2650 wHintWindow.DrawText(pFontComic, 100, wHintWindow.uFrameHeight - LOBYTE(pFontComic->uFontHeight), 0, pTmpBuf, 0, 0, 0); |
2629 { | 2651 v38 = inspect_item->uAttributes; |
2630 v61 = 0; | 2652 if ( BYTE1(v38) & 1 ) |
2631 v56 = 0; | 2653 { |
2632 v51 = 0; | 2654 v61 = 0; |
2633 v47 = pGlobalTXT_LocalizationStrings[187]; | 2655 v56 = 0; |
2634 } | 2656 v51 = 0; |
2635 else | 2657 v47 = pGlobalTXT_LocalizationStrings[187]; //"Stolen" |
2636 { | 2658 } |
2637 if ( !(BYTE1(v38) & 2) ) | 2659 else |
2638 goto LABEL_116; | 2660 { |
2639 v61 = 0; | 2661 if ( !(BYTE1(v38) & 2) ) |
2640 v56 = 0; | 2662 goto LABEL_116; |
2641 v51 = 0; | 2663 v61 = 0; |
2642 v47 = pGlobalTXT_LocalizationStrings[651]; | 2664 v56 = 0; |
2643 } | 2665 v51 = 0; |
2644 LOWORD(v38) = LOWORD(pRenderer->uTargetRMask); | 2666 v47 = pGlobalTXT_LocalizationStrings[651]; //"Hardened" |
2645 v44 = v38; | 2667 } |
2646 v42 = v79.uFrameHeight - LOBYTE(v82->uFontHeight); | 2668 LOWORD(v38) = LOWORD(pRenderer->uTargetRMask); |
2647 v39 = v82->GetLineWidth(pTmpBuf); | 2669 v44 = v38; |
2648 v40 = v82; | 2670 v42 = wHintWindow.uFrameHeight - LOBYTE(pFontComic->uFontHeight); |
2649 v41 = v39 + 132; | 2671 v39 = pFontComic->GetLineWidth(pTmpBuf); |
2650 } | 2672 v40 = pFontComic; |
2651 v79.DrawText(v40, v41, v42, v44, v47, v51, v56, v61); | 2673 v41 = v39 + 132; |
2674 } | |
2675 wHintWindow.DrawText(v40, v41, v42, v44, v47, v51, v56, v61); | |
2652 LABEL_116: | 2676 LABEL_116: |
2653 pRenderer->ResetClip(); | 2677 pRenderer->ResetClip(); |
2654 if ( !areWeLoadingTexture ) | 2678 if ( !areWeLoadingTexture ) |
2655 { | 2679 { |
2656 v73->Release(); | 2680 v73->Release(); |
2657 pIcons_LOD->_40F9C5(); | 2681 pIcons_LOD->_40F9C5(); |
2658 } | 2682 } |
2659 return; | 2683 return; |
2660 } | |
2661 if (item_desc->uEquipType == 13) | |
2662 { | |
2663 v24 = pItemsTable->pItems[_this->uItemID].uDamageDice; | |
2664 LABEL_56: | |
2665 v59 = v24; | |
2666 v54 = pGlobalTXT_LocalizationStrings[449]; | |
2667 v49 = "%s: %d"; | |
2668 LABEL_64: | |
2669 sprintf(a1 + 200, v49, v54, v59); | |
2670 goto LABEL_65; | |
2671 } | |
2672 v25 = _this->uEncantmentType; | |
2673 if ( v25 ) | |
2674 { | |
2675 v60 = _this->_bonus_strength; | |
2676 v55 = *((int *)&pItemsTable->pItems[799].uDamageMod + 5 * v25); | |
2677 v50 = pGlobalTXT_LocalizationStrings[210]; | |
2678 v46 = "%s: %s +%d"; | |
2679 } | |
2680 else | |
2681 { | |
2682 v26 = _this->uSpecEnchantmentType; | |
2683 if ( !v26 ) | |
2684 { | |
2685 if ( _this->uNumCharges ) | |
2686 { | |
2687 v59 = _this->uNumCharges; | |
2688 v54 = pGlobalTXT_LocalizationStrings[464]; | |
2689 v49 = "%s: %lu"; | |
2690 goto LABEL_64; | |
2691 } | |
2692 goto LABEL_65; | |
2693 } | |
2694 v60 = _this->_bonus_strength; | |
2695 v55 = *((int *)&pItemsTable->pEnchantments[23].pBonusStat + 7 * v26); | |
2696 v50 = pGlobalTXT_LocalizationStrings[210]; | |
2697 v46 = "%s: %s"; | |
2698 } | |
2699 sprintf(a1 + 200, v46, v50, v55, v60); | |
2700 goto LABEL_65; | |
2701 } | 2684 } |
2702 // 4E455C: using guessed type int dword_4E455C; | 2685 // 4E455C: using guessed type int dword_4E455C; |
2703 // 506128: using guessed type int areWeLoadingTexture; | 2686 // 506128: using guessed type int areWeLoadingTexture; |
2687 | |
2704 | 2688 |
2705 //----- (0041E360) -------------------------------------------------------- | 2689 //----- (0041E360) -------------------------------------------------------- |
2706 char *__fastcall MonsterPopup_Draw(unsigned int uActorID, GUIWindow *edx0) | 2690 char *__fastcall MonsterPopup_Draw(unsigned int uActorID, GUIWindow *edx0) |
2707 { | 2691 { |
2708 unsigned int v2; // esi@1 | 2692 unsigned int v2; // esi@1 |