Mercurial > mm7
changeset 549:f146781c5c2d
Draw_item_info fixing
author | Gloval |
---|---|
date | Mon, 04 Mar 2013 00:15:39 +0400 |
parents | 0193f10fecbf |
children | c314e671d29c |
files | mm7_1.cpp mm7_data.h |
diffstat | 2 files changed, 272 insertions(+), 288 deletions(-) [+] |
line wrap: on
line diff
--- a/mm7_1.cpp Sun Mar 03 18:39:35 2013 +0600 +++ b/mm7_1.cpp Mon Mar 04 00:15:39 2013 +0400 @@ -2233,8 +2233,8 @@ //----- (0041D895) -------------------------------------------------------- -void GameUI_DrawItemInfo(ItemGen *ecx0) -{ +void GameUI_DrawItemInfo( struct ItemGen* inspect_item ) + { ItemGen *v1; // esi@1 unsigned int v2; // eax@3 //char *v3; // edi@5 @@ -2242,7 +2242,6 @@ //unsigned int v5; // esi@5 signed int v6; // eax@5 int v7; // edx@5 - ItemGen *v8; // ecx@10 //unsigned int v9; // eax@12 char v10; // zf@16 ItemGen *v11; // eax@16 @@ -2264,7 +2263,7 @@ int v27; // eax@67 const char *v28; // edi@69 int v29; // eax@70 - char *v30; // edi@78 + char v30; // edi@78 const char *v31; // eax@78 int v32; // ecx@81 unsigned int v33; // eax@81 @@ -2296,7 +2295,7 @@ int v59; // [sp-8h] [bp-280h]@56 int v60; // [sp-8h] [bp-280h]@58 unsigned int v61; // [sp-8h] [bp-280h]@110 - char a1[300]; // [sp+8h] [bp-270h]@40 + char out_text[300]; // [sp+8h] [bp-270h]@40 //char Dest[100]; // [sp+6Ch] [bp-20Ch]@40 //char v64[100]; // [sp+D0h] [bp-1A8h]@40 char v65[120]; // [sp+134h] [bp-144h]@92 @@ -2314,31 +2313,30 @@ //char *v76; // [sp+1FCh] [bp-7Ch]@5 int v77; // [sp+200h] [bp-78h]@12 int v78; // [sp+204h] [bp-74h]@5 - GUIWindow v79; // [sp+208h] [bp-70h]@2 + GUIWindow wHintWindow; // [sp+208h] [bp-70h]@2 POINT a2; // [sp+25Ch] [bp-1Ch]@2 int v81; // [sp+264h] [bp-14h]@5 - GUIFont *v82; // [sp+268h] [bp-10h]@1 - char *v83; // [sp+26Ch] [bp-Ch]@18 + // GUIFont *pFontComic; // [sp+268h] [bp-10h]@1 + PlayerSpeech v83; // [sp+26Ch] [bp-Ch]@18 + char* v84; + int v85; char *Str; // [sp+270h] [bp-8h]@65 - ItemGen *_this; // [sp+274h] [bp-4h]@1 - - v1 = ecx0; - _this = ecx0; + + v1 = inspect_item; var88 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); - v82 = pFontComic; - if (!v1->uItemID) + if (!inspect_item->uItemID) return; - v79.Hint = 0; - v79.uFrameWidth = 384; - v79.uFrameHeight = 180; - v79.uFrameY = 40; + wHintWindow.Hint = 0; + wHintWindow.uFrameWidth = 384; + wHintWindow.uFrameHeight = 180; + wHintWindow.uFrameY = 40; if ( pMouse->GetCursorPos(&a2)->x <= 320 ) v2 = pMouse->GetCursorPos(&a2)->x + 30; else - v2 = pMouse->GetCursorPos(&a2)->x - v79.uFrameWidth - 30; - v79.uFrameX = v2; - auto item_desc = &pItemsTable->pItems[_this->uItemID]; + v2 = pMouse->GetCursorPos(&a2)->x - wHintWindow.uFrameWidth - 30; + wHintWindow.uFrameX = v2; + auto item_desc = &pItemsTable->pItems[inspect_item->uItemID]; //v3 = (char *)&pItemsTable->pItems[_this->uItemID].pIconName; //v76 = v3; //v4 = pIcons_LOD->LoadTexture(pItemsTable->pItems[_this->uItemID].pIconName, TEXTURE_16BIT_PALETTE); @@ -2357,33 +2355,32 @@ v81 = 0; else v81 >>= 1; - v8 = _this; if ( !item_desc->uItemID_Rep_St ) - _this->SetIdentified(); + inspect_item->SetIdentified(); //v9 = v8->uAttributes; v77 = 0; //a2.y = v8->uAttributes & 2; - if (pItemsTable->pItems[v8->uItemID].uEquipType == EQUIP_GOLD) - v77 = v8->uSpecEnchantmentType; + if (pItemsTable->pItems[inspect_item->uItemID].uEquipType == EQUIP_GOLD) + v77 = inspect_item->uSpecEnchantmentType; if ( uActiveCharacter ) { - if (!v8->Identified()) + //try to identify + if (!inspect_item->Identified()) { - v10 = pPlayers[uActiveCharacter]->CanIdentify(_this) == 1; - v11 = _this; - if ( v10 ) - _this->SetIdentified(); - v10 = !v11->Identified(); - v83 = (char *)9; - if ( v10 ) + + v11 = inspect_item; + if ( pPlayers[uActiveCharacter]->CanIdentify(inspect_item) == 1 ) + inspect_item->SetIdentified(); + v83 = SPEECH_9; + if ( !inspect_item->Identified() ) { - ShowStatusBarString(pGlobalTXT_LocalizationStrings[446], 2u); + ShowStatusBarString(pGlobalTXT_LocalizationStrings[446], 2u);//"Identify Failed" } else { - v83 = (char *)SPEECH_8; - if ( _this->GetValue() < 100 * (pPlayers[uActiveCharacter]->uLevel + 5) ) - v83 = (char *)SPEECH_7; + v83 = SPEECH_8; + if ( inspect_item->GetValue() < 100 * (pPlayers[uActiveCharacter]->uLevel + 5) ) + v83 = SPEECH_7; } if ( dword_4E455C ) { @@ -2391,96 +2388,95 @@ dword_4E455C = 0; } } - _this->UpdateTempBonus(pParty->uTimePlayed); - if (v8->Broken()) + inspect_item->UpdateTempBonus(pParty->uTimePlayed); + if (inspect_item->Broken()) { - v10 = pPlayers[uActiveCharacter]->CanRepair(_this) == 1; - v12 = _this; - if ( v10 ) - _this->uAttributes = _this->uAttributes & 0xFFFFFFFD | 1; - v10 = !v12->Broken(); - v83 = (char *)SPEECH_11; - if ( v10 ) - v83 = (char *)SPEECH_10; + if ( pPlayers[uActiveCharacter]->CanRepair(inspect_item) == 1 ) + inspect_item->uAttributes = inspect_item->uAttributes & 0xFFFFFFFD | 1; + v83 = SPEECH_11; + if ( !inspect_item->Broken() ) + v83 = SPEECH_10; else - ShowStatusBarString(pGlobalTXT_LocalizationStrings[448], 2u); + ShowStatusBarString(pGlobalTXT_LocalizationStrings[448], 2u);//"Repair Failed" if ( dword_4E455C ) { - pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)(int)v83, 0); + pPlayers[uActiveCharacter]->PlaySound(v83, 0); dword_4E455C = 0; } } } //v13 = _this->uAttributes; //v14 = _this->Identified(); - a2.y = _this->Identified(); - if (_this->Broken()) + //a2.y = inspect_item->Identified(); + if (inspect_item->Broken()) { - v79.DrawMessageBox(0); + wHintWindow.DrawMessageBox(0); //v15 = &; - pRenderer->Clip(v79.uFrameX + 12, v79.uFrameY + 12, - v79.uFrameX + v79.uFrameWidth - 12, v79.uFrameY + v79.uFrameHeight - 12); - v79.uFrameWidth -= 24; - v79.uFrameHeight -= 12; - v79.uFrameZ = v79.uFrameX + v79.uFrameWidth - 1; - v79.uFrameW = v79.uFrameY + v79.uFrameHeight - 1; - pRenderer->DrawTransparentRedShade(v79.uFrameX + v78, v81 + v79.uFrameY + 30, v73); - if ( a2.y ) - v16 = _this->GetIdentifiedName(); + pRenderer->Clip(wHintWindow.uFrameX + 12, wHintWindow.uFrameY + 12, + wHintWindow.uFrameX + wHintWindow.uFrameWidth - 12, + wHintWindow.uFrameY + wHintWindow.uFrameHeight - 12); + wHintWindow.uFrameWidth -= 24; + wHintWindow.uFrameHeight -= 12; + wHintWindow.uFrameZ = wHintWindow.uFrameX + wHintWindow.uFrameWidth - 1; + wHintWindow.uFrameW = wHintWindow.uFrameY + wHintWindow.uFrameHeight - 1; + pRenderer->DrawTransparentRedShade(wHintWindow.uFrameX + v78, v81 + wHintWindow.uFrameY + 30, v73); + if ( inspect_item->Identified()) + v16 = inspect_item->GetIdentifiedName(); else v16 = item_desc->pUnidentifiedName; - v79.DrawTitleText(pFontArrus, 0, 0xCu, var88, v16, 3u); - v17 = pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[32], &v79, 0, 0); - v57 = 3; - v52 = pGlobalTXT_LocalizationStrings[32]; - goto LABEL_37; - } - if (!_this->Identified()) - { - v79.DrawMessageBox(0); - //v15 = pRenderer; - pRenderer->Clip(v79.uFrameX + 12, v79.uFrameY + 12, - v79.uFrameX + v79.uFrameWidth - 12, v79.uFrameY + v79.uFrameHeight - 12); - v79.uFrameWidth -= 24; - v79.uFrameHeight -= 12; - v79.uFrameZ = v79.uFrameX + v79.uFrameWidth - 1; - v79.uFrameW = v79.uFrameY + v79.uFrameHeight - 1; - pRenderer->DrawTextureTransparent(v79.uFrameX + v78, v81 + v79.uFrameY + 30, v73); - v79.DrawTitleText(pFontArrus, 0, 0xCu, var88, item_desc->pUnidentifiedName, 3u); - v17 = pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[232], &v79, 0, 0); - v57 = 3; - v52 = pGlobalTXT_LocalizationStrings[232]; -LABEL_37: + wHintWindow.DrawTitleText(pFontArrus, 0, 0xCu, var88, v16, 3u); + v17 = pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[32], &wHintWindow, 0, 0); //"Broken Item" v18 = v17 >> 1; v19 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0x19u, 0x19u); - v79.DrawTitleText(pFontArrus, 0x64u, ((signed int)v79.uFrameHeight >> 1) - v18, v19, v52, v57); + wHintWindow.DrawTitleText(pFontArrus, 0x64u, ((signed int)wHintWindow.uFrameHeight >> 1) - v18, v19, pGlobalTXT_LocalizationStrings[32], 3); //"Broken Item" + goto LABEL_116; + } + if (!inspect_item->Identified()) + { + wHintWindow.DrawMessageBox(0); + pRenderer->Clip(wHintWindow.uFrameX + 12, wHintWindow.uFrameY + 12, + wHintWindow.uFrameX + wHintWindow.uFrameWidth - 12, + wHintWindow.uFrameY + wHintWindow.uFrameHeight - 12); + wHintWindow.uFrameWidth -= 24; + wHintWindow.uFrameHeight -= 12; + wHintWindow.uFrameZ = wHintWindow.uFrameX + wHintWindow.uFrameWidth - 1; + wHintWindow.uFrameW = wHintWindow.uFrameY + wHintWindow.uFrameHeight - 1; + pRenderer->DrawTextureTransparent(wHintWindow.uFrameX + v78, v81 + wHintWindow.uFrameY + 30, v73); + wHintWindow.DrawTitleText(pFontArrus, 0, 0xCu, var88, item_desc->pUnidentifiedName, 3u); + v17 = pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[232], &wHintWindow, 0, 0); ///"Not Identified" + v18 = v17 >> 1; + v19 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0x19u, 0x19u); + wHintWindow.DrawTitleText(pFontArrus, 0x64u, ((signed int)wHintWindow.uFrameHeight >> 1) - v18, v19, pGlobalTXT_LocalizationStrings[232], 3); goto LABEL_116; } - sprintfex(a1, pGlobalTXT_LocalizationStrings[463], item_desc->pUnidentifiedName); - a1[100] = 0; - a1[200] = 0; + sprintfex(out_text, pGlobalTXT_LocalizationStrings[463], item_desc->pUnidentifiedName); //"Type: %s" + out_text[100] = 0; + out_text[200] = 0; //v20 = item_desc->uEquipType; switch (item_desc->uEquipType) { case EQUIP_ONE_OR_TWO_HANDS: case EQUIP_TWO_HANDED: - 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); + sprintfex(out_text + 100, "%s: +%d %s: %dd%d", pGlobalTXT_LocalizationStrings[LOCSTR_ATTACK], + (int)item_desc->uDamageMod, pGlobalTXT_LocalizationStrings[53], (int)item_desc->uDamageDice, (int)item_desc->uDamageRoll); //"Damage" if (item_desc->uDamageMod) { char mod[16]; sprintf(mod, "+%d", (int)item_desc->uDamageMod); - strcat(a1 + 100, mod); + strcat(out_text + 100, mod); } break; case EQUIP_BOW: - 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); + sprintfex(out_text + 100, "%s: +%d %s: %dd%d", pGlobalTXT_LocalizationStrings[203], //"Shoot" + (int)item_desc->uDamageMod, pGlobalTXT_LocalizationStrings[53], //"Damage" + (int)item_desc->uDamageDice, (int)item_desc->uDamageRoll); if (item_desc->uDamageMod) { char mod[16]; sprintf(mod, "+%d", (int)item_desc->uDamageMod); - strcat(a1 + 100, mod); + strcat(out_text + 100, mod); } break; @@ -2493,215 +2489,203 @@ case EQUIP_BOOTS: case EQUIP_RING: case EQUIP_AMULET: - if (item_desc->uDamageDice) - sprintfex(a1 + 100, "%s: +%d", pGlobalTXT_LocalizationStrings[11], item_desc->uDamageDice + item_desc->uDamageMod); + if (item_desc->uDamageDice) //"Armor" + sprintfex(out_text + 100, "%s: +%d", pGlobalTXT_LocalizationStrings[11], item_desc->uDamageDice + item_desc->uDamageMod); break; + case EQUIP_POTION: + if ( inspect_item->uEncantmentType ) + sprintf(out_text + 200, "%s: %d",pGlobalTXT_LocalizationStrings[449] , inspect_item->uEncantmentType); //"Power" + break; + case EQUIP_REAGENT: + sprintf(out_text + 200, "%s: %d", pGlobalTXT_LocalizationStrings[449], pItemsTable->pItems[inspect_item->uItemID].uDamageDice); //"Power" + break; } if ( v77 ) goto LABEL_65; //v23 = item_desc->uEquipType; - if (item_desc->uEquipType == 14) - { - v24 = _this->uEncantmentType; - if ( v24 ) - goto LABEL_56; -LABEL_65: - v79.uFrameWidth -= 12; - a2.y = 3; - v79.uFrameZ = v79.uFrameX + v79.uFrameWidth - 1; - v79.uFrameW = v79.uFrameY + v79.uFrameHeight - 1; - Str = (char *)(3 * (LOBYTE(pFontArrus->uFontHeight) + 8)); - v83 = a1; - do - { - if ( *v83 ) - { - v27 = v82->CalcTextHeight(v83, &v79, 100, 0); - Str += v27 + 3; - } - v83 += 100; - --a2.y; - } - while ( a2.y ); - v28 = item_desc->pDescription; - if ( *v28 ) - { - v29 = pFontSmallnum->CalcTextHeight(v28, &v79, 100, 0); - Str += v29; - } - v79.uFrameHeight = v73->uTextureHeight + v81 + 54; - if ( (signed int)Str > (signed int)v79.uFrameHeight ) - v79.uFrameHeight = (unsigned int)Str; - if ( _this->uAttributes & 8 && (_this->uSpecEnchantmentType || _this->uEncantmentType) ) - v79.uFrameHeight += LOBYTE(v82->uFontHeight); - v83 = 0; - if ( LOBYTE(pFontArrus->uFontHeight) ) - { - v79.uFrameWidth -= 24; - v30 = (char *)LOBYTE(pFontArrus->uFontHeight); - v31 = _this->GetIdentifiedName(); - if ( pFontArrus->CalcTextHeight(v31, &v79, 0, 0) / (signed int)v30 ) - v83 = v30; - v79.uFrameWidth += 24; - } - v79.uFrameWidth += 12; - v79.uFrameHeight += (unsigned int)v83; - v79.uFrameW = v79.uFrameY + v79.uFrameHeight - 1; - v79.uFrameZ = v79.uFrameX + v79.uFrameWidth - 1; - v79.DrawMessageBox(0); - //v15 = pRenderer; - pRenderer->Clip(v79.uFrameX + 12, v79.uFrameY + 12, - v79.uFrameX + v79.uFrameWidth - 12, v79.uFrameY + v79.uFrameHeight - 12); - v79.uFrameWidth -= 12; - v32 = v73->uTextureHeight; - v33 = v79.uFrameHeight; - v79.uFrameHeight -= 12; - v79.uFrameZ = v79.uFrameX + v79.uFrameWidth - 1; - v79.uFrameW = v79.uFrameY + v79.uFrameHeight - 1; - pRenderer->DrawTextureTransparent( - v79.uFrameX + v78, - v79.uFrameY + (signed int)(v33 - v32) / 2, - v73); - a2.y = 3; - v34 = (int)(v83 + 35); - Str = a1; - do - { - if ( *Str ) - { - v79.DrawText(v82, 100, v34, 0, Str, 0, 0, 0); - v34 += v82->CalcTextHeight(Str, &v79, 100, 0) + 3; - } - Str += 100; - --a2.y; - } - while ( a2.y ); - v35 = item_desc->pDescription; - if ( *v35 ) - v79.DrawText(pFontSmallnum, 100, v34, 0, v35, 0, 0, 0); - v79.uFrameX += 12; - v79.uFrameWidth -= 24; - v36 = _this->GetIdentifiedName(); - v79.DrawTitleText(pFontArrus, 0, 0xCu, var88, v36, 3u); - v79.uFrameWidth += 24; - v79.uFrameX -= 12; - if ( v77 ) - { - sprintf(pTmpBuf, "%s: %lu", pGlobalTXT_LocalizationStrings[465], v77); - v40 = v82; - v61 = 0; - v56 = 0; - v51 = 0; - v47 = pTmpBuf; - v44 = 0; - v42 = v79.uFrameHeight - LOBYTE(v82->uFontHeight); - v41 = 100; - } - else + + + if ( inspect_item->uEncantmentType ) + { + sprintf(out_text + 200, "%s: %s +%d", pGlobalTXT_LocalizationStrings[210], + pItemsTable->pEnchantments[inspect_item->uEncantmentType-1].pOfName, inspect_item->_bonus_strength); //"Special" + } + else if ( inspect_item->uSpecEnchantmentType ) { - if ( _this->uAttributes & 8 && (_this->uSpecEnchantmentType || _this->uEncantmentType) ) - { - sub_493F79(&v67, _this->uExpireTime - pParty->uTimePlayed); - strcpy(pTmpBuf, "Duration:"); - Str = (char *)(v67.field_18_expire_year - game_starting_year); - if (v67.field_18_expire_year != 1168 ) - { - sprintf(v65, " %d:yr", v67.field_18_expire_year - game_starting_year); - strcat(pTmpBuf, v65); - } - 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) - && ((sprintf(v65, " %d:dy", v67.field_C_expire_day), strcat(pTmpBuf, v65), v67.field_14_exprie_month) || Str || v67.field_C_expire_day) - || v67.field_8_expire_hour) - && ((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) - || v67.field_4_expire_minute ) - { - sprintf(v65, " %d:mn", v67.field_4_expire_minute); - strcat(pTmpBuf, v65); - } - v79.DrawText(v82, 100, v79.uFrameHeight - 2 * LOBYTE(v82->uFontHeight), 0, pTmpBuf, 0, 0, 0); - } - v37 = _this->GetValue(); - sprintf(pTmpBuf, "%s: %lu", pGlobalTXT_LocalizationStrings[465], v37); - v79.DrawText(v82, 100, v79.uFrameHeight - LOBYTE(v82->uFontHeight), 0, pTmpBuf, 0, 0, 0); - v38 = _this->uAttributes; - if ( BYTE1(v38) & 1 ) - { - v61 = 0; - v56 = 0; - v51 = 0; - v47 = pGlobalTXT_LocalizationStrings[187]; - } - else - { - if ( !(BYTE1(v38) & 2) ) - goto LABEL_116; - v61 = 0; - v56 = 0; - v51 = 0; - v47 = pGlobalTXT_LocalizationStrings[651]; - } - LOWORD(v38) = LOWORD(pRenderer->uTargetRMask); - v44 = v38; - v42 = v79.uFrameHeight - LOBYTE(v82->uFontHeight); - v39 = v82->GetLineWidth(pTmpBuf); - v40 = v82; - v41 = v39 + 132; + + + sprintf(out_text + 200, "%s: %s", pGlobalTXT_LocalizationStrings[210], + pItemsTable->pSpecialEnchantments[inspect_item->uSpecEnchantmentType-1].pNameAdd, inspect_item->_bonus_strength); } - v79.DrawText(v40, v41, v42, v44, v47, v51, v56, v61); + + else if ( inspect_item->uNumCharges ) + { + sprintf(out_text + 200, "%s: %lu", pGlobalTXT_LocalizationStrings[464], inspect_item->uNumCharges); //"Charges" + + } + +LABEL_65: + wHintWindow.uFrameWidth -= 12; + v85 = 3; + wHintWindow.uFrameZ = wHintWindow.uFrameX + wHintWindow.uFrameWidth - 1; + wHintWindow.uFrameW = wHintWindow.uFrameY + wHintWindow.uFrameHeight - 1; + Str = (char *)(3 * (LOBYTE(pFontArrus->uFontHeight) + 8)); + v84 = &out_text[0]; + do + { + if ( *v84 ) + { + v27 = pFontComic->CalcTextHeight(v84, &wHintWindow, 100, 0); + Str += v27 + 3; + } + v84 += 100; + --v85; + } + while ( v85 ); + v28 = item_desc->pDescription; + if ( *v28 ) + { + v29 = pFontSmallnum->CalcTextHeight(v28, &wHintWindow, 100, 0); + Str += v29; + } + wHintWindow.uFrameHeight = v73->uTextureHeight + v81 + 54; + if ( (signed int)Str > (signed int)wHintWindow.uFrameHeight ) + wHintWindow.uFrameHeight = (unsigned int)Str; + if ( inspect_item->uAttributes & 8 && (inspect_item->uSpecEnchantmentType || inspect_item->uEncantmentType) ) + wHintWindow.uFrameHeight += LOBYTE(pFontComic->uFontHeight); + v85 = 0; + if ( pFontArrus->uFontHeight ) + { + wHintWindow.uFrameWidth -= 24; + v30 = pFontArrus->uFontHeight; + v31 = inspect_item->GetIdentifiedName(); + if ( pFontArrus->CalcTextHeight(v31, &wHintWindow, 0, 0) / (signed int)v30 ) + v85 = v30; + wHintWindow.uFrameWidth += 24; + } + wHintWindow.uFrameWidth += 12; + wHintWindow.uFrameHeight += (unsigned int)v85; + wHintWindow.uFrameW = wHintWindow.uFrameY + wHintWindow.uFrameHeight - 1; + wHintWindow.uFrameZ = wHintWindow.uFrameX + wHintWindow.uFrameWidth - 1; + wHintWindow.DrawMessageBox(0); + //v15 = pRenderer; + pRenderer->Clip(wHintWindow.uFrameX + 12, wHintWindow.uFrameY + 12, + wHintWindow.uFrameX + wHintWindow.uFrameWidth - 12, wHintWindow.uFrameY + wHintWindow.uFrameHeight - 12); + wHintWindow.uFrameWidth -= 12; + v32 = v73->uTextureHeight; + v33 = wHintWindow.uFrameHeight; + wHintWindow.uFrameHeight -= 12; + wHintWindow.uFrameZ = wHintWindow.uFrameX + wHintWindow.uFrameWidth - 1; + wHintWindow.uFrameW = wHintWindow.uFrameY + wHintWindow.uFrameHeight - 1; + pRenderer->DrawTextureTransparent( + wHintWindow.uFrameX + v78, + wHintWindow.uFrameY + (signed int)(v33 - v32) / 2, + v73); + + v34 = (int)(v85 + 35); + v85 = 3; + Str = out_text; + do + { + if ( *Str ) + { + wHintWindow.DrawText(pFontComic, 100, v34, 0, Str, 0, 0, 0); + v34 += pFontComic->CalcTextHeight(Str, &wHintWindow, 100, 0) + 3; + } + Str += 100; + --v85; + } + while (v85 ); + v35 = item_desc->pDescription; + if ( *v35 ) + wHintWindow.DrawText(pFontSmallnum, 100, v34, 0, v35, 0, 0, 0); + wHintWindow.uFrameX += 12; + wHintWindow.uFrameWidth -= 24; + v36 = inspect_item->GetIdentifiedName(); + wHintWindow.DrawTitleText(pFontArrus, 0, 0xCu, var88, v36, 3u); + wHintWindow.uFrameWidth += 24; + wHintWindow.uFrameX -= 12; + if ( v77 ) + { + sprintf(pTmpBuf, "%s: %lu", pGlobalTXT_LocalizationStrings[465], v77);//"Value" + v40 = pFontComic; + v61 = 0; + v56 = 0; + v51 = 0; + v47 = pTmpBuf; + v44 = 0; + v42 = wHintWindow.uFrameHeight - LOBYTE(pFontComic->uFontHeight); + v41 = 100; + } + else + { + if ( (inspect_item->uAttributes & 8) && (inspect_item->uSpecEnchantmentType || inspect_item->uEncantmentType) ) + { + sub_493F79(&v67, inspect_item->uExpireTime - pParty->uTimePlayed); + strcpy(pTmpBuf, "Duration:"); + Str = (char *)(v67.field_18_expire_year - game_starting_year); + if (v67.field_18_expire_year != 1168 ) + { + sprintf(v65, " %d:yr", v67.field_18_expire_year - game_starting_year); + strcat(pTmpBuf, v65); + } + 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) + && ((sprintf(v65, " %d:dy", v67.field_C_expire_day), strcat(pTmpBuf, v65), v67.field_14_exprie_month) || Str || + v67.field_C_expire_day) + || v67.field_8_expire_hour) + && ((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) + || v67.field_4_expire_minute ) + { + sprintf(v65, " %d:mn", v67.field_4_expire_minute); + strcat(pTmpBuf, v65); + } + wHintWindow.DrawText(pFontComic, 100, wHintWindow.uFrameHeight - 2 * LOBYTE(pFontComic->uFontHeight), 0, pTmpBuf, 0, 0, 0); + } + v37 = inspect_item->GetValue(); + sprintf(pTmpBuf, "%s: %lu", pGlobalTXT_LocalizationStrings[465], v37); + wHintWindow.DrawText(pFontComic, 100, wHintWindow.uFrameHeight - LOBYTE(pFontComic->uFontHeight), 0, pTmpBuf, 0, 0, 0); + v38 = inspect_item->uAttributes; + if ( BYTE1(v38) & 1 ) + { + v61 = 0; + v56 = 0; + v51 = 0; + v47 = pGlobalTXT_LocalizationStrings[187]; //"Stolen" + } + else + { + if ( !(BYTE1(v38) & 2) ) + goto LABEL_116; + v61 = 0; + v56 = 0; + v51 = 0; + v47 = pGlobalTXT_LocalizationStrings[651]; //"Hardened" + } + LOWORD(v38) = LOWORD(pRenderer->uTargetRMask); + v44 = v38; + v42 = wHintWindow.uFrameHeight - LOBYTE(pFontComic->uFontHeight); + v39 = pFontComic->GetLineWidth(pTmpBuf); + v40 = pFontComic; + v41 = v39 + 132; + } + wHintWindow.DrawText(v40, v41, v42, v44, v47, v51, v56, v61); LABEL_116: - pRenderer->ResetClip(); - if ( !areWeLoadingTexture ) - { - v73->Release(); - pIcons_LOD->_40F9C5(); - } - return; - } - if (item_desc->uEquipType == 13) - { - v24 = pItemsTable->pItems[_this->uItemID].uDamageDice; -LABEL_56: - v59 = v24; - v54 = pGlobalTXT_LocalizationStrings[449]; - v49 = "%s: %d"; -LABEL_64: - sprintf(a1 + 200, v49, v54, v59); - goto LABEL_65; - } - v25 = _this->uEncantmentType; - if ( v25 ) - { - v60 = _this->_bonus_strength; - v55 = *((int *)&pItemsTable->pItems[799].uDamageMod + 5 * v25); - v50 = pGlobalTXT_LocalizationStrings[210]; - v46 = "%s: %s +%d"; - } - else - { - v26 = _this->uSpecEnchantmentType; - if ( !v26 ) - { - if ( _this->uNumCharges ) - { - v59 = _this->uNumCharges; - v54 = pGlobalTXT_LocalizationStrings[464]; - v49 = "%s: %lu"; - goto LABEL_64; - } - goto LABEL_65; - } - v60 = _this->_bonus_strength; - v55 = *((int *)&pItemsTable->pEnchantments[23].pBonusStat + 7 * v26); - v50 = pGlobalTXT_LocalizationStrings[210]; - v46 = "%s: %s"; - } - sprintf(a1 + 200, v46, v50, v55, v60); - goto LABEL_65; + pRenderer->ResetClip(); + if ( !areWeLoadingTexture ) + { + v73->Release(); + pIcons_LOD->_40F9C5(); + } + return; } // 4E455C: using guessed type int dword_4E455C; // 506128: using guessed type int areWeLoadingTexture; + //----- (0041E360) -------------------------------------------------------- char *__fastcall MonsterPopup_Draw(unsigned int uActorID, GUIWindow *edx0) {
--- a/mm7_data.h Sun Mar 03 18:39:35 2013 +0600 +++ b/mm7_data.h Mon Mar 04 00:15:39 2013 +0400 @@ -1893,7 +1893,7 @@ void __cdecl GameUI_DrawStatusBar(); bool __thiscall sub_41CD4F(unsigned int _this); char __fastcall sub_41D20D_buff_remaining_time_string(int ecx0, struct GUIWindow *edx0, __int64 a3, struct GUIFont *a2); -void GameUI_DrawItemInfo(struct ItemGen *_this); // idb +void GameUI_DrawItemInfo(struct ItemGen* inspect_item); // idb char *__fastcall MonsterPopup_Draw(unsigned int uActorID, struct GUIWindow *edx0); void __cdecl nullsub_3(); // idb void __cdecl LoadActualSkyFrame();