Mercurial > mm7
changeset 1701:edb41570f81b
Merge
author | Grumpy7 |
---|---|
date | Sun, 22 Sep 2013 18:10:35 +0200 |
parents | ef42788fef1d (current diff) 33c7cc2d48d5 (diff) |
children | 5cbd88f8a2eb |
files | |
diffstat | 3 files changed, 507 insertions(+), 741 deletions(-) [+] |
line wrap: on
line diff
--- a/UI/UIPopup.cpp Sun Sep 22 18:09:44 2013 +0200 +++ b/UI/UIPopup.cpp Sun Sep 22 18:10:35 2013 +0200 @@ -106,61 +106,17 @@ //----- (0041D895) -------------------------------------------------------- void GameUI_DrawItemInfo( struct ItemGen* inspect_item ) - { - ItemGen *v1; // esi@1 +{ unsigned int v2; // eax@3 - signed int v6; // eax@5 - int v7; // edx@5 - char v10; // zf@16 - ItemGen *v11; // eax@16 - ItemGen *v12; // eax@25 - const char *v16; // eax@34 - int v17; // eax@36 - int v18; // esi@37 - unsigned __int16 v19; // ax@37 - char v21; // al@44 - int v24; // eax@52 - int v25; // eax@57 - int v26; // eax@60 - int v27; // eax@67 const char *v28; // edi@69 - int v29; // eax@70 - char v30; // edi@78 - const char *v31; // eax@78 - int v32; // ecx@81 - unsigned int v33; // eax@81 int v34; // esi@81 - const char *v35; // eax@85 - const char *v36; // eax@87 - unsigned int v37; // eax@109 - unsigned int v38; // eax@109 - int v39; // eax@113 - GUIFont *v40; // edx@113 - signed int v41; // [sp-20h] [bp-298h]@113 - int v42; // [sp-1Ch] [bp-294h]@113 - unsigned int v44; // [sp-18h] [bp-290h]@113 - const char *v46; // [sp-14h] [bp-28Ch]@58 - char *v47; // [sp-14h] [bp-28Ch]@110 - const char *v49; // [sp-10h] [bp-288h]@56 - char *v50; // [sp-10h] [bp-288h]@58 - int v51; // [sp-10h] [bp-288h]@110 - const char *v52; // [sp-Ch] [bp-284h]@36 - char *v54; // [sp-Ch] [bp-284h]@56 - int v55; // [sp-Ch] [bp-284h]@58 - int v56; // [sp-Ch] [bp-284h]@110 - unsigned int v57; // [sp-8h] [bp-280h]@36 - int v59; // [sp-8h] [bp-280h]@56 - int v60; // [sp-8h] [bp-280h]@58 - unsigned int v61; // [sp-8h] [bp-280h]@110 + char *pText; // [sp-14h] [bp-28Ch]@110 char out_text[300]; // [sp+8h] [bp-270h]@40 char v65[120]; // [sp+134h] [bp-144h]@92 - char Source[40]; // [sp+1ACh] [bp-CCh]@49 stru351_summoned_item v67; - int var88; // [sp+1F0h] [bp-88h]@1 - Texture *v73; // [sp+1F4h] [bp-84h]@5 int v77; // [sp+200h] [bp-78h]@12 int v78; // [sp+204h] [bp-74h]@5 - GUIWindow wHintWindow; // [sp+208h] [bp-70h]@2 + GUIWindow iteminfo_window; // [sp+208h] [bp-70h]@2 POINT a2; // [sp+25Ch] [bp-1Ch]@2 int v81; // [sp+264h] [bp-14h]@5 PlayerSpeech v83; // [sp+26Ch] [bp-Ch]@18 @@ -168,175 +124,146 @@ int v85; char *Str; // [sp+270h] [bp-8h]@65 - v1 = inspect_item; - var88 = TargetColor(0xFFu, 0xFFu, 0x9Bu); - if (!inspect_item->uItemID) - return; - - 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 - 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); - //v5 = v4; - //v4 *= 72; - //v75 = v4; - //v73 = &pIcons_LOD->pTextures[v4]; - v73 = pIcons_LOD->LoadTexturePtr(item_desc->pIconName, TEXTURE_16BIT_PALETTE); - v6 = 100 - v73->uTextureWidth; - v7 = v73->uTextureHeight; - v78 = v6; - v81 = 144 - v7; - if ( v6 > 0 ) - v78 = v6 >> 1; - if ( v81 <= 0 ) - v81 = 0; - else - v81 >>= 1; - if ( !item_desc->uItemID_Rep_St ) + if (!inspect_item->uItemID) + return; + iteminfo_window.Hint = 0; + iteminfo_window.uFrameWidth = 384; + iteminfo_window.uFrameHeight = 180; + iteminfo_window.uFrameY = 40; + if ( pMouse->GetCursorPos(&a2)->x <= 320 ) + v2 = pMouse->GetCursorPos(&a2)->x + 30; + else + v2 = pMouse->GetCursorPos(&a2)->x - iteminfo_window.uFrameWidth - 30; + iteminfo_window.uFrameX = v2; + v78 = 100 - pIcons_LOD->LoadTexturePtr(pItemsTable->pItems[inspect_item->uItemID].pIconName, TEXTURE_16BIT_PALETTE)->uTextureWidth; + v81 = 144 - pIcons_LOD->LoadTexturePtr(pItemsTable->pItems[inspect_item->uItemID].pIconName, TEXTURE_16BIT_PALETTE)->uTextureHeight; + if ( v78 > 0 ) + v78 = v78 / 2; + if ( v81 <= 0 ) + v81 = 0; + else + v81 = v81 / 2; + if ( !pItemsTable->pItems[inspect_item->uItemID].uItemID_Rep_St ) + inspect_item->SetIdentified(); + v77 = 0; + if (pItemsTable->pItems[inspect_item->uItemID].uEquipType == EQUIP_GOLD) + v77 = inspect_item->uSpecEnchantmentType; + if ( uActiveCharacter ) + { + //try to identify + if (!inspect_item->IsIdentified()) + { + //v11 = inspect_item; + if ( pPlayers[uActiveCharacter]->CanIdentify(inspect_item) == 1 ) inspect_item->SetIdentified(); - //v9 = v8->uAttributes; - v77 = 0; - //a2.y = v8->uAttributes & 2; - if (pItemsTable->pItems[inspect_item->uItemID].uEquipType == EQUIP_GOLD) - v77 = inspect_item->uSpecEnchantmentType; - if ( uActiveCharacter ) - { - //try to identify - if (!inspect_item->IsIdentified()) - { - - v11 = inspect_item; - if ( pPlayers[uActiveCharacter]->CanIdentify(inspect_item) == 1 ) - inspect_item->SetIdentified(); - v83 = SPEECH_9; - if ( !inspect_item->IsIdentified() ) - { - ShowStatusBarString(pGlobalTXT_LocalizationStrings[446], 2u);//"Identify Failed" - } - else - { - v83 = SPEECH_8; - if ( inspect_item->GetValue() < 100 * (pPlayers[uActiveCharacter]->uLevel + 5) ) - v83 = SPEECH_7; - } - if ( dword_4E455C ) - { - pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)(int)v83, 0); - dword_4E455C = 0; - } - } - inspect_item->UpdateTempBonus(pParty->uTimePlayed); - if (inspect_item->IsBroken()) - { - if ( pPlayers[uActiveCharacter]->CanRepair(inspect_item) == 1 ) - inspect_item->uAttributes = inspect_item->uAttributes & 0xFFFFFFFD | 1; - v83 = SPEECH_11; - if ( !inspect_item->IsBroken() ) - v83 = SPEECH_10; - else - ShowStatusBarString(pGlobalTXT_LocalizationStrings[448], 2u);//"Repair Failed" - if ( dword_4E455C ) - { - pPlayers[uActiveCharacter]->PlaySound(v83, 0); - dword_4E455C = 0; - } - } - } - //v13 = _this->uAttributes; - //v14 = _this->Identified(); - //a2.y = inspect_item->Identified(); + v83 = SPEECH_9; + if ( !inspect_item->IsIdentified() ) + ShowStatusBarString(pGlobalTXT_LocalizationStrings[446], 2);//"Identify Failed" + else + { + v83 = SPEECH_8; + if ( inspect_item->GetValue() < 100 * (pPlayers[uActiveCharacter]->uLevel + 5) ) + v83 = SPEECH_7; + } + if ( dword_4E455C ) + { + pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)(int)v83, 0); + dword_4E455C = 0; + } + } + inspect_item->UpdateTempBonus(pParty->uTimePlayed); if (inspect_item->IsBroken()) - { - wHintWindow.DrawMessageBox(0); - //v15 = &; - pRenderer->SetTextureClipRect(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->IsIdentified()) - v16 = inspect_item->GetIdentifiedName(); - else - v16 = item_desc->pUnidentifiedName; - wHintWindow.DrawTitleText(pFontArrus, 0, 0xCu, var88, v16, 3u); - v17 = pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[32], &wHintWindow, 0, 0); //"Broken Item" - v18 = v17 >> 1; - v19 = TargetColor(0xFFu, 0x19u, 0x19u); - wHintWindow.DrawTitleText(pFontArrus, 0x64u, ((signed int)wHintWindow.uFrameHeight >> 1) - v18, v19, pGlobalTXT_LocalizationStrings[32], 3); //"Broken Item" - pRenderer->ResetTextureClipRect(); - if ( !areWeLoadingTexture ) - { - v73->Release(); - pIcons_LOD->SyncLoadedFilesCount(); - } - return; - } - if (!inspect_item->IsIdentified()) - { - wHintWindow.DrawMessageBox(0); - pRenderer->SetTextureClipRect(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 = TargetColor(0xFFu, 0x19u, 0x19u); - wHintWindow.DrawTitleText(pFontArrus, 0x64u, ((signed int)wHintWindow.uFrameHeight >> 1) - v18, v19, pGlobalTXT_LocalizationStrings[232], 3); - pRenderer->ResetTextureClipRect(); - if ( !areWeLoadingTexture ) - { - v73->Release(); - pIcons_LOD->SyncLoadedFilesCount(); - } - return; - } - - 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) - { + { + if ( pPlayers[uActiveCharacter]->CanRepair(inspect_item) == 1 ) + inspect_item->uAttributes = inspect_item->uAttributes & 0xFFFFFFFD | 1; + v83 = SPEECH_11; + if ( !inspect_item->IsBroken() ) + v83 = SPEECH_10; + else + ShowStatusBarString(pGlobalTXT_LocalizationStrings[448], 2);//"Repair Failed" + if ( dword_4E455C ) + { + pPlayers[uActiveCharacter]->PlaySound(v83, 0); + dword_4E455C = 0; + } + } + } + if (inspect_item->IsBroken()) + { + iteminfo_window.DrawMessageBox(0); + pRenderer->SetTextureClipRect(iteminfo_window.uFrameX + 12, iteminfo_window.uFrameY + 12, + iteminfo_window.uFrameX + iteminfo_window.uFrameWidth - 12, + iteminfo_window.uFrameY + iteminfo_window.uFrameHeight - 12); + iteminfo_window.uFrameWidth -= 24; + iteminfo_window.uFrameHeight -= 12; + iteminfo_window.uFrameZ = iteminfo_window.uFrameX + iteminfo_window.uFrameWidth - 1; + iteminfo_window.uFrameW = iteminfo_window.uFrameY + iteminfo_window.uFrameHeight - 1; + pRenderer->DrawTransparentRedShade(iteminfo_window.uFrameX + v78, v81 + iteminfo_window.uFrameY + 30, pIcons_LOD->LoadTexturePtr(pItemsTable->pItems[inspect_item->uItemID].pIconName, TEXTURE_16BIT_PALETTE)); + if ( inspect_item->IsIdentified()) + pText = (char *)inspect_item->GetIdentifiedName(); + else + pText = pItemsTable->pItems[inspect_item->uItemID].pUnidentifiedName; + iteminfo_window.DrawTitleText(pFontArrus, 0, 0xCu, TargetColor(0xFFu, 0xFFu, 0x9Bu), pText, 3); + iteminfo_window.DrawTitleText(pFontArrus, 0x64u, ((signed int)iteminfo_window.uFrameHeight >> 1) - pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[32], &iteminfo_window, 0, 0) / 2, + TargetColor(0xFFu, 0x19u, 0x19u), pGlobalTXT_LocalizationStrings[32], 3); //"Broken Item" + pRenderer->ResetTextureClipRect(); + if ( !areWeLoadingTexture ) + { + pIcons_LOD->LoadTexturePtr(pItemsTable->pItems[inspect_item->uItemID].pIconName, TEXTURE_16BIT_PALETTE)->Release(); + pIcons_LOD->SyncLoadedFilesCount(); + } + return; + } + if (!inspect_item->IsIdentified()) + { + iteminfo_window.DrawMessageBox(0); + pRenderer->SetTextureClipRect(iteminfo_window.uFrameX + 12, iteminfo_window.uFrameY + 12, + iteminfo_window.uFrameX + iteminfo_window.uFrameWidth - 12, iteminfo_window.uFrameY + iteminfo_window.uFrameHeight - 12); + iteminfo_window.uFrameWidth -= 24; + iteminfo_window.uFrameHeight -= 12; + iteminfo_window.uFrameZ = iteminfo_window.uFrameX + iteminfo_window.uFrameWidth - 1; + iteminfo_window.uFrameW = iteminfo_window.uFrameY + iteminfo_window.uFrameHeight - 1; + pRenderer->DrawTextureTransparent(iteminfo_window.uFrameX + v78, v81 + iteminfo_window.uFrameY + 30, pIcons_LOD->LoadTexturePtr(pItemsTable->pItems[inspect_item->uItemID].pIconName, TEXTURE_16BIT_PALETTE)); + iteminfo_window.DrawTitleText(pFontArrus, 0, 0xCu, TargetColor(0xFFu, 0xFFu, 0x9Bu), pItemsTable->pItems[inspect_item->uItemID].pUnidentifiedName, 3); + iteminfo_window.DrawTitleText(pFontArrus, 0x64u, ((signed int)iteminfo_window.uFrameHeight >> 1) - pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[232], &iteminfo_window, 0, 0) / 2, + TargetColor(0xFFu, 0x19u, 0x19u), pGlobalTXT_LocalizationStrings[232], 3);//"Not Identified" + pRenderer->ResetTextureClipRect(); + if ( !areWeLoadingTexture ) + { + pIcons_LOD->LoadTexturePtr(pItemsTable->pItems[inspect_item->uItemID].pIconName, TEXTURE_16BIT_PALETTE)->Release(); + pIcons_LOD->SyncLoadedFilesCount(); + } + return; + } + sprintfex(out_text, pGlobalTXT_LocalizationStrings[463], pItemsTable->pItems[inspect_item->uItemID].pUnidentifiedName); //"Type: %s" + out_text[100] = 0; + out_text[200] = 0; + switch (pItemsTable->pItems[inspect_item->uItemID].uEquipType) + { case EQUIP_OFF_HAND: case EQUIP_MAIN_HAND: - 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(out_text + 100, mod); - } - break; + sprintfex(out_text + 100, "%s: +%d %s: %dd%d", pGlobalTXT_LocalizationStrings[LOCSTR_ATTACK], + (int)pItemsTable->pItems[inspect_item->uItemID].uDamageMod, pGlobalTXT_LocalizationStrings[53], + (int)pItemsTable->pItems[inspect_item->uItemID].uDamageDice, (int)pItemsTable->pItems[inspect_item->uItemID].uDamageRoll); //"Damage" + if (pItemsTable->pItems[inspect_item->uItemID].uDamageMod) + { + char mod[16]; + sprintf(mod, "+%d", (int)pItemsTable->pItems[inspect_item->uItemID].uDamageMod); + strcat(out_text + 100, mod); + } + break; case EQUIP_BOW: - 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(out_text + 100, mod); - } - break; + sprintfex(out_text + 100, "%s: +%d %s: %dd%d", pGlobalTXT_LocalizationStrings[203], //"Shoot" + (int)pItemsTable->pItems[inspect_item->uItemID].uDamageMod, pGlobalTXT_LocalizationStrings[53], //"Damage" + (int)pItemsTable->pItems[inspect_item->uItemID].uDamageDice, (int)pItemsTable->pItems[inspect_item->uItemID].uDamageRoll); + if (pItemsTable->pItems[inspect_item->uItemID].uDamageMod) + { + char mod[16]; + sprintf(mod, "+%d", (int)pItemsTable->pItems[inspect_item->uItemID].uDamageMod); + strcat(out_text + 100, mod); + } + break; case EQUIP_ARMOUR: case EQUIP_SHIELD: @@ -347,260 +274,179 @@ case EQUIP_BOOTS: case EQUIP_RING: case EQUIP_AMULET: - if (item_desc->uDamageDice) //"Armor" - sprintfex(out_text + 100, "%s: +%d", pGlobalTXT_LocalizationStrings[11], item_desc->uDamageDice + item_desc->uDamageMod); - break; - - } - - if ( !v77 ) - { - if (item_desc->uEquipType ==EQUIP_POTION) //this is CORRECT! do not move to switch! - { - if ( inspect_item->uEnchantmentType ) - sprintf(out_text + 200, "%s: %d",pGlobalTXT_LocalizationStrings[449] , inspect_item->uEnchantmentType); //"Power" - } - else if (item_desc->uEquipType == EQUIP_REAGENT) - { - sprintf(out_text + 200, "%s: %d", pGlobalTXT_LocalizationStrings[449], pItemsTable->pItems[inspect_item->uItemID].uDamageDice); //"Power" - } - - else if ( inspect_item->uEnchantmentType ) - { - sprintf(out_text + 200, "%s: %s +%d", pGlobalTXT_LocalizationStrings[210], - pItemsTable->pEnchantments[inspect_item->uEnchantmentType-1].pBonusStat, inspect_item->m_enchantmentStrength); //"Special" - } - else if ( inspect_item->uSpecEnchantmentType ) - { - sprintf(out_text + 200, "%s: %s", pGlobalTXT_LocalizationStrings[210], - pItemsTable->pSpecialEnchantments[inspect_item->uSpecEnchantmentType-1].pBonusStatement, inspect_item->m_enchantmentStrength); - } - - else if ( inspect_item->uNumCharges ) - { - sprintf(out_text + 200, "%s: %lu", pGlobalTXT_LocalizationStrings[464], inspect_item->uNumCharges); //"Charges" + if (pItemsTable->pItems[inspect_item->uItemID].uDamageDice) //"Armor" + sprintfex(out_text + 100, "%s: +%d", pGlobalTXT_LocalizationStrings[11], + pItemsTable->pItems[inspect_item->uItemID].uDamageDice + pItemsTable->pItems[inspect_item->uItemID].uDamageMod); + break; + } - } - } - 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->uEnchantmentType) ) - 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->SetTextureClipRect(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); + if ( !v77 ) + { + if (pItemsTable->pItems[inspect_item->uItemID].uEquipType ==EQUIP_POTION) //this is CORRECT! do not move to switch! + { + if ( inspect_item->uEnchantmentType ) + sprintf(out_text + 200, "%s: %d",pGlobalTXT_LocalizationStrings[449] , inspect_item->uEnchantmentType); //"Power" + } + else if (pItemsTable->pItems[inspect_item->uItemID].uEquipType == EQUIP_REAGENT) + sprintf(out_text + 200, "%s: %d", pGlobalTXT_LocalizationStrings[449], pItemsTable->pItems[inspect_item->uItemID].uDamageDice); //"Power" + else if ( inspect_item->uEnchantmentType ) + sprintf(out_text + 200, "%s: %s +%d", pGlobalTXT_LocalizationStrings[210], pItemsTable->pEnchantments[inspect_item->uEnchantmentType-1].pBonusStat, inspect_item->m_enchantmentStrength); //"Special" + else if ( inspect_item->uSpecEnchantmentType ) + sprintf(out_text + 200, "%s: %s", pGlobalTXT_LocalizationStrings[210], pItemsTable->pSpecialEnchantments[inspect_item->uSpecEnchantmentType-1].pBonusStatement, inspect_item->m_enchantmentStrength); + else if ( inspect_item->uNumCharges ) + sprintf(out_text + 200, "%s: %lu", pGlobalTXT_LocalizationStrings[464], inspect_item->uNumCharges); //"Charges" + } + iteminfo_window.uFrameWidth -= 12; + iteminfo_window.uFrameZ = iteminfo_window.uFrameX + iteminfo_window.uFrameWidth - 1; + iteminfo_window.uFrameW = iteminfo_window.uFrameY + iteminfo_window.uFrameHeight - 1; + Str = (char *)(3 * (LOBYTE(pFontArrus->uFontHeight) + 8)); + v84 = &out_text[0]; + for ( uint i = 1; i <= 3; i++ ) + { + if ( *v84 ) + Str += pFontComic->CalcTextHeight(v84, &iteminfo_window, 100, 0) + 3; + v84 += 100; + } + v28 = pItemsTable->pItems[inspect_item->uItemID].pDescription; + if ( *v28 ) + Str += pFontSmallnum->CalcTextHeight(pItemsTable->pItems[inspect_item->uItemID].pDescription, &iteminfo_window, 100, 0); + iteminfo_window.uFrameHeight = pIcons_LOD->LoadTexturePtr(pItemsTable->pItems[inspect_item->uItemID].pIconName, + TEXTURE_16BIT_PALETTE)->uTextureHeight + v81 + 54; + if ( (signed int)Str > (signed int)iteminfo_window.uFrameHeight ) + iteminfo_window.uFrameHeight = (unsigned int)Str; + if ( inspect_item->uAttributes & 8 && (inspect_item->uSpecEnchantmentType || inspect_item->uEnchantmentType) ) + iteminfo_window.uFrameHeight += LOBYTE(pFontComic->uFontHeight); + v85 = 0; + if ( pFontArrus->uFontHeight ) + { + iteminfo_window.uFrameWidth -= 24; + if ( pFontArrus->CalcTextHeight(inspect_item->GetIdentifiedName(), &iteminfo_window, 0, 0) / (signed int)pFontArrus->uFontHeight ) + v85 = pFontArrus->uFontHeight; + iteminfo_window.uFrameWidth += 24; + } + iteminfo_window.uFrameWidth += 12; + iteminfo_window.uFrameHeight += (unsigned int)v85; + iteminfo_window.uFrameW = iteminfo_window.uFrameY + iteminfo_window.uFrameHeight - 1; + iteminfo_window.uFrameZ = iteminfo_window.uFrameX + iteminfo_window.uFrameWidth - 1; + iteminfo_window.DrawMessageBox(0); + pRenderer->SetTextureClipRect(iteminfo_window.uFrameX + 12, iteminfo_window.uFrameY + 12, + iteminfo_window.uFrameX + iteminfo_window.uFrameWidth - 12, iteminfo_window.uFrameY + iteminfo_window.uFrameHeight - 12); + iteminfo_window.uFrameWidth -= 12; + //v32 = pIcons_LOD->LoadTexturePtr(pItemsTable->pItems[inspect_item->uItemID].pIconName, TEXTURE_16BIT_PALETTE)->uTextureHeight; + iteminfo_window.uFrameHeight -= 12; + iteminfo_window.uFrameZ = iteminfo_window.uFrameX + iteminfo_window.uFrameWidth - 1; + iteminfo_window.uFrameW = iteminfo_window.uFrameY + iteminfo_window.uFrameHeight - 1; + pRenderer->DrawTextureTransparent(iteminfo_window.uFrameX + v78, + iteminfo_window.uFrameY + (signed int)(iteminfo_window.uFrameHeight - pIcons_LOD->LoadTexturePtr(pItemsTable->pItems[inspect_item->uItemID].pIconName, TEXTURE_16BIT_PALETTE)->uTextureHeight) / 2, + pIcons_LOD->LoadTexturePtr(pItemsTable->pItems[inspect_item->uItemID].pIconName, TEXTURE_16BIT_PALETTE)); - 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.data(), "%s: %lu", pGlobalTXT_LocalizationStrings[465], v77);//"Value" - v40 = pFontComic; - v61 = 0; - v56 = 0; - v51 = 0; - v47 = pTmpBuf.data(); - v44 = 0; - v42 = wHintWindow.uFrameHeight - LOBYTE(pFontComic->uFontHeight); - v41 = 100; - } - else - { - if ( (inspect_item->uAttributes & 8) && (inspect_item->uSpecEnchantmentType || inspect_item->uEnchantmentType) ) - { - init_summoned_item(&v67, inspect_item->uExpireTime - pParty->uTimePlayed); - strcpy(pTmpBuf.data(), "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.data(), v65); - } - if ( (((v67.field_14_exprie_month || Str) && - ((sprintf(v65, " %d:mo", v67.field_14_exprie_month), strcat(pTmpBuf.data(), v65), v67.field_14_exprie_month) || Str) - || v67.field_C_expire_day) - && ((sprintf(v65, " %d:dy", v67.field_C_expire_day), strcat(pTmpBuf.data(), 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.data(), 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.data(), v65); - } - wHintWindow.DrawText(pFontComic, 100, wHintWindow.uFrameHeight - 2 * LOBYTE(pFontComic->uFontHeight), 0, pTmpBuf.data(), 0, 0, 0); - } - v37 = inspect_item->GetValue(); - sprintf(pTmpBuf.data(), "%s: %lu", pGlobalTXT_LocalizationStrings[465], v37); - wHintWindow.DrawText(pFontComic, 100, wHintWindow.uFrameHeight - LOBYTE(pFontComic->uFontHeight), 0, pTmpBuf.data(), 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) ) - { - pRenderer->ResetTextureClipRect(); - if ( !areWeLoadingTexture ) - { - v73->Release(); - pIcons_LOD->SyncLoadedFilesCount(); - } - return; - } - 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.data()); - v40 = pFontComic; - v41 = v39 + 132; - } - wHintWindow.DrawText(v40, v41, v42, v44, v47, v51, v56, v61); - pRenderer->ResetTextureClipRect(); - if ( !areWeLoadingTexture ) - { - v73->Release(); - pIcons_LOD->SyncLoadedFilesCount(); - } - return; + v34 = (int)(v85 + 35); + Str = out_text; + for ( uint i = 1; i <= 3; i++ ) + { + if ( *Str ) + { + iteminfo_window.DrawText(pFontComic, 100, v34, 0, Str, 0, 0, 0); + v34 += pFontComic->CalcTextHeight(Str, &iteminfo_window, 100, 0) + 3; } + Str += 100; + } + v28 = pItemsTable->pItems[inspect_item->uItemID].pDescription; + if ( *v28 ) + iteminfo_window.DrawText(pFontSmallnum, 100, v34, 0, v28, 0, 0, 0); + iteminfo_window.uFrameX += 12; + iteminfo_window.uFrameWidth -= 24; + iteminfo_window.DrawTitleText(pFontArrus, 0, 0xCu, TargetColor(0xFFu, 0xFFu, 0x9Bu), inspect_item->GetIdentifiedName(), 3); + iteminfo_window.uFrameWidth += 24; + iteminfo_window.uFrameX -= 12; + if ( v77 ) + { + sprintf(pTmpBuf.data(), "%s: %lu", pGlobalTXT_LocalizationStrings[465], v77);//"Value" + iteminfo_window.DrawText(pFontComic, 100, iteminfo_window.uFrameHeight - LOBYTE(pFontComic->uFontHeight), 0, pTmpBuf.data(), 0, 0, 0); + pRenderer->ResetTextureClipRect(); + } + else + { + if ( (inspect_item->uAttributes & 8) && (inspect_item->uSpecEnchantmentType || inspect_item->uEnchantmentType) ) + { + init_summoned_item(&v67, inspect_item->uExpireTime - pParty->uTimePlayed); + strcpy(pTmpBuf.data(), "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.data(), v65); + } + if ( (((v67.field_14_exprie_month || Str) && + ((sprintf(v65, " %d:mo", v67.field_14_exprie_month), strcat(pTmpBuf.data(), v65), v67.field_14_exprie_month) || Str) + || v67.field_C_expire_day) + && ((sprintf(v65, " %d:dy", v67.field_C_expire_day), strcat(pTmpBuf.data(), 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.data(), 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.data(), v65); + } + iteminfo_window.DrawText(pFontComic, 100, iteminfo_window.uFrameHeight - 2 * LOBYTE(pFontComic->uFontHeight), 0, pTmpBuf.data(), 0, 0, 0); + } + sprintf(pTmpBuf.data(), "%s: %lu", pGlobalTXT_LocalizationStrings[465], inspect_item->GetValue()); + iteminfo_window.DrawText(pFontComic, 100, iteminfo_window.uFrameHeight - LOBYTE(pFontComic->uFontHeight), 0, pTmpBuf.data(), 0, 0, 0); + if ( BYTE1(inspect_item->uAttributes) & 1 ) + pText = pGlobalTXT_LocalizationStrings[187]; //"Stolen" + else + { + if ( !(BYTE1(inspect_item->uAttributes) & 2) ) + { + pRenderer->ResetTextureClipRect(); + if ( !areWeLoadingTexture ) + { + pIcons_LOD->LoadTexturePtr(pItemsTable->pItems[inspect_item->uItemID].pIconName, TEXTURE_16BIT_PALETTE)->Release(); + pIcons_LOD->SyncLoadedFilesCount(); + } + return; + } + pText = pGlobalTXT_LocalizationStrings[651]; //"Hardened" + } + LOWORD(inspect_item->uAttributes) = LOWORD(pRenderer->uTargetRMask); + iteminfo_window.DrawText(pFontComic, pFontComic->GetLineWidth(pTmpBuf.data()) + 132, + iteminfo_window.uFrameHeight - LOBYTE(pFontComic->uFontHeight), inspect_item->uAttributes, pText, 0, 0, 0); + pRenderer->ResetTextureClipRect(); + } + if ( !areWeLoadingTexture ) + { + pIcons_LOD->LoadTexturePtr(pItemsTable->pItems[inspect_item->uItemID].pIconName, TEXTURE_16BIT_PALETTE)->Release(); + pIcons_LOD->SyncLoadedFilesCount(); + } + return; +} // 4E455C: using guessed type int dword_4E455C; // 506128: using guessed type int areWeLoadingTexture; - - //----- (0041E360) -------------------------------------------------------- -void MonsterPopup_Draw(unsigned int uActorID, GUIWindow *edx0) +void MonsterPopup_Draw(unsigned int uActorID, GUIWindow *window) { - unsigned int v2; // esi@1 - Actor *v3; // esi@3 - int v4; // eax@3 - //unsigned int v5; // ecx@3 - NPCData *v6; // eax@3 - unsigned __int16 v7; // cx@3 int v8; // eax@4 unsigned __int16 v9; // dx@4 SpriteFrame *v10; // edi@17 - LODSprite *v11; // esi@17 - unsigned int v12; // ecx@17 - Sprite *v13; // edi@18 - //int v14; // ecx@18 - //int v15; // edx@18 - //int v16; // edx@18 - //int v17; // eax@18 unsigned int v18; // ecx@19 unsigned int v19; // eax@21 char *v20; // esi@28 int v21; // edx@29 unsigned __int16 *v22; // ecx@29 int v23; // eax@29 - int v24; // eax@32 int v25; // esi@32 char *v26; // edx@34 unsigned __int8 v27; // sf@36 unsigned __int8 v28; // of@36 - //int v29; // esi@40 - //unsigned __int16 *v30; // ecx@40 - //int v31; // eax@40 - //int v32; // esi@43 - //unsigned __int16 v33; // ax@45 - //int v34; // edx@45 - //int v35; // eax@45 - int v36; // eax@49 - //char *v37; // eax@52 - int v38; // eax@55 - unsigned __int16 v39; // ax@59 SpellBuff *v40; // eax@60 int v41; // edi@61 unsigned int v42; // eax@61 int v43; // eax@62 int v44; // eax@63 signed int v45; // edi@65 - unsigned __int16 v46; // ax@73 - Player *v47; // ecx@77 - //unsigned int v48; // eax@85 - GUIFont *v49; // edi@90 int v50; // edi@90 SpellBuff *v51; // eax@91 char *v52; // ecx@98 @@ -614,21 +460,16 @@ unsigned __int8 v60; // dl@138 char *v62; // eax@147 int v63; // eax@152 - //char *result; // eax@152 int v65; // eax@155 - const char *v66; // [sp-10h] [bp-1FCh]@121 const char *v67; // [sp-10h] [bp-1FCh]@125 const char *v68; // [sp-10h] [bp-1FCh]@142 - int v69; // [sp-Ch] [bp-1F8h]@121 char *v70; // [sp-Ch] [bp-1F8h]@125 char *v71; // [sp-Ch] [bp-1F8h]@142 char *v72; // [sp-8h] [bp-1F4h]@54 int v73; // [sp-8h] [bp-1F4h]@79 - int v74; // [sp-8h] [bp-1F4h]@121 int v75; // [sp-8h] [bp-1F4h]@125 int v76; // [sp-8h] [bp-1F4h]@142 size_t v77; // [sp-4h] [bp-1F0h]@54 - unsigned int v78; // [sp-4h] [bp-1F0h]@121 unsigned int v79; // [sp-4h] [bp-1F0h]@125 char *v80; // [sp-4h] [bp-1F0h]@142 char *v81; // [sp-4h] [bp-1F0h]@148 @@ -642,25 +483,17 @@ unsigned __int16 *v108; // [sp+1A4h] [bp-48h]@34 unsigned int v109; // [sp+1A8h] [bp-44h]@32 LPVOID v110; // [sp+1ACh] [bp-40h]@28 - unsigned int v111; // [sp+1B0h] [bp-3Ch]@29 int v112; // [sp+1B4h] [bp-38h]@3 int v222; // [sp+1B8h] [bp-34h]@18 unsigned __int8 v114; // [sp+1BFh] [bp-2Dh]@133 int v115; // [sp+1C0h] [bp-2Ch]@3 unsigned int v116; // [sp+1C4h] [bp-28h]@18 int i; // [sp+1C8h] [bp-24h]@18 - int a2; // [sp+1CCh] [bp-20h]@28 int v119; // [sp+1D0h] [bp-1Ch]@18 SpellBuff *v120; // [sp+1D4h] [bp-18h]@18 - Actor *v121; // [sp+1D8h] [bp-14h]@3 - int a5; // [sp+1DCh] [bp-10h]@3 - GUIWindow *a1; // [sp+1E0h] [bp-Ch]@1 int v124; // [sp+1E4h] [bp-8h]@18 int a4; // [sp+1E8h] [bp-4h]@18 - a1 = edx0; - v2 = uActorID; - static Actor pMonsterInfoUI_Doll; /*if ( !(bMonsterInfoUI_bDollInitialized & 1) ) { @@ -669,26 +502,15 @@ atexit(nullsub_3); }*/ v106.uParentBillboardID = -1; - v3 = &pActors[v2]; - v121 = v3; - v4 = TargetColor(0xE1u, 255, 0x9Bu); - //v5 = v3->sNPC_ID; - a5 = v4; - v6 = GetNPCData(v3->sNPC_ID); - v7 = v3->pMonsterInfo.uID; - //v112 = (char **)v6; - v115 = monster_popup_y_offsets[((signed __int16)v7 - 1) / 3] - 40; - if ( v7 == pMonsterInfoUI_Doll.pMonsterInfo.uID ) - { + v115 = monster_popup_y_offsets[((signed __int16)pActors[uActorID].pMonsterInfo.uID - 1) / 3] - 40; + if ( pActors[uActorID].pMonsterInfo.uID == pMonsterInfoUI_Doll.pMonsterInfo.uID ) v9 = pMonsterInfoUI_Doll.uCurrentActionLength; - } else { - memcpy(&pMonsterInfoUI_Doll, v3, sizeof(pMonsterInfoUI_Doll)); + memcpy(&pMonsterInfoUI_Doll, &pActors[uActorID], sizeof(pMonsterInfoUI_Doll)); pMonsterInfoUI_Doll.uCurrentActionAnimation = ANIM_Bored; pMonsterInfoUI_Doll.uCurrentActionTime = 0; v8 = rand(); - v3 = v121; v9 = v8 % 256 + 128; pMonsterInfoUI_Doll.uCurrentActionLength = v8 % 256 + 128; } @@ -708,59 +530,44 @@ if ( (pMonsterInfoUI_Doll.pMonsterInfo.uID < 115 || pMonsterInfoUI_Doll.pMonsterInfo.uID > 186) && (pMonsterInfoUI_Doll.pMonsterInfo.uID < 232 || pMonsterInfoUI_Doll.pMonsterInfo.uID > 249) && rand() % 30 < 100 ) pMonsterInfoUI_Doll.uCurrentActionAnimation = ANIM_AtkMelee; - pMonsterInfoUI_Doll.uCurrentActionLength = 8 * pSpriteFrameTable->pSpriteSFrames[v3->pSpriteIDs[(signed __int16)pMonsterInfoUI_Doll.uCurrentActionAnimation]].uAnimLength; + pMonsterInfoUI_Doll.uCurrentActionLength = 8 * pSpriteFrameTable->pSpriteSFrames[pActors[uActorID].pSpriteIDs[(signed __int16)pMonsterInfoUI_Doll.uCurrentActionAnimation]].uAnimLength; } } - v10 = pSpriteFrameTable->GetFrame( v3->pSpriteIDs[pMonsterInfoUI_Doll.uCurrentActionAnimation], pMonsterInfoUI_Doll.uCurrentActionTime); - v11 = &pSprites_LOD->pSpriteHeaders[v10->pHwSpriteIDs[0]];//40 * v10->pHwSpriteIDs[0] + 7218180; + v10 = pSpriteFrameTable->GetFrame( pActors[uActorID].pSpriteIDs[pMonsterInfoUI_Doll.uCurrentActionAnimation], pMonsterInfoUI_Doll.uCurrentActionTime); v106.pTarget = pRenderer->pTargetSurface; v106.pTargetZ = pRenderer->pActiveZBuffer; v106.uTargetPitch = pRenderer->uTargetSurfacePitch; - v12 = a1->uFrameY + 52; - v106.uViewportX = a1->uFrameX + 13; - v106.uViewportY = v12; - v106.uViewportW = v12 + 128; + v106.uViewportX = window->uFrameX + 13; + v106.uViewportY = window->uFrameY + 52; + v106.uViewportW = (window->uFrameY + 52) + 128; v106.uViewportZ = v106.uViewportX + 128; v106.uScreenSpaceX = (signed int)(v106.uViewportX + 128 + v106.uViewportX) / 2; v106._screenspace_x_scaler_packedfloat = 65536; v106._screenspace_y_scaler_packedfloat = 65536; - v106.uScreenSpaceY = v115 + v12 + v11->uHeight; + v106.uScreenSpaceY = v115 + (window->uFrameY + 52) + pSprites_LOD->pSpriteHeaders[v10->pHwSpriteIDs[0]].uHeight; v106.pPalette = PaletteManager::Get_Dark_or_Red_LUT(v10->uPaletteIndex, 0, 1); v106.sZValue = 0; v106.uFlags = 0; pRenderer->SetRasterClipRect(0, 0, 0x27Fu, 0x1DFu); - pRenderer->RasterLine2D(v106.uViewportX - 1, v106.uViewportY - 1, v106.uViewportX + 129, v106.uViewportY - 1, a5); - pRenderer->RasterLine2D( v106.uViewportX + 129, v106.uViewportY - 1, v106.uViewportX + 129, v106.uViewportW + 1, a5); - pRenderer->RasterLine2D(v106.uViewportX + 129, v106.uViewportW + 1, v106.uViewportX - 1, v106.uViewportW + 1, a5); - pRenderer->RasterLine2D(v106.uViewportX - 1, v106.uViewportW + 1, v106.uViewportX - 1, v106.uViewportY - 1, a5); + pRenderer->RasterLine2D(v106.uViewportX - 1, v106.uViewportY - 1, v106.uViewportX + 129, v106.uViewportY - 1, TargetColor(0xE1u, 255, 0x9Bu)); + pRenderer->RasterLine2D( v106.uViewportX + 129, v106.uViewportY - 1, v106.uViewportX + 129, v106.uViewportW + 1, TargetColor(0xE1u, 255, 0x9Bu)); + pRenderer->RasterLine2D(v106.uViewportX + 129, v106.uViewportW + 1, v106.uViewportX - 1, v106.uViewportW + 1, TargetColor(0xE1u, 255, 0x9Bu)); + pRenderer->RasterLine2D(v106.uViewportX - 1, v106.uViewportW + 1, v106.uViewportX - 1, v106.uViewportY - 1, TargetColor(0xE1u, 255, 0x9Bu)); if ( pRenderer->pRenderD3D ) { - v13 = &pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]]; - v106.uScreenSpaceY = v115 + v106.uViewportY + v13->uBufferHeight; - //v222 = (IDirectDrawSurface *)v13->pTextureSurface; + v106.uScreenSpaceY = v115 + v106.uViewportY + pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uBufferHeight; memset(&Dst, 0, 0x64u); Dst.dwSize = 100; Dst.dwFillColor = 0; memset(&pDesc, 0, 0x7Cu); pDesc.dwSize = 124; - v13->pTextureSurface->GetSurfaceDesc(&pDesc); - //v14 = v13->uBufferHeight; - //v120 = (SpellBuff *)v13->uBufferWidth; + pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].pTextureSurface->GetSurfaceDesc(&pDesc); v107 = 0; - //v15 = v13->uAreaX; - //v119 = v13->uBufferWidth / 2; i = 0; - //a4 = v106.uScreenSpaceX + v15 - v13->uBufferWidth / 2; - int dst_x = v106.uScreenSpaceX + v13->uAreaX - v13->uBufferWidth / 2; - //v115 = v13->uAreaY; - //v16 = v13->uAreaWidth + v13->uBufferWidth / 2 + v13->uAreaX - v13->uBufferWidth; - //v124 = v106.uScreenSpaceY + v115 - v14; - int dst_y = v106.uScreenSpaceY + v13->uAreaY - v13->uBufferHeight; - //v17 = v13->uAreaHeight + v13->uAreaY - v14; - //v116 = v106.uScreenSpaceX + v16; - uint dst_z = v106.uScreenSpaceX + v13->uAreaX + v13->uAreaWidth + v13->uBufferWidth / 2 - v13->uBufferWidth; - //v119 = v106.uScreenSpaceY + v17; - uint dst_w = v106.uScreenSpaceY + v13->uAreaY + v13->uAreaHeight - v13->uBufferHeight; + int dst_x = v106.uScreenSpaceX + pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uAreaX - pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uBufferWidth / 2; + int dst_y = v106.uScreenSpaceY + pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uAreaY - pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uBufferHeight; + uint dst_z = v106.uScreenSpaceX + pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uAreaX + pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uAreaWidth + pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uBufferWidth / 2 - pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uBufferWidth; + uint dst_w = v106.uScreenSpaceY + pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uAreaY + pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uAreaHeight - pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uBufferHeight; if (dst_x < v106.uViewportX) { v18 = v106.uViewportX - dst_x; @@ -789,117 +596,105 @@ __debugbreak(); // no monster popup for r5g5b5 yet memset(&pDesc, 0, 0x7Cu); pDesc.dwSize = 124; - if ( pRenderer->LockSurface_DDraw4(v13->pTextureSurface, &pDesc, DDLOCK_WAIT)) - { - v20 = (char *)dst_y; - v110 = pDesc.lpSurface; - a2 = dst_y; - if (dst_y < dst_w) - { - //v111 = 2 * pRenderer->uTargetSurfacePitch; - v21 = dst_x; - v22 = &pRenderer->pTargetSurface[dst_y * pRenderer->uTargetSurfacePitch + dst_x]; - auto _v22_2 = v22; - v23 = i - dst_y; - //v120 = (SpellBuff *)&pRenderer->pTargetSurface[(int)&a4[v124 * pRenderer->uTargetSurfacePitch]]; - v115 = i - dst_y; - while ( 1 ) - { - dst_y = v21; - if ( v21 < dst_z ) - { - v24 = (int)&v20[v23]; - v25 = v107 - v21; - v109 = v24; - for ( i = v107 - v21; ; v25 = i ) - { - v108 = (unsigned __int16 *)((pDesc.lPitch >> 1) * pDesc.dwHeight * v109 / v13->uAreaHeight); - v26 = (char *)v108 + pDesc.dwWidth * (v25 + dst_y++) / v13->uAreaWidth; - *v22 = *((short *)v110 + (int)v26); - ++v22; - if ( dst_y >= dst_z ) - break; - } - v23 = v115; - } - v22 = (unsigned __int16 *)((char *)_v22_2 + 2 * pRenderer->uTargetSurfacePitch); - _v22_2 = v22; - v20 = (char *)(a2 + 1); - v28 = __OFSUB__(a2 + 1, dst_w); - v27 = (signed int)(a2++ + 1 - dst_w) < 0; - //a2 = (Player *)((char *)a2 + 1); - //v120 = (SpellBuff *)((char *)v120 + v111); - if ( !(v27 ^ v28) ) - break; - v21 = dst_x; - } - } - v13->pTextureSurface->Unlock(0); - } + if ( pRenderer->LockSurface_DDraw4(pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].pTextureSurface, &pDesc, DDLOCK_WAIT)) + { + v20 = (char *)dst_y; + v110 = pDesc.lpSurface; + //a2 = dst_y; + if (dst_y < dst_w) + { + v21 = dst_x; + v22 = &pRenderer->pTargetSurface[dst_y * pRenderer->uTargetSurfacePitch + dst_x]; + auto _v22_2 = v22; + v23 = i - dst_y; + v115 = i - dst_y; + while ( 1 ) + { + dst_y = v21; + if ( v21 < dst_z ) + { + v25 = v107 - v21; + v109 = (int)&v20[v23]; + for ( i = v107 - v21; ; v25 = i ) + { + v108 = (unsigned __int16 *)((pDesc.lPitch >> 1) * pDesc.dwHeight * v109 / pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uAreaHeight); + v26 = (char *)v108 + pDesc.dwWidth * (v25 + dst_y++) / pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uAreaWidth; + *v22 = *((short *)v110 + (int)v26); + ++v22; + if ( dst_y >= dst_z ) + break; + } + v23 = v115; + } + v22 = (unsigned __int16 *)((char *)_v22_2 + 2 * pRenderer->uTargetSurfacePitch); + _v22_2 = v22; + v20 = (char *)(dst_y + 1); + v28 = __OFSUB__(dst_y + 1, dst_w); + v27 = (signed int)(dst_y++ + 1 - dst_w) < 0; + if ( !(v27 ^ v28) ) + break; + v21 = dst_x; + } + } + pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].pTextureSurface->Unlock(0); + } } - else - { - memset(&pDesc, 0, 0x7Cu); - pDesc.dwSize = 124; - if ( pRenderer->LockSurface_DDraw4(v13->pTextureSurface, &pDesc, DDLOCK_WAIT) ) - { - auto src = (unsigned __int16 *)pDesc.lpSurface; - - uint num_top_scanlines_above_frame_y = i - dst_y; - for (uint y = dst_y; y < dst_w; ++y) - { - auto dst = &pRenderer->pTargetSurface[y * pRenderer->uTargetSurfacePitch + dst_x]; + else + { + memset(&pDesc, 0, 0x7Cu); + pDesc.dwSize = 124; + if ( pRenderer->LockSurface_DDraw4(pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].pTextureSurface, &pDesc, DDLOCK_WAIT) ) + { + auto src = (unsigned __int16 *)pDesc.lpSurface; + uint num_top_scanlines_above_frame_y = i - dst_y; + for (uint y = dst_y; y < dst_w; ++y) + { + auto dst = &pRenderer->pTargetSurface[y * pRenderer->uTargetSurfacePitch + dst_x]; - uint src_y = num_top_scanlines_above_frame_y + y; - for (uint x = dst_x; x < dst_z; ++x) - { - uint src_x = v107 - dst_x + x; // num scanlines left to frame_x + current x + uint src_y = num_top_scanlines_above_frame_y + y; + for (uint x = dst_x; x < dst_z; ++x) + { + uint src_x = v107 - dst_x + x; // num scanlines left to frame_x + current x - uint idx = pDesc.dwHeight * src_y / v13->uAreaHeight * (pDesc.lPitch / sizeof(short)) + - pDesc.dwWidth * src_x / v13->uAreaWidth; - uint b = src[idx] & 0x1F; - *dst++ = b | 2 * (src[idx] & 0xFFE0); - } - } - v13->pTextureSurface->Unlock(0); - } - } + uint idx = pDesc.dwHeight * src_y / pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uAreaHeight * (pDesc.lPitch / sizeof(short)) + + pDesc.dwWidth * src_x / pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uAreaWidth; + uint b = src[idx] & 0x1F; + *dst++ = b | 2 * (src[idx] & 0xFFE0); + } + } + pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].pTextureSurface->Unlock(0); + } + } } else { pRenderer->FillRectFast(v106.uViewportX, v106.uViewportY, v106.uViewportZ - v106.uViewportX, v106.uViewportW - v106.uViewportY, 0); - v36 = v10->pHwSpriteIDs[0]; - if ( v36 >= 0 ) - pSprites_LOD->pSpriteHeaders[v36].DrawSprite_sw(&v106, 0); + if ( v10->pHwSpriteIDs[0] >= 0 ) + pSprites_LOD->pSpriteHeaders[v10->pHwSpriteIDs[0]].DrawSprite_sw(&v106, 0); } - if ( v121->sNPC_ID ) + if ( pActors[uActorID].sNPC_ID ) { - //v37 = v6->uProfession; - if (v6->uProfession) + if (GetNPCData(pActors[uActorID].sNPC_ID)->uProfession) + sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[429], GetNPCData(pActors[uActorID].sNPC_ID)->pName, aNPCProfessionNames[GetNPCData(pActors[uActorID].sNPC_ID)->uProfession]); // "%s the %s" / ^Pi[%s] %s + else { - sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[429], v6->pName, aNPCProfessionNames[v6->uProfession]); // "%s the %s" / ^Pi[%s] %s + v77 = 2000; + v72 = GetNPCData(pActors[uActorID].sNPC_ID)->pName; } - else - { - v77 = 2000; - v72 = v6->pName; - } } else { - v38 = v121->dword_000334_unique_name; v77 = 2000; - if ( v38 ) - v72 = pMonsterStats->pPlaceStrings[v38]; + if ( pActors[uActorID].dword_000334_unique_name ) + v72 = pMonsterStats->pPlaceStrings[pActors[uActorID].dword_000334_unique_name]; else - v72 = pMonsterStats->pInfos[v121->pMonsterInfo.uID].pName; + v72 = pMonsterStats->pInfos[pActors[uActorID].pMonsterInfo.uID].pName; } - if(!v121->sNPC_ID || (v121->sNPC_ID && !v6->uProfession)) + if(!pActors[uActorID].sNPC_ID || (pActors[uActorID].sNPC_ID && !GetNPCData(pActors[uActorID].sNPC_ID)->uProfession)) strncpy(pTmpBuf.data(), v72, v77); - v39 = TargetColor(0xFFu, 0xFFu, 0x9Bu); - a1->DrawTitleText(pFontComic, 0, 0xCu, v39, pTmpBuf.data(), 3u); - Actor::DrawHealthBar(v121, a1); + window->DrawTitleText(pFontComic, 0, 0xCu, TargetColor(0xFFu, 0xFFu, 0x9Bu), pTmpBuf.data(), 3); + Actor::DrawHealthBar(&pActors[uActorID], window); v119 = 0; pMonsterInfoUI_Doll.uCurrentActionTime += pMiscTimer->uTimeElapsed; v115 = 0; @@ -907,133 +702,110 @@ i = 0; v112 = 0; if ( !uActiveCharacter ) - { v45 = 1; - } else { - LOBYTE(v40) = pPlayers[uActiveCharacter]->GetActualSkillLevel(PLAYER_SKILL_MONSTER_ID); - v120 = v40; - if ( !v40 ) - v45 = 1; - else - { - v41 = (unsigned __int8)v40 & 0x3F; - v42 = SkillToMastery((unsigned __int16)v40) - 1; - if ( !v42 ) - { - if ( v41 + 10 >= v121->pMonsterInfo.uLevel ) - { - v45 = 1; - v119 = 1; - } - else - v45 = 1; - } - else - { - v43 = v42 - 1; - if ( !v43 ) - { - if ( 2 * v41 + 10 >= v121->pMonsterInfo.uLevel ) - { - v45 = 1; - v119 = 1; - v116 = 1; - } - else - v45 = 1; - } - else - { - v44 = v43 - 1; - if ( !v44 ) - { - if ( 3 * v41 + 10 >= v121->pMonsterInfo.uLevel ) - { - v45 = 1; - v119 = 1; - v116 = 1; - i = 1; - } - else - { - v45 = 1; - } - } - else - { - if ( v44 != 1 ) - v45 = 1; - else - { - v45 = 1; - v119 = 1; - v116 = 1; - i = 1; - v112 = 1; - } - } - } - } - } - // LABEL_73: - v46 = v121->uAIState; - if ( v46 != 5 && v46 != 4 && !dword_507BF0_is_there_popup_onscreen && v120 ) - { - v47 = pPlayers[uActiveCharacter]; - if ( v119 | v116 | i | (unsigned int)v112 ) - { - if ( v121->pMonsterInfo.uLevel >= v47->uLevel - 5 ) - v73 = SPEECH_105; - else - v73 = SPEECH_104; - } - else - { - v73 = SPEECH_106; - } - v47->PlaySound((PlayerSpeech)v73, 0); - } + LOBYTE(v40) = pPlayers[uActiveCharacter]->GetActualSkillLevel(PLAYER_SKILL_MONSTER_ID); + v120 = v40; + if ( !v40 ) + v45 = 1; + else + { + v41 = (unsigned __int8)v40 & 0x3F; + v42 = SkillToMastery((unsigned __int16)v40) - 1; + if ( !v42 ) + { + if ( v41 + 10 >= pActors[uActorID].pMonsterInfo.uLevel ) + { + v45 = 1; + v119 = 1; + } + else + v45 = 1; + } + else + { + v43 = v42 - 1; + if ( !v43 ) + { + if ( 2 * v41 + 10 >= pActors[uActorID].pMonsterInfo.uLevel ) + { + v45 = 1; + v119 = 1; + v116 = 1; + } + else + v45 = 1; + } + else + { + v44 = v43 - 1; + if ( !v44 ) + { + if ( 3 * v41 + 10 >= pActors[uActorID].pMonsterInfo.uLevel ) + { + v45 = 1; + v119 = 1; + v116 = 1; + i = 1; + } + else + v45 = 1; + } + else + { + if ( v44 != 1 ) + v45 = 1; + else + { + v45 = 1; + v119 = 1; + v116 = 1; + i = 1; + v112 = 1; + } + } + } + } + } + if ( pActors[uActorID].uAIState != Dead + && pActors[uActorID].uAIState != Dying + && !dword_507BF0_is_there_popup_onscreen && v120 ) + { + if ( v119 | v116 | i | (unsigned int)v112 ) + { + if ( pActors[uActorID].pMonsterInfo.uLevel >= pPlayers[uActiveCharacter]->uLevel - 5 ) + v73 = SPEECH_105; + else + v73 = SPEECH_104; + } + else + v73 = SPEECH_106; + pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)v73, 0); + } } - for (uint _it = 0; _it < 4; ++_it) + for (uint i = 0; i < 4; ++i) { - auto player = pParty->pPlayers + _it; - - //LOBYTE(v48) = player->GetActualSkillLevel(PLAYER_SKILL_MONSTER_ID); - //v111 = v48; - v111 = player->GetActualSkillLevel(PLAYER_SKILL_MONSTER_ID); v120 = (SpellBuff *)138; do { - if ( (signed int)SkillToMastery(v111) >= 3 ) + if ( (signed int)SkillToMastery(pParty->pPlayers[i].GetActualSkillLevel(PLAYER_SKILL_MONSTER_ID)) >= 3 ) v115 = v45; v120 = (SpellBuff *)((char *)v120 - 1); } while ( v120 ); - //++a2; } - //while ( (signed int)a2 < (signed int)pParty->pHirelings ); - v49 = pFontSmallnum; - a2 = (int)pFontSmallnum; - a1->DrawText(pFontSmallnum, 12, 196, a5, pGlobalTXT_LocalizationStrings[631], 0, 0, 0); - v50 = LOBYTE(v49->uFontHeight) + 193; + window->DrawText(pFontSmallnum, 12, 196, TargetColor(0xE1u, 255, 0x9Bu), pGlobalTXT_LocalizationStrings[631], 0, 0, 0); if ( !v115 ) - { - v78 = 0; - v74 = 0; - v69 = 0; - v66 = pGlobalTXT_LocalizationStrings[630]; - a1->DrawText((GUIFont *)a2, 28, v50, a5, v66, v69, v74, v78); - } + window->DrawText(pFontSmallnum, 28, LOBYTE(pFontSmallnum->uFontHeight) + 193, TargetColor(0xE1u, 255, 0x9Bu), pGlobalTXT_LocalizationStrings[630], 0, 0, 0); else { a4 = 0; - v51 = &v121->pActorBuffs[1]; + v51 = &pActors[uActorID].pActorBuffs[1]; v222 = 0; - v120 = &v121->pActorBuffs[1]; + v120 = &pActors[uActorID].pActorBuffs[1]; do { if ( (signed __int64)v51->uExpireTime > 0 ) @@ -1137,8 +909,8 @@ { v54 = (char *)a4; v55 = GetSpellColor(v124); - a1->DrawText((GUIFont *)a2, 28, v50, v55, v54, 0, 0, 0); - v50 = v50 + *(char *)(a2 + 5) - 3; + window->DrawText(pFontSmallnum, 28, LOBYTE(pFontSmallnum->uFontHeight) + 193, v55, v54, 0, 0, 0); + v50 = (LOBYTE(pFontSmallnum->uFontHeight) + 193) + *(char *)((int)pFontSmallnum + 5) - 3; v51 = v120; } } @@ -1153,22 +925,16 @@ while (true); if ( !a4 ) - { - v78 = 0; - v74 = 0; - v69 = 0; - v66 = pGlobalTXT_LocalizationStrings[153]; - a1->DrawText((GUIFont *)a2, 28, v50, a5, v66, v69, v74, v78); - } + window->DrawText(pFontSmallnum, 28, v50, TargetColor(0xE1u, 255, 0x9Bu), pGlobalTXT_LocalizationStrings[153], 0, 0, 0); } v56 = pFontSmallnum; a4 = v106.uViewportY; if ( v119 ) { - sprintf(pTmpBuf.data(), "%s\f%05u\t100%d\n", pGlobalTXT_LocalizationStrings[108], 0, v121->pMonsterInfo.uHP); - a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf.data(), 0, 0, 0); + sprintf(pTmpBuf.data(), "%s\f%05u\t100%d\n", pGlobalTXT_LocalizationStrings[108], 0, pActors[uActorID].pMonsterInfo.uHP); + window->DrawText(v56, 150, (int)a4, TargetColor(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0); a4 = a4 + LOBYTE(v56->uFontHeight) - 3; - v79 = v121->pMonsterInfo.uAC; + v79 = pActors[uActorID].pMonsterInfo.uAC; v75 = 0; v70 = pGlobalTXT_LocalizationStrings[12]; v67 = "%s\f%05u\t100%d\n"; @@ -1176,7 +942,7 @@ else { sprintf(pTmpBuf.data(), "%s\f%05u\t100%s\n", pGlobalTXT_LocalizationStrings[108], 0, pGlobalTXT_LocalizationStrings[630]); - a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf.data(), 0, 0, 0); + window->DrawText(v56, 150, (int)a4, TargetColor(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0); v79 = (unsigned int)pGlobalTXT_LocalizationStrings[630]; v75 = 0; v70 = pGlobalTXT_LocalizationStrings[12]; @@ -1184,7 +950,7 @@ v67 = "%s\f%05u\t100%s\n"; } sprintf(pTmpBuf.data(), v67, v70, v75, v79); - a1->DrawText(v56, 150, a4, a5, pTmpBuf.data(), 0, 0, 0); + window->DrawText(v56, 150, a4, TargetColor(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0); a4 = a4 + LOBYTE(v56->uFontHeight) - 6 + LOBYTE(v56->uFontHeight); v95[0] = pGlobalTXT_LocalizationStrings[87]; v95[1] = pGlobalTXT_LocalizationStrings[6]; @@ -1199,25 +965,25 @@ v95[10] = pGlobalTXT_LocalizationStrings[54]; if ( v116 ) { - sprintf(pTmpBuf.data(), "%s\f%05u\t080%s\n", pGlobalTXT_LocalizationStrings[18], 0, v95[v121->pMonsterInfo.uAttack1Type]); - a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf.data(), 0, 0, 0); + sprintf(pTmpBuf.data(), "%s\f%05u\t080%s\n", pGlobalTXT_LocalizationStrings[18], 0, v95[pActors[uActorID].pMonsterInfo.uAttack1Type]); + window->DrawText(v56, 150, (int)a4, TargetColor(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0); a4 = a4 + LOBYTE(v56->uFontHeight) - 3; - v57 = v121->pMonsterInfo.uAttack1DamageBonus; + v57 = pActors[uActorID].pMonsterInfo.uAttack1DamageBonus; if ( v57 ) sprintf(pTmpBuf.data(), "%s\f%05u\t080%dd%d+%d\n", pGlobalTXT_LocalizationStrings[53], - 0, v121->pMonsterInfo.uAttack1DamageDiceRolls, v121->pMonsterInfo.uAttack1DamageDiceSides, v57); + 0, pActors[uActorID].pMonsterInfo.uAttack1DamageDiceRolls, pActors[uActorID].pMonsterInfo.uAttack1DamageDiceSides, v57); else sprintf(pTmpBuf.data(), "%s\f%05u\t080%dd%d\n", pGlobalTXT_LocalizationStrings[53], - 0, v121->pMonsterInfo.uAttack1DamageDiceRolls, v121->pMonsterInfo.uAttack1DamageDiceSides); + 0, pActors[uActorID].pMonsterInfo.uAttack1DamageDiceRolls, pActors[uActorID].pMonsterInfo.uAttack1DamageDiceSides); } else { sprintf(pTmpBuf.data(), "%s\f%05u\t080%s\n", pGlobalTXT_LocalizationStrings[18], 0, pGlobalTXT_LocalizationStrings[630]); - a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf.data(), 0, 0, 0); + window->DrawText(v56, 150, (int)a4, TargetColor(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0); a4 = a4 + LOBYTE(v56->uFontHeight) - 3; sprintf(pTmpBuf.data(), "%s\f%05u\t080%s\n", pGlobalTXT_LocalizationStrings[53], 0, pGlobalTXT_LocalizationStrings[630]); } - a1->DrawText(v56, 150, a4, a5, pTmpBuf.data(), 0, 0, 0); + window->DrawText(v56, 150, a4, TargetColor(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0); v58 = LOBYTE(v56->uFontHeight); a4 = a4 + v58 - 6 + v58; if ( !i ) @@ -1227,33 +993,33 @@ v71 = pGlobalTXT_LocalizationStrings[628]; v68 = "%s\f%05u\t080%s\n"; sprintf(pTmpBuf.data(), v68, v71, v76, v80); - a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf.data(), 0, 0, 0); + window->DrawText(v56, 150, (int)a4, TargetColor(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0); v58 = LOBYTE(v56->uFontHeight); a4 = a4 + v58 - 3; } else { v120 = (SpellBuff *)pGlobalTXT_LocalizationStrings[628]; - v59 = v121; - v114 = v121->pMonsterInfo.uSpell1ID; - if ( v114 && v121->pMonsterInfo.uSpell2ID ) + v59 = &pActors[uActorID]; + v114 = pActors[uActorID].pMonsterInfo.uSpell1ID; + if ( v114 && pActors[uActorID].pMonsterInfo.uSpell2ID ) v120 = (SpellBuff *)pGlobalTXT_LocalizationStrings[629]; if ( v114 ) { sprintf(pTmpBuf.data(), "%s\f%05u\t060%s\n", v120, 0, pSpellStats->pInfos[v114].pShortName); - a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf.data(), 0, 0, 0); + window->DrawText(v56, 150, (int)a4, TargetColor(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0); v58 = LOBYTE(v56->uFontHeight); a4 = a4 + v58 - 3; - v59 = v121; + v59 = &pActors[uActorID]; } v60 = v59->pMonsterInfo.uSpell2ID; if ( v60 ) { sprintf(pTmpBuf.data(), "\f%05u\t060%s\n", 0, pSpellStats->pInfos[v60].pShortName); - a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf.data(), 0, 0, 0); + window->DrawText(v56, 150, (int)a4, TargetColor(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0); v58 = LOBYTE(v56->uFontHeight); a4 = a4 + v58 - 3; - v59 = v121; + v59 = &pActors[uActorID]; } if ( !v59->pMonsterInfo.uSpell1ID && !v59->pMonsterInfo.uSpell2ID ) { @@ -1262,13 +1028,13 @@ v71 = pGlobalTXT_LocalizationStrings[628]; v68 = "%s\f%05u\t060%s\n"; sprintf(pTmpBuf.data(), v68, v71, v76, v80); - a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf.data(), 0, 0, 0); + window->DrawText(v56, 150, (int)a4, TargetColor(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0); v58 = LOBYTE(v56->uFontHeight); a4 = a4 + v58 - 3; } } a4 = a4 + v58 - 3; - a1->DrawText(v56, 150, a4, a5, pGlobalTXT_LocalizationStrings[626], 0, 0, 0); + window->DrawText(v56, 150, a4, TargetColor(0xE1u, 255, 0x9Bu), pGlobalTXT_LocalizationStrings[626], 0, 0, 0); a4 = a4 + LOBYTE(v56->uFontHeight) - 3; v85[0] = pGlobalTXT_LocalizationStrings[87]; v85[1] = pGlobalTXT_LocalizationStrings[6]; @@ -1280,16 +1046,16 @@ v85[7] = pGlobalTXT_LocalizationStrings[133]; v85[8] = pGlobalTXT_LocalizationStrings[54]; v85[9] = pGlobalTXT_LocalizationStrings[624]; - v95[1] = (char *)v121->pMonsterInfo.uResFire; - v95[2] = (char *)v121->pMonsterInfo.uResAir; - v95[3] = (char *)v121->pMonsterInfo.uResWater; - v95[4] = (char *)v121->pMonsterInfo.uResEarth; - v95[5] = (char *)v121->pMonsterInfo.uResMind; - v95[6] = (char *)v121->pMonsterInfo.uResSpirit; - v95[7] = (char *)v121->pMonsterInfo.uResBody; - v95[8] = (char *)v121->pMonsterInfo.uResLight; - v95[9] = (char *)v121->pMonsterInfo.uResPhysical; - v95[10] = (char *)v121->pMonsterInfo.uResDark; + v95[1] = (char *)pActors[uActorID].pMonsterInfo.uResFire; + v95[2] = (char *)pActors[uActorID].pMonsterInfo.uResAir; + v95[3] = (char *)pActors[uActorID].pMonsterInfo.uResWater; + v95[4] = (char *)pActors[uActorID].pMonsterInfo.uResEarth; + v95[5] = (char *)pActors[uActorID].pMonsterInfo.uResMind; + v95[6] = (char *)pActors[uActorID].pMonsterInfo.uResSpirit; + v95[7] = (char *)pActors[uActorID].pMonsterInfo.uResBody; + v95[8] = (char *)pActors[uActorID].pMonsterInfo.uResLight; + v95[9] = (char *)pActors[uActorID].pMonsterInfo.uResPhysical; + v95[10] = (char *)pActors[uActorID].pMonsterInfo.uResDark; if ( v112 ) { v124 = 0; @@ -1308,7 +1074,7 @@ v81 = pGlobalTXT_LocalizationStrings[153]; } sprintf(pTmpBuf.data(), "%s\f%05u\t070%s\n", v85[v124], 0, v81); - a1->DrawText(v56, 170, a4, a5, pTmpBuf.data(), 0, 0, 0); + window->DrawText(v56, 170, a4, TargetColor(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0); v63 = LOBYTE(v56->uFontHeight); v124 += 4; a4 = a4 + v63 - 3; @@ -1321,7 +1087,7 @@ do { sprintf(pTmpBuf.data(), "%s\f%05u\t070%s\n", v85[i], 0, pGlobalTXT_LocalizationStrings[630]); // "?" - a1->DrawText(v56, 170, a4, a5, pTmpBuf.data(), 0, 0, 0); + window->DrawText(v56, 170, a4, TargetColor(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0); v65 = LOBYTE(v56->uFontHeight); ++i; a4 = a4 + v65 - 3; @@ -1330,9 +1096,9 @@ } if ( (signed __int64)pParty->pPartyBuffs[PARTY_BUFF_DETECT_LIFE].uExpireTime > 0 ) { - sprintf(pTmpBuf.data(), "%s: %d", pGlobalTXT_LocalizationStrings[650], v121->sCurrentHP); + sprintf(pTmpBuf.data(), "%s: %d", pGlobalTXT_LocalizationStrings[650], pActors[uActorID].sCurrentHP); pFontSmallnum->GetLineWidth(pTmpBuf.data()); - a1->DrawTitleText(pFontSmallnum, 0, a1->uFrameHeight - LOBYTE(pFontSmallnum->uFontHeight) - 12, 0, pTmpBuf.data(), 3); + window->DrawTitleText(pFontSmallnum, 0, window->uFrameHeight - LOBYTE(pFontSmallnum->uFontHeight) - 12, 0, pTmpBuf.data(), 3); } }
--- a/UI/UiGame.cpp Sun Sep 22 18:09:44 2013 +0200 +++ b/UI/UiGame.cpp Sun Sep 22 18:10:35 2013 +0200 @@ -1230,7 +1230,7 @@ if ( !pLevelDecorations[v19].uEventID ) { if ( pLevelDecorations[v19].IsInteractive() ) - pText = pNPCTopics[stru_5E4C90._decor_events[pLevelDecorations[v19]._idx_in_stru123 - 75] + 379].pTopic; + pText = pNPCTopics[stru_5E4C90._decor_events[pLevelDecorations[v19]._idx_in_stru123 - 75] + 379].pTopic;//неверно для костра else pText = pDecorationList->pDecorations[pLevelDecorations[v19].uDecorationDescID].field_20; GameUI_SetFooterString(pText);
--- a/mm7_data.h Sun Sep 22 18:09:44 2013 +0200 +++ b/mm7_data.h Sun Sep 22 18:10:35 2013 +0200 @@ -1120,7 +1120,7 @@ void __fastcall sub_41D20D_buff_remaining_time_string(int ecx0, struct GUIWindow *edx0, __int64 a3, struct GUIFont *a2); bool UI_OnKeyDown(unsigned int vkKey); void GameUI_DrawItemInfo(struct ItemGen* inspect_item); // idb -void MonsterPopup_Draw(unsigned int uActorID, struct GUIWindow *edx0); +void MonsterPopup_Draw(unsigned int uActorID, struct GUIWindow *window); void LoadActualSkyFrame(); void Sleep6Hours(); void ChestUI_WritePointedObjectStatusString();