Mercurial > mm7
diff UI/UICharacter.cpp @ 1483:223605b325b3
Слияние
author | Ritor1 |
---|---|
date | Thu, 29 Aug 2013 12:04:55 +0600 |
parents | cfd99b6177a3 92b63e3dca90 |
children | 62c7f07bc05a |
line wrap: on
line diff
--- a/UI/UICharacter.cpp Thu Aug 29 12:04:33 2013 +0600 +++ b/UI/UICharacter.cpp Thu Aug 29 12:04:55 2013 +0600 @@ -43,6 +43,10 @@ unsigned int ui_character_skillinfo_can_learn; unsigned int ui_character_skillinfo_can_learn_gm; unsigned int ui_character_skillinfo_cant_learn; +unsigned int ui_character_condition_normal_color; +unsigned int ui_character_condition_light_color; +unsigned int ui_character_condition_moderate_color; +unsigned int ui_character_condition_severe_color; std::array<unsigned int, 6> ui_character_award_color; unsigned int ui_game_minimap_outline_color; @@ -107,6 +111,11 @@ ui_character_skillinfo_can_learn = TargetColor(255, 255, 255); ui_character_skillinfo_can_learn_gm = TargetColor(255, 255, 0); ui_character_skillinfo_cant_learn = TargetColor(255, 0, 0); + + ui_character_condition_normal_color = TargetColor(255, 255, 255); + ui_character_condition_light_color = TargetColor(0, 255, 0); + ui_character_condition_moderate_color = TargetColor(225, 205, 35); + ui_character_condition_severe_color = TargetColor(255, 35, 0); ui_character_award_color[0] = TargetColor(248, 108, 160); ui_character_award_color[1] = TargetColor(112, 220, 248); @@ -185,7 +194,7 @@ unsigned int papredoll_dlhus[4]; unsigned int papredoll_dlhs[4]; unsigned int papredoll_dbods[5]; -int paperdoll_armor_texture[4][17][3]; +int paperdoll_armor_texture[4][17][3];//0x511294 //int paperdoll_array_51132C[165]; unsigned int papredoll_dlaus[5]; unsigned int papredoll_dlads[4]; @@ -274,7 +283,7 @@ int pPaperdoll_BodyX = 481; // 004E4C28 int pPaperdoll_BodyY = 0; // 004E4C2C -const int paperdoll_Armor[4][17][2] = //4E4E30 +const int paperdoll_Armor_Coord[4][17][2] = //4E4E30 { // X Y 0x2C, 0x67, 0x30, 0x69, 0x2D, 0x67, 0x2C, 0x64, 0x14, 0x66, 0x22, 0x67, 0x20, 0x66, 0x25, 0x66, 0x12, 0x66,//Human @@ -289,7 +298,7 @@ 0x33, 0x90, 0x32, 0x90, 0x34, 0x91, 0x32, 0x8E, 0x21, 0x8B, 0x31, 0x8B, 0x33, 0x8E, 0x2F, 0x8F, 0x16, 0x8D, 0x18, 0x8C, 0x19, 0x8C, 0x1B, 0x8E, 0x0C, 0x8C, 0x21, 0x8B, 0x0C, 0x8C, 0x18, 0x8C, 0x2F, 0x8F, }; -const int paperdoll_shoulder[4][17][2] = //4E5050 +const int paperdoll_shoulder_coord[4][17][2] = //4E5050 { 0x64, 0x67, 0x61, 0x67, 0x65, 0x68, 0x6E, 0x74, 0x6C, 0x68, 0x61, 0x67, 0x66, 0x68, 0x6C, 0x6A, 0x6E, 0x6D, 0x67, 0x69, 0x70, 0x67, 0x6E, 0x6D, 0x6C, 0x6F, 0x6C, 0x68, 0x6C, 0x6F, 0x67, 0x69, 0x6C, 0x6A, @@ -303,12 +312,19 @@ 0x72, 0x91, 0x72, 0x91, 0, 0, 0x6E, 0x92, 0x6F, 0x91, 0, 0, 0, 0, 0x6E, 0x91, 0x71, 0x90, 0x72, 0x8D, 0x72, 0x90, 0x73, 0x93, 0x73, 0x90, 0x6F, 0x91, 0x73, 0x90, 0x72, 0x8D, 0x6E, 0x91, }; -const int dword_4E5270[4][2] = +const int paperdoll_shoulder_second_coord[4][17][2] = //dword_4E5270 { - 0, 0, - 0x61, 0x67, - 0, 0, - 0x64, 0x69, + 0, 0, 0x61, 0x67, 0, 0, 0x64, 0x69, 0x64, 0x68, 0, 0, 0, 0, 0x5E, 0x66, 0x5F, 0x69, + 0x55, 0x69, 0x5F, 0x67, 0x5F, 0x68, 0x32, 0x69, 0x64, 0x68, 0x32, 0x69, 0x55, 0x69, 0x5E, 0x66, + + 0, 0, 0x60, 0x6C, 0, 0, 0x60, 0x6C, 0x5E, 0x69, 0, 0, 0, 0, 0x5D, 0x6A, 0x5B, 0x6A, + 0x5B, 0x6A, 0x59, 0x69, 0x56, 0x68, 0x38, 0x6E, 0x5E, 0x69, 0x38, 0x6E, 0x5B, 0x6A, 0x5D, 0x6A, + + 0, 0, 0x75, 0x8C, 0, 0, 0x72, 0x8D, 0x62, 0x89, 0, 0, 0, 0, 0x69, 0x8C, 0x5E, 0x8D, + 0x61, 0x8D, 0x5F, 0x8D, 0x60, 0x8D, 0x2E, 0x8C, 0x62, 0x89, 0x2E, 0x8C, 0x61, 0x8D, 0x69, 0x8C, + + 0, 0, 0x72, 0x91, 0, 0, 0x72, 0x91, 0x67, 0x8F, 0, 0, 0, 0, 0x6E, 0x91, 0x64, 0x93, + 0x65, 0x8C, 0x65, 0x91, 0x67, 0x91, 0x36, 0x90, 0x67, 0x8F, 0x36, 0x90, 0x65, 0x8C, 0x6E, 0x91, }; const char *dlad_texnames_by_face[25] = @@ -563,7 +579,7 @@ //----- (0041A000) -------------------------------------------------------- void CharacterUI_AwardsTab_Draw(Player *player) { - unsigned int result; // eax@1 + int items_per_page; // eax@1 char *v6; // ebx@15 char Source[100]; // [sp+Ch] [bp-C4h]@1 GUIWindow awards_window; // [sp+70h] [bp-60h]@1 @@ -575,7 +591,7 @@ strcat(pTmpBuf.data(), "\f00000"); pGUIWindow_CurrentMenu->DrawText(pFontArrus, 24, 18, 0, pTmpBuf.data(), 0, 0, 0); - result = books_primary_item_per_page; + items_per_page = books_primary_item_per_page; awards_window.uFrameX = 12; awards_window.uFrameY = 48; awards_window.uFrameWidth = 424; @@ -583,31 +599,31 @@ awards_window.uFrameZ = 435; awards_window.uFrameW = 337; if (BtnDown_flag && num_achieved_awards + books_primary_item_per_page < full_num_items_in_book) - result = books_primary_item_per_page++ + 1; - if (BtnUp_flag && result) + items_per_page = books_primary_item_per_page++ + 1; + if (BtnUp_flag && items_per_page) { - --result; - books_primary_item_per_page = result; + --items_per_page; + books_primary_item_per_page = items_per_page; } if ( books_page_number < 0 ) { - result += num_achieved_awards; - books_primary_item_per_page = result; - if ( (signed int)(num_achieved_awards + result) > full_num_items_in_book ) + items_per_page += num_achieved_awards; + books_primary_item_per_page = items_per_page; + if ( (signed int)(num_achieved_awards + items_per_page) > full_num_items_in_book ) { - result = full_num_items_in_book - num_achieved_awards; - books_primary_item_per_page = result; + items_per_page = full_num_items_in_book - num_achieved_awards; + books_primary_item_per_page = items_per_page; } } else if ( books_page_number > 0 ) { - result -= num_achieved_awards; - books_primary_item_per_page = result; - if ( (result & 0x80000000u) != 0 ) + items_per_page -= num_achieved_awards; + books_primary_item_per_page = items_per_page; + if ( items_per_page < 0 ) { - result = 0; - books_primary_item_per_page = result; + items_per_page = 0; + books_primary_item_per_page = items_per_page; } } BtnDown_flag = 0; @@ -615,7 +631,7 @@ num_achieved_awards = 0; books_page_number = 0; - for ( int i = result; i < full_num_items_in_book; ++i) + for ( int i = items_per_page; i < full_num_items_in_book; ++i) { v6 = (char *)pAwards[achieved_awards[i]].pText;//(char *)dword_723E80_award_related[v20 / 4]; pTmpBuf[0] = 0; @@ -667,7 +683,7 @@ { case WINDOW_CharacterWindow_Stats: // stats CharacterUI_ReleaseButtons(); - sub_419379(); + ReleaseAwardsScrollBar(); CharacterUI_StatsTab_Draw(player); pRenderer->DrawTextureIndexed(pCharacterScreen_StatsBtn->uX, pCharacterScreen_StatsBtn->uY, @@ -680,7 +696,7 @@ CharacterUI_ReleaseButtons(); CharacterUI_SkillsTab_CreateButtons(); } - sub_419379(); + ReleaseAwardsScrollBar(); CharacterUI_SkillsTab_Draw(player); pRenderer->DrawTextureIndexed(pCharacterScreen_SkillsBtn->uX, pCharacterScreen_SkillsBtn->uY, @@ -689,7 +705,7 @@ case WINDOW_CharacterWindow_Awards: // awards CharacterUI_ReleaseButtons(); - sub_419379(); + ReleaseAwardsScrollBar(); CreateAwardsScrollBar(); CharacterUI_AwardsTab_Draw(player); pRenderer->DrawTextureIndexed(pCharacterScreen_AwardsBtn->uX, @@ -699,7 +715,7 @@ case WINDOW_CharacterWindow_Inventory: // inventory and other CharacterUI_ReleaseButtons(); - sub_419379(); + ReleaseAwardsScrollBar(); CharacterUI_InventoryTab_Draw(player, false); pRenderer->DrawTextureIndexed(pCharacterScreen_InventoryBtn->uX, pCharacterScreen_InventoryBtn->uY, @@ -947,8 +963,8 @@ } if ( index >= 0 && index < 17 ) { - item_X = pPaperdoll_BodyX + paperdoll_Armor[pBodyComplection][index][0]; - item_Y = pPaperdoll_BodyY + paperdoll_Armor[pBodyComplection][index][1]; + item_X = pPaperdoll_BodyX + paperdoll_Armor_Coord[pBodyComplection][index][0]; + item_Y = pPaperdoll_BodyY + paperdoll_Armor_Coord[pBodyComplection][index][1]; if ( !(item->uAttributes & 0xF0) ) { if ( item->uAttributes & 2 ) @@ -981,105 +997,6 @@ pRenderer->DrawAura(item_X, item_Y, pIcons_LOD->GetTexture(paperdoll_armor_texture[pBodyComplection][index][0]), pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE), GetTickCount() * 0.1, 0, 255); } - //--------------------------------(Shoulder/)--------------------------------------------- - if ( pPlayers[uPlayerID]->pEquipment.uMainHand - && (pPlayers[uPlayerID]->GetEquippedItemEquipType(EQUIP_MAIN_HAND) == EQUIP_MAIN_HAND || - pPlayers[uPlayerID]->GetEquippedItemSkillType(EQUIP_MAIN_HAND) == EQUIP_SHIELD && - !pPlayers[uPlayerID]->pEquipment.uShield) )// - { - v94 = paperdoll_armor_texture[pBodyComplection][index][2]; - if ( paperdoll_armor_texture[pBodyComplection][index][2] == pIcons_LOD->FindTextureByName("pending") ) - { - v94 = paperdoll_armor_texture[pBodyComplection][index][1]; - item_X = pPaperdoll_BodyX + paperdoll_shoulder[pBodyComplection][index][0]; - item_Y = pPaperdoll_BodyY + paperdoll_shoulder[pBodyComplection][index][1]; - } - else - { - item_X = pPaperdoll_BodyX + dword_4E5270[index][0]; - item_Y = pPaperdoll_BodyY + dword_4E5270[index][1]; - } - if ( !(item->uAttributes & 0xF0) ) - { - //v98 = v94 + 1; - if ( item->uAttributes & 2 ) - pRenderer->DrawTransparentRedShade(item_X, item_Y, pIcons_LOD->GetTexture(v94)); - else - { - if ( item->uAttributes & 1 ) - pRenderer->DrawTextureTransparent(item_X, item_Y, pIcons_LOD->GetTexture(v94)); - else - pRenderer->DrawTransparentGreenShade(item_X, item_Y, pIcons_LOD->GetTexture(v94)); - } - } - else - { - if ( paperdoll_armor_texture[pBodyComplection][index][2] != pIcons_LOD->FindTextureByName("pending") ) - { - if ( item->uAttributes & 0xF0 ) - { - if ( (item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_RED ) - container = "sptext01"; - if ( (item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_BLUE ) - container = "sp28a"; - if ( ( item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_GREEN ) - container = "sp30a"; - if ( (item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_PURPLE ) - container = "sp91a"; - _50C9A8_item_enchantment_timer -= pEventTimer->uTimeElapsed; - if ( _50C9A8_item_enchantment_timer <= 0 ) - { - _50C9A8_item_enchantment_timer = 0; - item->uAttributes &= 0xFFFFFF0Fu; - ptr_50C9A4 = 0; - } - pRenderer->DrawAura(item_X, item_Y, pIcons_LOD->GetTexture(v94), pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE), - GetTickCount() * 0.1, 0, 255); - } - } - } - } - else// - { - //v94 = paperdoll_armor_texture[pBodyComplection][index][1]; - if ( paperdoll_armor_texture[pBodyComplection][index][1] != pIcons_LOD->FindTextureByName("pending") ) - { - item_X = pPaperdoll_BodyX + paperdoll_shoulder[pBodyComplection][index][0]; - item_Y = pPaperdoll_BodyY + paperdoll_shoulder[pBodyComplection][index][1]; - if ( !(item->uAttributes & 0xF0) ) - { - if ( item->uAttributes & 2 ) - pRenderer->DrawTransparentRedShade(item_X, item_Y, pIcons_LOD->GetTexture(paperdoll_armor_texture[pBodyComplection][index][2])); - else - { - if ( item->uAttributes & 1 ) - pRenderer->DrawTextureTransparent(item_X, item_Y, pIcons_LOD->GetTexture(paperdoll_armor_texture[pBodyComplection][index][2])); - else - pRenderer->DrawTransparentGreenShade(item_X, item_Y, pIcons_LOD->GetTexture(paperdoll_armor_texture[pBodyComplection][index][2])); - } - } - else - { - if ( (item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_RED ) - container = "sptext01"; - if ( (item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_BLUE ) - container = "sp28a"; - if ( (item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_GREEN ) - container = "sp30a"; - if ( (item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_PURPLE ) - container = "sp91a"; - _50C9A8_item_enchantment_timer -= pEventTimer->uTimeElapsed; - if ( _50C9A8_item_enchantment_timer <= 0 ) - { - _50C9A8_item_enchantment_timer = 0; - item->uAttributes &= 0xFFFFFF0Fu; - ptr_50C9A4 = 0; - } - pRenderer->DrawAura(item_X, item_Y, pIcons_LOD->GetTexture(paperdoll_armor_texture[pBodyComplection][index][1]), - pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE), GetTickCount() * 0.1, 0, 255); - } - } - } if ( !bRingsShownInCharScreen ) pRenderer->DrawMaskToZBuffer(item_X, item_Y, &pIcons_LOD->pTextures[paperdoll_armor_texture[pBodyComplection][index][0]], @@ -1222,6 +1139,129 @@ pRenderer->DrawTextureTransparent(pPaperdoll_BodyX + pPaperdoll_SecondLeftHand[pBodyComplection][0], pPaperdoll_BodyY + pPaperdoll_SecondLeftHand[pBodyComplection][1], pIcons_LOD->GetTexture(papredoll_dlaus[uPlayerID - 1])); } + //--------------------------------(Shoulder/)--------------------------------------------- + item = &pPlayers[uPlayerID]->pInventoryItemList[pPlayers[uPlayerID]->pEquipment.uArmor - 1]; + switch ( item->uItemID ) + { + case ITEM_ARTICACT_GOVERNONS_ARMOR: + index = 15; + break; + case ITEM_ARTIFACT_YORUBA: + index = 14; + break; + case ITEM_RELIC_HARECS_LEATHER: + index = 13; + break; + case ITEM_ELVEN_CHAINMAIL: + index = 16; + break; + default: + index = item->uItemID - 66; + break; + } + if ( index >= 0 && index < 17 ) + { + if ( pPlayers[uPlayerID]->pEquipment.uMainHand + && (pPlayers[uPlayerID]->GetEquippedItemEquipType(EQUIP_MAIN_HAND) == EQUIP_MAIN_HAND + || pPlayers[uPlayerID]->GetEquippedItemSkillType(EQUIP_MAIN_HAND) == EQUIP_SHIELD + && !pPlayers[uPlayerID]->pEquipment.uShield) )// + { + v94 = paperdoll_armor_texture[pBodyComplection][index][2]; + if ( paperdoll_armor_texture[pBodyComplection][index][2] == pIcons_LOD->FindTextureByName("pending") ) + { + v94 = paperdoll_armor_texture[pBodyComplection][index][1]; + item_X = pPaperdoll_BodyX + paperdoll_shoulder_coord[pBodyComplection][index][0]; + item_Y = pPaperdoll_BodyY + paperdoll_shoulder_coord[pBodyComplection][index][1]; + } + else + { + item_X = pPaperdoll_BodyX + paperdoll_shoulder_second_coord[pBodyComplection][index][0]; + item_Y = pPaperdoll_BodyY + paperdoll_shoulder_second_coord[pBodyComplection][index][1]; + } + if ( v94 != pIcons_LOD->FindTextureByName("pending") ) + { + if ( !(item->uAttributes & 0xF0) ) + { + if ( item->uAttributes & 2 ) + pRenderer->DrawTransparentRedShade(item_X, item_Y, pIcons_LOD->GetTexture(v94)); + else + { + if ( item->uAttributes & 1 ) + pRenderer->DrawTextureTransparent(item_X, item_Y, pIcons_LOD->GetTexture(v94)); + else + pRenderer->DrawTransparentGreenShade(item_X, item_Y, pIcons_LOD->GetTexture(v94)); + } + } + else + { + if ( paperdoll_armor_texture[pBodyComplection][index][2] != pIcons_LOD->FindTextureByName("pending") ) + { + if ( item->uAttributes & 0xF0 ) + { + if ( (item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_RED ) + container = "sptext01"; + if ( (item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_BLUE ) + container = "sp28a"; + if ( ( item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_GREEN ) + container = "sp30a"; + if ( (item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_PURPLE ) + container = "sp91a"; + _50C9A8_item_enchantment_timer -= pEventTimer->uTimeElapsed; + if ( _50C9A8_item_enchantment_timer <= 0 ) + { + _50C9A8_item_enchantment_timer = 0; + item->uAttributes &= 0xFFFFFF0Fu; + ptr_50C9A4 = 0; + } + pRenderer->DrawAura(item_X, item_Y, pIcons_LOD->GetTexture(v94), pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE), + GetTickCount() * 0.1, 0, 255); + } + } + } + } + } + else// + { + //v94 = paperdoll_armor_texture[pBodyComplection][index][1]; + if ( paperdoll_armor_texture[pBodyComplection][index][1] != pIcons_LOD->FindTextureByName("pending") ) + { + item_X = pPaperdoll_BodyX + paperdoll_shoulder_coord[pBodyComplection][index][0]; + item_Y = pPaperdoll_BodyY + paperdoll_shoulder_coord[pBodyComplection][index][1]; + if ( !(item->uAttributes & 0xF0) ) + { + if ( item->uAttributes & 2 ) + pRenderer->DrawTransparentRedShade(item_X, item_Y, pIcons_LOD->GetTexture(paperdoll_armor_texture[pBodyComplection][index][1])); + else + { + if ( item->uAttributes & 1 ) + pRenderer->DrawTextureTransparent(item_X, item_Y, pIcons_LOD->GetTexture(paperdoll_armor_texture[pBodyComplection][index][1])); + else + pRenderer->DrawTransparentGreenShade(item_X, item_Y, pIcons_LOD->GetTexture(paperdoll_armor_texture[pBodyComplection][index][1])); + } + } + else + { + if ( (item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_RED ) + container = "sptext01"; + if ( (item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_BLUE ) + container = "sp28a"; + if ( (item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_GREEN ) + container = "sp30a"; + if ( (item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_PURPLE ) + container = "sp91a"; + _50C9A8_item_enchantment_timer -= pEventTimer->uTimeElapsed; + if ( _50C9A8_item_enchantment_timer <= 0 ) + { + _50C9A8_item_enchantment_timer = 0; + item->uAttributes &= 0xFFFFFF0Fu; + ptr_50C9A4 = 0; + } + pRenderer->DrawAura(item_X, item_Y, pIcons_LOD->GetTexture(paperdoll_armor_texture[pBodyComplection][index][1]), + pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE), GetTickCount() * 0.1, 0, 255); + } + } + } + } //----------------------------------------------(Cloak collar/ )------------------------------------- if ( pPlayers[uPlayerID]->pEquipment.uCloak ) { @@ -1503,93 +1543,72 @@ //----- (0041A2D1) -------------------------------------------------------- void CharacterUI_InventoryTab_Draw(Player *player, bool a2) { - Texture *v7; // esi@6 - signed int v11; // edx@6 - int v13; // eax@13 - signed int v14; // edx@13 - int v15; // eax@13 - unsigned int v17; // edi@15 - Texture *pTexture; // ebx@24 - unsigned int uCellX; // [sp+30h] [bp-8h]@5 - unsigned int uCellY; // [sp+34h] [bp-4h]@5 + Texture *pTexture; // esi@6 + int v13; // eax@13 + int v15; // eax@13 + unsigned int v17; // edi@15 + unsigned int uCellX; // [sp+30h] [bp-8h]@5 + unsigned int uCellY; // [sp+34h] [bp-4h]@5 pRenderer->DrawTextureIndexed(8, 8, pIcons_LOD->GetTexture(uTextureID_CharacterUI_InventoryBackground)); if (a2) pRenderer->DrawTextureIndexed(8, 305, pIcons_LOD->LoadTexturePtr("fr_strip", TEXTURE_16BIT_PALETTE)); - - int i = 0; for (uint i = 0; i < 126; ++i) { - int v26 = (int)(player->pInventoryMatrix + i); - - if (player->pInventoryMatrix[i] <= 0) + if ( player->pInventoryMatrix[i] <= 0 ) continue; - - int item_idx = player->pInventoryMatrix[i]; - auto item = &player->pInventoryItemList[item_idx - 1]; - if (!item->uItemID) + if ( !player->pInventoryItemList[player->pInventoryMatrix[i] - 1].uItemID ) continue; - uCellY = 32 * (i / 14) + 17; uCellX = 32 * (i % 14) + 14; - uint item_texture_id = pIcons_LOD->LoadTexture(pItemsTable->pItems[item->uItemID].pIconName, TEXTURE_16BIT_PALETTE); - v7 = pIcons_LOD->GetTexture(item_texture_id); - - v11 = v7->uTextureWidth; - if (v11 < 14) - v11 = 14; - - if ( (v11 - 14) / 32 == 0 && v7->uTextureWidth < 32) - uCellX += (32 - v7->uTextureWidth) / 2; - v13 = v11 - 14; - LOBYTE(v13) = v13 & 0xE0; - v15 = v13 + 32; - v14 = v7->uTextureHeight; - if (v14 < 14 ) - v14 = 14; - v17 = uCellX + ((v15 - v7->uTextureWidth) >> 1) + pSRZBufferLineOffsets[uCellY + (( (int)((v14 - 14) & 0xFFFFFFE0) - v7->uTextureHeight + 32) >> 1)]; //added typecast. without it the value in the brackets got cat to unsigned which messed stuff up - - if (item->uAttributes & 0xF0) + uint item_texture_id = pIcons_LOD->LoadTexture(pItemsTable->pItems[player->pInventoryItemList[player->pInventoryMatrix[i] - 1].uItemID].pIconName, TEXTURE_16BIT_PALETTE); + pTexture = pIcons_LOD->GetTexture(item_texture_id); + if (pTexture->uTextureWidth < 14) + pTexture->uTextureWidth = 14; + if ( (pTexture->uTextureWidth - 14) / 32 == 0 && pTexture->uTextureWidth < 32) + uCellX += (32 - pTexture->uTextureWidth) / 2; + v13 = pTexture->uTextureWidth - 14; + LOBYTE(v13) = v13 & 0xE0; + v15 = v13 + 32; + if (pTexture->uTextureHeight < 14 ) + pTexture->uTextureHeight = 14; + v17 = uCellX + ((v15 - pTexture->uTextureWidth) >> 1) + pSRZBufferLineOffsets[uCellY + (( (int)((pTexture->uTextureHeight - 14) & 0xFFFFFFE0) - pTexture->uTextureHeight + 32) >> 1)]; //added typecast. without it the value in the brackets got cat to unsigned which messed stuff up + if (player->pInventoryItemList[player->pInventoryMatrix[i] - 1].uAttributes & 0xF0) { - switch (item->uAttributes & 0xF0) + switch (player->pInventoryItemList[player->pInventoryMatrix[i] - 1].uAttributes & 0xF0) { case ITEM_AURA_EFFECT_RED: pTexture = pIcons_LOD->LoadTexturePtr("sptext01", TEXTURE_16BIT_PALETTE); break; case ITEM_AURA_EFFECT_BLUE: pTexture = pIcons_LOD->LoadTexturePtr("sp28a", TEXTURE_16BIT_PALETTE); break; case ITEM_AURA_EFFECT_GREEN: pTexture = pIcons_LOD->LoadTexturePtr("sp30a", TEXTURE_16BIT_PALETTE); break; case ITEM_AURA_EFFECT_PURPLE: pTexture = pIcons_LOD->LoadTexturePtr("sp91a", TEXTURE_16BIT_PALETTE); break; } - _50C9A8_item_enchantment_timer -= pEventTimer->uTimeElapsed; if (_50C9A8_item_enchantment_timer <= 0) { _50C9A8_item_enchantment_timer = 0; - LOBYTE(item->uAttributes) &= 0xF; + LOBYTE(player->pInventoryItemList[player->pInventoryMatrix[i] - 1].uAttributes) &= 0xF; ptr_50C9A4 = 0; } - - pRenderer->DrawAura(uCellX, uCellY, v7, pTexture, GetTickCount() * 0.1, 0, 255); - ZBuffer_Fill(&pRenderer->pActiveZBuffer[v17], item_texture_id, item_idx); + pRenderer->DrawAura(uCellX, uCellY, pTexture, pTexture, GetTickCount() * 0.1, 0, 255); + ZBuffer_Fill(&pRenderer->pActiveZBuffer[v17], item_texture_id, player->pInventoryMatrix[i]); } else { - if (item->Identified() || pCurrentScreen != SCREEN_HOUSE) + if (player->pInventoryItemList[player->pInventoryMatrix[i] - 1].Identified() || pCurrentScreen != SCREEN_HOUSE) { - if (item->Broken()) - pRenderer->DrawTransparentRedShade(uCellX, uCellY, v7); + if (player->pInventoryItemList[player->pInventoryMatrix[i] - 1].Broken()) + pRenderer->DrawTransparentRedShade(uCellX, uCellY, pTexture); else - pRenderer->DrawTextureTransparent(uCellX, uCellY, v7); + pRenderer->DrawTextureTransparent(uCellX, uCellY, pTexture); } else - pRenderer->DrawTransparentGreenShade(uCellX, uCellY, v7); - - ZBuffer_Fill(&pRenderer->pActiveZBuffer[v17], item_texture_id, item_idx); + pRenderer->DrawTransparentGreenShade(uCellX, uCellY, pTexture); + ZBuffer_Fill(&pRenderer->pActiveZBuffer[v17], item_texture_id, player->pInventoryMatrix[i]); continue; } } } - - static void CharacterUI_DrawItem(int x, int y, ItemGen *item, int id) { auto item_texture = pIcons_LOD->LoadTexturePtr(pItemsTable->pItems[item->uItemID].pIconName, TEXTURE_16BIT_PALETTE); @@ -1627,140 +1646,103 @@ } } - //----- (0043E825) -------------------------------------------------------- void CharacterUI_DrawPaperdollWithRingOverlay(Player *player) { CharacterUI_DrawPaperdoll(player); - pRenderer->DrawTextureTransparent(0x1D9u, 0, pIcons_LOD->GetTexture(uTextureID_BACKHAND)); pRenderer->DrawTextureTransparent(0x1D4u, 0, pIcons_LOD->GetTexture(uTextureID_right_panel_loop)); - pRenderer->DrawTextureIndexed(pCharacterScreen_DetalizBtn->uX, - pCharacterScreen_DetalizBtn->uY, + pRenderer->DrawTextureIndexed(pCharacterScreen_DetalizBtn->uX, pCharacterScreen_DetalizBtn->uY, pIcons_LOD->GetTexture(uTextureID_detaliz_close_button)); - for (uint i = 0; i < 6; ++i) { if (!player->pEquipment.uRings[i]) continue; - static int pPaperdollRingsX[6] = {0x1EA, 0x21A, 0x248, 0x1EA, 0x21A, 0x248}; static int pPaperdollRingsY[6] = {0x0CA, 0x0CA, 0x0CA, 0x0FA, 0x0FA, 0x0FA}; - - CharacterUI_DrawItem(pPaperdollRingsX[i], - pPaperdollRingsY[i], - &player->pInventoryItemList[player->pEquipment.uRings[i] - 1], + CharacterUI_DrawItem(pPaperdollRingsX[i], pPaperdollRingsY[i], &player->pInventoryItemList[player->pEquipment.uRings[i] - 1], player->pEquipment.uRings[i]); } - - if (player->pEquipment.uAmulet) - { - CharacterUI_DrawItem(493, 91, - &player->pInventoryItemList[player->pEquipment.uAmulet - 1], - player->pEquipment.uAmulet); - } - + CharacterUI_DrawItem(493, 91, &player->pInventoryItemList[player->pEquipment.uAmulet - 1], player->pEquipment.uAmulet); if (player->pEquipment.uGlove) - { - CharacterUI_DrawItem(586, 88, - &player->pInventoryItemList[player->pEquipment.uGlove - 1], - player->pEquipment.uGlove); - } + CharacterUI_DrawItem(586, 88, &player->pInventoryItemList[player->pEquipment.uGlove - 1], player->pEquipment.uGlove); } //----- (0043BCA7) -------------------------------------------------------- void CharacterUI_LoadPaperdollTextures() { - int v0; // edi@7 - enum CHARACTER_RACE pRace; // ebx@7 - signed int pSex; // eax@7 int v3; // ebx@10 Player *pPlayer; // edi@12 - unsigned __int8 v5; // cl@12 int v6; // edi@16 unsigned int v7; // eax@16 Player *pPlayer2; // ebx@16 char *v9; // ebx@16 - char v10; // al@16 - signed int v11; // edi@21 unsigned int v22; // eax@76 int v23; // ecx@76 unsigned int v24; // eax@78 int v25; // ecx@78 - int v26; // ebx@79 unsigned int v27; // eax@80 int v28; // ecx@80 - int v30; // [sp+10h] [bp-28h]@5 signed int v32; // [sp+10h] [bp-28h]@75 signed int v33; // [sp+10h] [bp-28h]@77 int v34; // [sp+10h] [bp-28h]@79 int pItemTXTNum; // [sp+14h] [bp-24h]@75 int v37; // [sp+14h] [bp-24h]@77 signed int v38; // [sp+14h] [bp-24h]@79 - int v42; // [sp+20h] [bp-18h]@6 - int v43; // [sp+20h] [bp-18h]@73 char pContainer[128]; // [sp+24h] [bp-14h]@12 uTextureID_MAGNIF_B = pIcons_LOD->LoadTexture("MAGNIF-B", TEXTURE_16BIT_PALETTE); //if ( !pParty->uAlignment || pParty->uAlignment == 1 || pParty->uAlignment == 2 ) uTextureID_BACKDOLL = pIcons_LOD->LoadTexture("BACKDOLL", TEXTURE_16BIT_PALETTE); uTextureID_right_panel_loop = uTextureID_right_panel; - v30 = 0; uTextureID_BACKHAND = pIcons_LOD->LoadTexture("BACKHAND", TEXTURE_16BIT_PALETTE); uTextureID_detaliz_close_button = uExitCancelTextureId; - do + for ( uint i = 0; i < 4; ++i ) { - v42 = v30 + 1; - if ( sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(v30 + 1) ) + if ( sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(i + 1) ) { - v0 = v30; - pRace = pPlayers[v30 + 1]->GetRace(); - pSex = pPlayers[v30 + 1]->GetSexByVoice(); - if ( pRace && pRace != 1 && pRace != 2 )//race == 3 - v3 = (pSex != 0) + 3; + if ( pPlayers[i + 1]->GetRace() == CHARACTER_RACE_DWARF ) + v3 = (pPlayers[i + 1]->GetSexByVoice() != 0) + 3; else - v3 = (pSex != 0) + 1; + v3 = (pPlayers[i + 1]->GetSexByVoice() != 0) + 1; wsprintfA(pContainer, "pc23v%dBod", v3); - papredoll_dbods[v0] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);//Body texture + papredoll_dbods[i] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);//Body texture wsprintfA(pContainer, "pc23v%dlad", v3); - papredoll_dlads[v0] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);// Left Hand + papredoll_dlads[i] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);// Left Hand wsprintfA(pContainer, "pc23v%dlau", v3); - papredoll_dlaus[v0] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);// Left Hand2 + papredoll_dlaus[i] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);// Left Hand2 wsprintfA(pContainer, "pc23v%drh", v3); - papredoll_drhs[v0] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);// Right Hand + papredoll_drhs[i] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);// Right Hand wsprintfA(pContainer, "pc23v%dlh", v3); - papredoll_dlhs[v0] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);// Left Fist + papredoll_dlhs[i] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);// Left Fist wsprintfA(pContainer, "pc23v%dlhu", v3); - papredoll_dlhus[v0] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); // Left Fist 2 - pPlayer = pPlayers[v0 + 1]; - v5 = pPlayer->uCurrentFace; - if ( v5 == 12 || v5 == 13 ) - papredoll_dbrds[(char)v5] = 0; + papredoll_dlhus[i] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); // Left Fist 2 + pPlayer = pPlayers[i + 1]; + if ( pPlayer->uCurrentFace == 12 || pPlayer->uCurrentFace == 13 ) + papredoll_dbrds[(char)pPlayer->uCurrentFace] = 0; papredoll_flying_feet[pPlayer->uCurrentFace] = 0; - IsPlayerWearingWatersuit[v30 + 1] = 1; + IsPlayerWearingWatersuit[i + 1] = 1; } else { - papredoll_dbods[v30] = pIcons_LOD->LoadTexture(dbod_texnames_by_face[pPlayers[v30 + 1]->uCurrentFace], TEXTURE_16BIT_PALETTE); - papredoll_dlads[v30] = pIcons_LOD->LoadTexture(dlad_texnames_by_face[pPlayers[v30 + 1]->uCurrentFace], TEXTURE_16BIT_PALETTE); - papredoll_dlaus[v30] = pIcons_LOD->LoadTexture(dlau_texnames_by_face[pPlayers[v30 + 1]->uCurrentFace], TEXTURE_16BIT_PALETTE); - papredoll_drhs[v30] = pIcons_LOD->LoadTexture(drh_texnames_by_face[pPlayers[v30 + 1]->uCurrentFace], TEXTURE_16BIT_PALETTE); - papredoll_dlhs[v30] = pIcons_LOD->LoadTexture(dlh_texnames_by_face[pPlayers[v30 + 1]->uCurrentFace], TEXTURE_16BIT_PALETTE); - papredoll_dlhus[v30] = pIcons_LOD->LoadTexture(dlhu_texnames_by_face[pPlayers[v30 + 1]->uCurrentFace], TEXTURE_16BIT_PALETTE); - v10 = pPlayers[v30 + 1]->uCurrentFace; - if ( v10 == 12 || v10 == 13 ) + papredoll_dbods[i] = pIcons_LOD->LoadTexture(dbod_texnames_by_face[pPlayers[i + 1]->uCurrentFace], TEXTURE_16BIT_PALETTE); + papredoll_dlads[i] = pIcons_LOD->LoadTexture(dlad_texnames_by_face[pPlayers[i + 1]->uCurrentFace], TEXTURE_16BIT_PALETTE); + papredoll_dlaus[i] = pIcons_LOD->LoadTexture(dlau_texnames_by_face[pPlayers[i + 1]->uCurrentFace], TEXTURE_16BIT_PALETTE); + papredoll_drhs[i] = pIcons_LOD->LoadTexture(drh_texnames_by_face[pPlayers[i + 1]->uCurrentFace], TEXTURE_16BIT_PALETTE); + papredoll_dlhs[i] = pIcons_LOD->LoadTexture(dlh_texnames_by_face[pPlayers[i + 1]->uCurrentFace], TEXTURE_16BIT_PALETTE); + papredoll_dlhus[i] = pIcons_LOD->LoadTexture(dlhu_texnames_by_face[pPlayers[i + 1]->uCurrentFace], TEXTURE_16BIT_PALETTE); + if ( pPlayers[i + 1]->uCurrentFace == 12 || pPlayers[i + 1]->uCurrentFace == 13 ) { - wsprintfA(pContainer, "pc%02dbrd", v10 + 1); - papredoll_dbrds[v10] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + wsprintfA(pContainer, "pc%02dbrd", pPlayers[i + 1]->uCurrentFace + 1); + papredoll_dbrds[pPlayers[i + 1]->uCurrentFace] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); } - wsprintfA(pContainer, "item281pc%02d", v10 + 1); - papredoll_flying_feet[pPlayers[v30 + 1]->uCurrentFace] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); - IsPlayerWearingWatersuit[v30 + 1] = 0; + wsprintfA(pContainer, "item281pc%02d", pPlayers[i + 1]->uCurrentFace + 1); + papredoll_flying_feet[pPlayers[i + 1]->uCurrentFace] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + IsPlayerWearingWatersuit[i + 1] = 0; } - ++v30; } - while ( v42 < 4 ); + uTextureID_ar_up_up = pIcons_LOD->LoadTexture("ar_up_up", TEXTURE_16BIT_PALETTE); uTextureID_ar_up_dn = pIcons_LOD->LoadTexture("ar_up_dn", TEXTURE_16BIT_PALETTE); uTextureID_ar_dn_up = pIcons_LOD->LoadTexture("ar_dn_up", TEXTURE_16BIT_PALETTE); @@ -1770,15 +1752,15 @@ papredoll_dbrds[5] = pIcons_LOD->LoadTexture("ib-cd3-d", TEXTURE_16BIT_PALETTE); papredoll_dbrds[3] = pIcons_LOD->LoadTexture("ib-cd4-d", TEXTURE_16BIT_PALETTE); papredoll_dbrds[1] = pIcons_LOD->LoadTexture("ib-cd5-d", TEXTURE_16BIT_PALETTE); - for ( v11 = 0; v11 < 54; ++v11 )// test equipment + for ( uint i = 0; i < 54; ++i )// test equipment { - party_has_equipment[v11] = 0; - if ( pParty->pPickedItem.uItemID != v11 + 66 ) + party_has_equipment[i] = 0; + if ( pParty->pPickedItem.uItemID != i + 66 ) { - for ( uint i = 0; i < 4; ++i) + for ( uint j = 0; j < 4; ++j) { - if ( Player_has_item(v11 + 66, &pParty->pPlayers[i], 0) ) - party_has_equipment[v11] = 1; + if ( Player_has_item(i + 66, &pParty->pPlayers[j], 0) ) + party_has_equipment[i] = 1; } } } @@ -1806,7 +1788,6 @@ if (Player_has_item(ITEM_ELVEN_CHAINMAIL, player, 1)) byte_5111F6[16] = 1; } - for (uint i = 0; i < 2; ++i) { for ( uint j = 0; j < 5; ++j )//Belt @@ -1834,7 +1815,7 @@ if ( _43ED6F_check_party_races(true) ) papredoll_dbrds[11] = pIcons_LOD->LoadTexture("item092v3", TEXTURE_16BIT_PALETTE); } - v43 = 0; + //v43 = 0; for (uint i = 0; i < 4; ++i) { if ( sub_43EDB9_get_some_race_sex_relation_2(i) ) @@ -1845,11 +1826,11 @@ for ( v32 = 0; v32 < 13; ++v32 )//simple armor { GetItemTextureFilename(pContainer, pItemTXTNum, i + 1, 0); - paperdoll_armor_texture[i][v32][0] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + paperdoll_armor_texture[i][v32][0] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);// armor GetItemTextureFilename(pContainer, pItemTXTNum, i + 1, 1); - paperdoll_armor_texture[i][v32][1] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + paperdoll_armor_texture[i][v32][1] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);// shoulder 1 GetItemTextureFilename(pContainer, pItemTXTNum, i + 1, 2); - paperdoll_armor_texture[i][v32][2] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + paperdoll_armor_texture[i][v32][2] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);// shoulder 2 pItemTXTNum++; } GetItemTextureFilename(pContainer, 516, i + 1, 0);//artefacts @@ -1911,190 +1892,112 @@ GetItemTextureFilename(pContainer, 550, i + 1, 1); paperdoll_cloak_collar_texture[i][9] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); } - else - { - v26 = v43; - } - v43 = v26 + 40; + //else + //{ + //v26 = v43; + //} + //v43 = v26 + 40; } } //----- (00419401) -------------------------------------------------------- void CharacterUI_SkillsTab_CreateButtons() - { - // unsigned int v0; // ecx@3 - GUIButton *pButton; // eax@3 - unsigned int current_Y; // esi@8 - int buttons_count; // [sp+10h] [bp-14h]@1 - int first_rows; // [sp+14h] [bp-10h]@19 - int skill_id; // [sp+18h] [bp-Ch]@8 - Player *curr_player; // [sp+1Ch] [bp-8h]@8 - int i; - int uCurrFontHeght; +{ + GUIButton *pButton; // eax@3 + unsigned int current_Y; // esi@8 + int buttons_count; // [sp+10h] [bp-14h]@1 + int first_rows; // [sp+14h] [bp-10h]@19 + int skill_id; // [sp+18h] [bp-Ch]@8 + Player *curr_player; // [sp+1Ch] [bp-8h]@8 + int i; + int uCurrFontHeght; - buttons_count = 0; - if ( dword_507CC0_activ_ch ) - CharacterUI_ReleaseButtons(); - dword_507CC0_activ_ch = uActiveCharacter; - for ( pButton = pGUIWindow_CurrentMenu->pControlsHead; pButton; pButton = pButton->pNext ) - { - if ( pButton->msg == UIMSG_InventoryLeftClick ) - { - dword_50698C_uX = pButton->uX; - dword_506988_uY = pButton->uY; - dword_506984_uZ = pButton->uZ; - dword_506980_uW = pButton->uW; - pButton->uW = 0; - pButton->uZ = 0; - pButton->uY = 0; - pButton->uX = 0; - } - } - first_rows = 0; - // a5 = pGUIWindow_CurrentMenu->uNumControls; - curr_player = &pParty->pPlayers[uActiveCharacter-1]; + buttons_count = 0; + if ( dword_507CC0_activ_ch ) + CharacterUI_ReleaseButtons(); + dword_507CC0_activ_ch = uActiveCharacter; + for ( pButton = pGUIWindow_CurrentMenu->pControlsHead; pButton; pButton = pButton->pNext ) + { + if ( pButton->msg == UIMSG_InventoryLeftClick ) + { + dword_50698C_uX = pButton->uX; + dword_506988_uY = pButton->uY; + dword_506984_uZ = pButton->uZ; + dword_506980_uW = pButton->uW; + pButton->uW = 0; + pButton->uZ = 0; + pButton->uY = 0; + pButton->uX = 0; + } + } + first_rows = 0; + // a5 = pGUIWindow_CurrentMenu->uNumControls; + curr_player = &pParty->pPlayers[uActiveCharacter-1]; - uCurrFontHeght=pFontLucida->uFontHeight; - current_Y = 2 *uCurrFontHeght + 13; - for(i=0; i<9;++i) - { - skill_id = pWeaponSkills[i]; - if ( curr_player->pActiveSkills[skill_id] & 0x3F ) - { - current_Y += uCurrFontHeght - 3; - ++buttons_count; - ++first_rows; - pGUIWindow_CurrentMenu->CreateButton(24, current_Y, 204, uCurrFontHeght - 3, 3, skill_id | 0x8000, UIMSG_SkillUp, skill_id, 0, "", 0, 0); - } - } - if ( !first_rows ) - current_Y += uCurrFontHeght - 3; - current_Y += 2 * uCurrFontHeght - 6; - for(i=0; i<9;++i) - { - skill_id = pMagicSkills[i]; - if ( curr_player->pActiveSkills[skill_id] & 0x3F && buttons_count < 15 ) - { - current_Y += uCurrFontHeght - 3; - ++buttons_count; - pGUIWindow_CurrentMenu->CreateButton(24, current_Y, 204, uCurrFontHeght - 3, 3, skill_id | 0x8000, UIMSG_SkillUp, skill_id, 0, "", 0, 0); - } - } - first_rows = 0; - current_Y = 2 * uCurrFontHeght + 13; - for(i=0; i<5;++i) - { - skill_id = pArmorSkills[i]; - if ( curr_player->pActiveSkills[skill_id] & 0x3F ) - { - current_Y+= uCurrFontHeght - 3; - ++buttons_count; - ++first_rows; - pGUIWindow_CurrentMenu->CreateButton(246, current_Y, 204, uCurrFontHeght - 3, 3, skill_id | 0x8000, UIMSG_SkillUp, skill_id, 0, "", 0, 0); - } - } - if ( !first_rows ) - current_Y += uCurrFontHeght - 3; - current_Y += 2 * uCurrFontHeght - 6; - for(i=0; i<12; ++i) - { - skill_id = pMiscSkills[i]; - if ( curr_player->pActiveSkills[skill_id] & 0x3F ) - { - current_Y += uCurrFontHeght - 3; - ++buttons_count; - pGUIWindow_CurrentMenu->CreateButton(246, current_Y, 204, uCurrFontHeght - 3, 3, skill_id | 0x8000, UIMSG_SkillUp, skill_id, 0, "", 0, 0); - } - } + uCurrFontHeght=pFontLucida->uFontHeight; + current_Y = 2 *uCurrFontHeght + 13; + for( i = 0; i < 9; ++i ) + { + skill_id = pWeaponSkills[i]; + if ( curr_player->pActiveSkills[skill_id] & 0x3F ) + { + current_Y += uCurrFontHeght - 3; + ++buttons_count; + ++first_rows; + pGUIWindow_CurrentMenu->CreateButton(24, current_Y, 204, uCurrFontHeght - 3, 3, skill_id | 0x8000, UIMSG_SkillUp, skill_id, 0, "", 0, 0); + } + } + if ( !first_rows ) + current_Y += uCurrFontHeght - 3; + current_Y += 2 * uCurrFontHeght - 6; + for ( i = 0; i < 9; ++i ) + { + skill_id = pMagicSkills[i]; + if ( curr_player->pActiveSkills[skill_id] & 0x3F && buttons_count < 15 ) + { + current_Y += uCurrFontHeght - 3; + ++buttons_count; + pGUIWindow_CurrentMenu->CreateButton(24, current_Y, 204, uCurrFontHeght - 3, 3, skill_id | 0x8000, UIMSG_SkillUp, skill_id, 0, "", 0, 0); + } + } + first_rows = 0; + current_Y = 2 * uCurrFontHeght + 13; + for ( i = 0; i < 5; ++i ) + { + skill_id = pArmorSkills[i]; + if ( curr_player->pActiveSkills[skill_id] & 0x3F ) + { + current_Y+= uCurrFontHeght - 3; + ++buttons_count; + ++first_rows; + pGUIWindow_CurrentMenu->CreateButton(246, current_Y, 204, uCurrFontHeght - 3, 3, skill_id | 0x8000, UIMSG_SkillUp, skill_id, 0, "", 0, 0); + } + } + if ( !first_rows ) + current_Y += uCurrFontHeght - 3; + current_Y += 2 * uCurrFontHeght - 6; + for ( i = 0; i < 12; ++i ) + { + skill_id = pMiscSkills[i]; + if ( curr_player->pActiveSkills[skill_id] & 0x3F ) + { + current_Y += uCurrFontHeght - 3; + ++buttons_count; + pGUIWindow_CurrentMenu->CreateButton(246, current_Y, 204, uCurrFontHeght - 3, 3, skill_id | 0x8000, UIMSG_SkillUp, skill_id, 0, "", 0, 0); + } + } - if ( buttons_count ) - pGUIWindow_CurrentMenu->_41D08F_set_keyboard_control_group(buttons_count, 1, 0, pGUIWindow_CurrentMenu->uNumControls); - } - - + if ( buttons_count ) + pGUIWindow_CurrentMenu->_41D08F_set_keyboard_control_group(buttons_count, 1, 0, pGUIWindow_CurrentMenu->uNumControls); +} //----- (00418511) -------------------------------------------------------- - void CharacterUI_StatsTab_Draw( Player *player ) - { - //Player *pPlayer; // edi@1 - //unsigned int v4; // eax@2 - int v7; // ebp@4 - int v8; // eax@4 - unsigned int v9; // eax@4 - int v10; // ST34_4@4 - int v13; // ebp@4 - int v14; // eax@4 - unsigned int v15; // eax@4 - int v19; // ebp@4 - int v20; // eax@4 - unsigned int v21; // eax@4 - int v25; // ebp@4 - int v26; // eax@4 - unsigned int v27; // eax@4 - int v31; // ebp@4 - int v32; // eax@4 - unsigned int v33; // eax@4 - int v37; // ebp@4 - int v38; // eax@4 - unsigned int v39; // eax@4 - int v43; // ebp@4 - int v44; // eax@4 - unsigned int v45; // eax@4 - signed int v49; // eax@6 - unsigned int v50; // eax@6 - int v53; // eax@8 - unsigned int v54; // eax@8 - int v58; // ebp@8 - int v59; // eax@8 - unsigned int v60; // eax@8 - unsigned int v62; // eax@8 - signed int v64; // eax@8 - //unsigned __int8 v66; // al@8 - char *v67; // eax@9 - signed int v70; // ebp@11 - signed int v71; // eax@11 - unsigned int v72; // eax@11 - int v75; // ebp@13 - int v76; // eax@13 - unsigned int v77; // eax@13 - char *v78; // ecx@14 - unsigned int v81; // eax@16 - int v83; // eax@16 - char *v85; // eax@16 - int v87; // eax@16 - char *v89; // eax@16 - int v90; // eax@16 - unsigned int v92; // eax@19 - int v93; // eax@19 - unsigned int v95; // eax@22 - int v96; // eax@22 - unsigned int v98; // eax@25 - int v99; // eax@25 - unsigned int v101; // eax@27 - int v102; // eax@27 - unsigned int v104; // eax@30 - unsigned int v106; // eax@32 - int v107; // eax@33 - unsigned int v109; // eax@36 - unsigned int v111; // eax@38 - const char *a2; // [sp+14h] [bp-Ch]@4 - const char *a2a; // [sp+14h] [bp-Ch]@6 - const char *a2b; // [sp+14h] [bp-Ch]@11 - const char *a2c; // [sp+14h] [bp-Ch]@16 - const char *a2d; // [sp+14h] [bp-Ch]@19 - const char *a2e; // [sp+14h] [bp-Ch]@22 - const char *a2f; // [sp+14h] [bp-Ch]@25 - const char *a2g; // [sp+14h] [bp-Ch]@27 - const char *a2h; // [sp+14h] [bp-Ch]@33 - int v131; // [sp+18h] [bp-8h]@16 - int v132; // [sp+18h] [bp-8h]@19 - int v133; // [sp+18h] [bp-8h]@22 - int v134; // [sp+18h] [bp-8h]@25 - int v135; // [sp+18h] [bp-8h]@27 - int v136; // [sp+18h] [bp-8h]@33 +void CharacterUI_StatsTab_Draw( Player *player ) +{ + int pY; // ST34_4@4 + char *pText; // eax@9 + const char *a2; // [sp+14h] [bp-Ch]@4 - //pPlayer = &pParty->pPlayers[uPlayerID-1]; - //pPlayer = player; pRenderer->DrawTextureIndexed(8, 8, pIcons_LOD->LoadTexturePtr("fr_stats", TEXTURE_16BIT_PALETTE)); sprintf(pTmpBuf.data(), "\f%05d", ui_character_header_text_color); sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[429], player->pName, pClassNames[player->classType]);//"^Pi[%s] %s" / "%s the %s" @@ -2106,358 +2009,336 @@ strcat(pTmpBuf.data(), pTmpBuf2.data()); pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, 18, 0, pTmpBuf.data(), 0, 0, 0); - v10 = 53; - v7 = player->GetBaseStrength(); - v8 = player->GetActualMight(); - v9 = UI_GetHealthManaStringColor(v8, v7); - sprintf(pTmpBuf.data(), "%s\f%05u\r424%d\f00000 /\t185%d\n", pGlobalTXT_LocalizationStrings[144], v9, v8, v7);//Might - pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v10, 0, pTmpBuf.data(), 0, 0, 0); + //First column( ) + pY = 53; + sprintf(pTmpBuf.data(), "%s\f%05u\r424%d\f00000 /\t185%d\n", pGlobalTXT_LocalizationStrings[144], + UI_GetHealthManaStringColor(player->GetActualMight(), player->GetBaseStrength()), + player->GetActualMight(), player->GetBaseStrength());//Might + pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, pY, 0, pTmpBuf.data(), 0, 0, 0); - v10 += LOBYTE(pFontArrus->uFontHeight) - 2; - v13 = player->GetBaseIntelligence(); - v14 = player->GetActualIntelligence(); - v15 = UI_GetHealthManaStringColor(v14, v13); - sprintf(pTmpBuf.data(), "%s\f%05u\r424%d\f00000 /\t185%d\n", pGlobalTXT_LocalizationStrings[116], v15, v14, v13);//Intellect - pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v10, 0, pTmpBuf.data(), 0, 0, 0); + pY += LOBYTE(pFontArrus->uFontHeight) - 2; + sprintf(pTmpBuf.data(), "%s\f%05u\r424%d\f00000 /\t185%d\n", pGlobalTXT_LocalizationStrings[116], + UI_GetHealthManaStringColor(player->GetActualIntelligence(), player->GetBaseIntelligence()), + player->GetActualIntelligence(), player->GetBaseIntelligence());//Intellect + pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, pY, 0, pTmpBuf.data(), 0, 0, 0); - v10 += LOBYTE(pFontArrus->uFontHeight) - 2; - v19 = player->GetBaseWillpower(); - v20 = player->GetActualWillpower(); - v21 = UI_GetHealthManaStringColor(v20, v19); - sprintf(pTmpBuf.data(), "%s\f%05u\r424%d\f00000 /\t185%d\n", pGlobalTXT_LocalizationStrings[163], v21, v20, v19);// - pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v10, 0, pTmpBuf.data(), 0, 0, 0); + pY += LOBYTE(pFontArrus->uFontHeight) - 2; + sprintf(pTmpBuf.data(), "%s\f%05u\r424%d\f00000 /\t185%d\n", pGlobalTXT_LocalizationStrings[163], + UI_GetHealthManaStringColor(player->GetActualWillpower(), player->GetBaseWillpower()), + player->GetActualWillpower(), player->GetBaseWillpower());// + pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, pY, 0, pTmpBuf.data(), 0, 0, 0); - v10 += LOBYTE(pFontArrus->uFontHeight) - 2; - v25 = player->GetBaseEndurance(); - v26 = player->GetActualEndurance(); - v27 = UI_GetHealthManaStringColor(v26, v25); - sprintf(pTmpBuf.data(), "%s\f%05u\r424%d\f00000 /\t185%d\n", pGlobalTXT_LocalizationStrings[75], v27, v26, v25);// - pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v10, 0, pTmpBuf.data(), 0, 0, 0); + pY += LOBYTE(pFontArrus->uFontHeight) - 2; + sprintf(pTmpBuf.data(), "%s\f%05u\r424%d\f00000 /\t185%d\n", pGlobalTXT_LocalizationStrings[75], + UI_GetHealthManaStringColor(player->GetActualEndurance(), player->GetBaseEndurance()), + player->GetActualEndurance(), player->GetBaseEndurance());// + pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, pY, 0, pTmpBuf.data(), 0, 0, 0); + + pY += LOBYTE(pFontArrus->uFontHeight) - 2; + sprintf(pTmpBuf.data(), "%s\f%05u\r424%d\f00000 /\t185%d\n", pGlobalTXT_LocalizationStrings[1], + UI_GetHealthManaStringColor(player->GetActualAccuracy(), player->GetBaseAccuracy()), + player->GetActualAccuracy(), player->GetBaseAccuracy()); + pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, pY, 0, pTmpBuf.data(), 0, 0, 0); - v10 += LOBYTE(pFontArrus->uFontHeight) - 2; - v31 = player->GetBaseAccuracy(); - v32 = player->GetActualAccuracy(); - v33 = UI_GetHealthManaStringColor(v32, v31); - sprintf(pTmpBuf.data(), "%s\f%05u\r424%d\f00000 /\t185%d\n", pGlobalTXT_LocalizationStrings[1], v33, v32, v31); - pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v10, 0, pTmpBuf.data(), 0, 0, 0); + pY += LOBYTE(pFontArrus->uFontHeight) - 2; + sprintf(pTmpBuf.data(), "%s\f%05u\r424%d\f00000 /\t185%d\n", pGlobalTXT_LocalizationStrings[211], + UI_GetHealthManaStringColor(player->GetActualSpeed(), player->GetBaseSpeed()), + player->GetActualSpeed(), player->GetBaseSpeed()); + pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, pY, 0, pTmpBuf.data(), 0, 0, 0); - v10 += LOBYTE(pFontArrus->uFontHeight) - 2; - v37 = player->GetBaseSpeed(); - v38 = player->GetActualSpeed(); - v39 = UI_GetHealthManaStringColor(v38, v37); - sprintf(pTmpBuf.data(), "%s\f%05u\r424%d\f00000 /\t185%d\n", pGlobalTXT_LocalizationStrings[211], v39, v38, v37); - pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v10, 0, pTmpBuf.data(), 0, 0, 0); + pY += LOBYTE(pFontArrus->uFontHeight) - 2; + sprintf(pTmpBuf.data(), "%s\f%05u\r424%d\f00000 /\t185%d\n\n", pGlobalTXT_LocalizationStrings[136], + UI_GetHealthManaStringColor(player->GetActualLuck(), player->GetBaseLuck()), + player->GetActualLuck(), player->GetBaseLuck()); + pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, pY, 0, pTmpBuf.data(), 0, 0, 0); - v10 += LOBYTE(pFontArrus->uFontHeight) - 2; - v43 = player->GetBaseLuck(); - v44 = player->GetActualLuck(); - v45 = UI_GetHealthManaStringColor(v44, v43); - sprintf(pTmpBuf.data(), "%s\f%05u\r424%d\f00000 /\t185%d\n\n", pGlobalTXT_LocalizationStrings[136], v45, v44, v43); - pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v10, 0, pTmpBuf.data(), 0, 0, 0); + a2 = "%s\f%05u\r424%d\f00000 /\t185%d\n"; + if ( player->GetMaxHealth() >= 1000 ) + a2 = "%s\f%05u\r388%d\f00000 / %d\n"; + pY += 2 * LOBYTE(pFontArrus->uFontHeight) + 5; + sprintf(pTmpBuf.data(), a2, pGlobalTXT_LocalizationStrings[108], + UI_GetHealthManaStringColor(player->sHealth, player->GetMaxHealth()), + player->sHealth, player->GetMaxHealth()); + pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, pY, 0, pTmpBuf.data(), 0, 0, 0); - a2 = "%s\f%05u\r424%d\f00000 /\t185%d\n"; - v10 += 2 * LOBYTE(pFontArrus->uFontHeight) + 5; - if ( player->GetMaxHealth() >= 1000 ) - a2 = "%s\f%05u\r388%d\f00000 / %d\n"; - v49 = player->GetMaxHealth(); - v50 = UI_GetHealthManaStringColor(player->sHealth, v49); - sprintf(pTmpBuf.data(), a2, pGlobalTXT_LocalizationStrings[108], v50, player->sHealth, v49); - pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v10, 0, pTmpBuf.data(), 0, 0, 0); - - a2a = "%s\f%05u\r424%d\f00000 /\t185%d\n"; - v10 += LOBYTE(pFontArrus->uFontHeight) - 2; - if ( player->GetMaxMana() >= 1000 ) - a2a = "%s\f%05u\r388%d\f00000 / %d\n"; - v53 = player->GetMaxMana(); - v54 = UI_GetHealthManaStringColor(player->sMana, v53); - sprintf(pTmpBuf.data(), a2a, pGlobalTXT_LocalizationStrings[212], v54, player->sMana, v53); - pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v10, 0, pTmpBuf.data(), 0, 0, 0); + a2 = "%s\f%05u\r424%d\f00000 /\t185%d\n"; + if ( player->GetMaxMana() >= 1000 ) + a2 = "%s\f%05u\r388%d\f00000 / %d\n"; + pY += LOBYTE(pFontArrus->uFontHeight) - 2; + sprintf(pTmpBuf.data(), a2, pGlobalTXT_LocalizationStrings[212], + UI_GetHealthManaStringColor(player->sMana, player->GetMaxMana()), + player->sMana, player->GetMaxMana()); + pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, pY, 0, pTmpBuf.data(), 0, 0, 0); - v10 += LOBYTE(pFontArrus->uFontHeight) - 2; - v58 = player->GetBaseAC(); - v59 = player->GetActualAC(); - v60 = UI_GetHealthManaStringColor(v59, v58); - sprintf(pTmpBuf.data(), "%s\f%05u\r424%d\f00000 /\t185%d\n\n", pGlobalTXT_LocalizationStrings[12], v60, v59, v58); - pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v10, 0, pTmpBuf.data(), 0, 0, 0); + pY += LOBYTE(pFontArrus->uFontHeight) - 2; + sprintf(pTmpBuf.data(), "%s\f%05u\r424%d\f00000 /\t185%d\n\n", pGlobalTXT_LocalizationStrings[12], + UI_GetHealthManaStringColor(player->GetActualAC(), player->GetBaseAC()), + player->GetActualAC(), player->GetBaseAC()); + pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, pY, 0, pTmpBuf.data(), 0, 0, 0); - v10 += 2 * LOBYTE(pFontArrus->uFontHeight) - 2; - v62 = player->GetMajorConditionIdx(); - v64 = GetConditionDrawColor(v62); - sprintf(pTmpBuf.data(), "%s: \f%05d%s\n", pGlobalTXT_LocalizationStrings[47], v64, aCharacterConditionNames[v62]); - pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x1Au, v10, 0, pTmpBuf.data(), 226, 0); + pY += 2 * LOBYTE(pFontArrus->uFontHeight) - 2; + sprintf(pTmpBuf.data(), "%s: \f%05d%s\n", pGlobalTXT_LocalizationStrings[47], GetConditionDrawColor(player->GetMajorConditionIdx()), + aCharacterConditionNames[player->GetMajorConditionIdx()]);// + pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 26, pY, 0, pTmpBuf.data(), 226, 0); - v10 += LOBYTE(pFontArrus->uFontHeight) + - 1; - if (player->uQuickSpell) - v67 = pSpellStats->pInfos[player->uQuickSpell].pShortName; - else - v67 = pGlobalTXT_LocalizationStrings[153]; - sprintf(pTmpBuf.data(), "%s: %s", pGlobalTXT_LocalizationStrings[172], v67); - pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x1Au, v10, 0, pTmpBuf.data(), 226, 0); + pY += LOBYTE(pFontArrus->uFontHeight) + - 1; + pText = pGlobalTXT_LocalizationStrings[153];// + if (player->uQuickSpell) + pText = pSpellStats->pInfos[player->uQuickSpell].pShortName; + sprintf(pTmpBuf.data(), "%s: %s", pGlobalTXT_LocalizationStrings[172], pText);//. + pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 26, pY, 0, pTmpBuf.data(), 226, 0); - v10 = 50; - v70 = player->GetBaseAge(); - v71 = player->GetActualAge(); - v72 = UI_GetHealthManaStringColor(v71, v70); - sprintf(pTmpBuf.data(), "%s\f%05u\t100%d\f00000 / %d\n", pGlobalTXT_LocalizationStrings[5], v72, v71, v70); - pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, v10, 0, pTmpBuf.data(), 0, 0, 0); + //Second column ( ) + pY = 50; + sprintf(pTmpBuf.data(), "%s\f%05u\t100%d\f00000 / %d\n", pGlobalTXT_LocalizationStrings[5], + UI_GetHealthManaStringColor(player->GetActualAge(), player->GetBaseAge()), + player->GetActualAge(), player->GetBaseAge()); + pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, pY, 0, pTmpBuf.data(), 0, 0, 0); - a2b = "%s\f%05u\t100%d\f00000 / %d\n"; - v10 += LOBYTE(pFontArrus->uFontHeight) - 2; - if ( player->GetBaseLevel() > 99 ) - a2b = "%s\f%05u\t180%d\f00000 / %d\n"; - v75 = player->GetBaseLevel(); - v76 = player->GetActualLevel(); - v77 = UI_GetHealthManaStringColor(v76, v75); - sprintf(pTmpBuf.data(), a2b, pGlobalTXT_LocalizationStrings[131], v77, v76, v75); - pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, v10, 0, pTmpBuf.data(), 0, 0, 0); + a2 = "%s\f%05u\t100%d\f00000 / %d\n"; + if ( player->GetBaseLevel() > 99 ) + a2 = "%s\f%05u\t180%d\f00000 / %d\n"; + pY += LOBYTE(pFontArrus->uFontHeight) - 2; + sprintf(pTmpBuf.data(), a2, pGlobalTXT_LocalizationStrings[131],//. + UI_GetHealthManaStringColor(player->GetActualLevel(), player->GetBaseLevel()), + player->GetActualLevel(), player->GetBaseLevel()); + pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, pY, 0, pTmpBuf.data(), 0, 0, 0); - v10 += LOBYTE(pFontArrus->uFontHeight) - 2; - if (player->uExperience <= 9999999) - v78 = pGlobalTXT_LocalizationStrings[83]; // "Experience" - else - v78 = pGlobalTXT_LocalizationStrings[17]; // "Exp." - v81 = player->GetExperienceDisplayColor(); - sprintf(pTmpBuf.data(), "%s\r180\f%05d%lu\f00000\n\n", v78, v81, LODWORD(player->uExperience)); - pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, v10, 0, pTmpBuf.data(), 0, 0, 0); + pY += LOBYTE(pFontArrus->uFontHeight) - 2; + pText = pGlobalTXT_LocalizationStrings[17]; // "Exp." + if (player->uExperience <= 9999999) + pText = pGlobalTXT_LocalizationStrings[83]; // "Experience" + sprintf(pTmpBuf.data(), "%s\r180\f%05d%lu\f00000\n\n", pText, player->GetExperienceDisplayColor(), LODWORD(player->uExperience)); + pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, pY, 0, pTmpBuf.data(), 0, 0, 0); - v10 += 2 * LOBYTE(pFontArrus->uFontHeight); - v83 = player->GetActualAttack(0); - sprintf(pTmpBuf.data(), "%s\t100%+d\n", pGlobalTXT_LocalizationStrings[18], v83); - pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, v10, 0, pTmpBuf.data(), 0, 0, 0); + pY += 2 * LOBYTE(pFontArrus->uFontHeight); + sprintf(pTmpBuf.data(), "%s\t100%+d\n", pGlobalTXT_LocalizationStrings[18], player->GetActualAttack(0)); + pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, pY, 0, pTmpBuf.data(), 0, 0, 0); - v10 += LOBYTE(pFontArrus->uFontHeight) - 2; - v85 = player->GetMeleeDamageString(); - sprintf(pTmpBuf.data(), "%s\t100 %s\n", pGlobalTXT_LocalizationStrings[53], v85); - pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, v10, 0, pTmpBuf.data(), 0, 0, 0); + pY += LOBYTE(pFontArrus->uFontHeight) - 2; + sprintf(pTmpBuf.data(), "%s\t100 %s\n", pGlobalTXT_LocalizationStrings[53], player->GetMeleeDamageString()); + pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, pY, 0, pTmpBuf.data(), 0, 0, 0); - v10 += LOBYTE(pFontArrus->uFontHeight) - 2; - v87 = player->GetRangedAttack(); - sprintf(pTmpBuf.data(), "%s\t100%+d\n", pGlobalTXT_LocalizationStrings[203], v87); - pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, v10, 0, pTmpBuf.data(), 0, 0, 0); + pY += LOBYTE(pFontArrus->uFontHeight) - 2; + sprintf(pTmpBuf.data(), "%s\t100%+d\n", pGlobalTXT_LocalizationStrings[203], player->GetRangedAttack()); + pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, pY, 0, pTmpBuf.data(), 0, 0, 0); - v10 += LOBYTE(pFontArrus->uFontHeight) - 2; - v89 = player->GetRangedDamageString(); - sprintf(pTmpBuf.data(), "%s\t100 %s\n\n", pGlobalTXT_LocalizationStrings[53], v89); - pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, v10, 0, pTmpBuf.data(), 0, 0, 0); + pY += LOBYTE(pFontArrus->uFontHeight) - 2; + sprintf(pTmpBuf.data(), "%s\t100 %s\n\n", pGlobalTXT_LocalizationStrings[53], player->GetRangedDamageString()); + pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, pY, 0, pTmpBuf.data(), 0, 0, 0); - a2c = format_4E2E10; - v10 += 2 * LOBYTE(pFontArrus->uFontHeight) - 4; - v131 = player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_FIRE); - v90 = player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_FIRE); - if ( v131 > 99 || v90 > 99 ) - a2c = "%s\f%05u\t180%d\f00000 / %d\n"; - v92 = UI_GetHealthManaStringColor(v131, v90); - sprintf(pTmpBuf.data(), a2c, pGlobalTXT_LocalizationStrings[87], v92, v131, v90); - pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, v10, 0, pTmpBuf.data(), 0, 0, 0); + a2 = format_4E2E10; + if ( player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_FIRE) > 99 || player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_FIRE) > 99 ) + a2 = "%s\f%05u\t180%d\f00000 / %d\n"; + pY += 2 * LOBYTE(pFontArrus->uFontHeight) - 4; + sprintf(pTmpBuf.data(), a2, pGlobalTXT_LocalizationStrings[87], + UI_GetHealthManaStringColor(player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_FIRE), player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_FIRE)), + player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_FIRE), player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_FIRE)); + pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, pY, 0, pTmpBuf.data(), 0, 0, 0); - a2d = format_4E2E10; - v10 += LOBYTE(pFontArrus->uFontHeight) - 2; - v132 = player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_AIR); - v93 = player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_AIR); - if ( v132 > 99 || v93 > 99 ) - a2d = "%s\f%05u\t180%d\f00000 / %d\n"; - v95 = UI_GetHealthManaStringColor(v132, v93); - sprintf(pTmpBuf.data(), a2d, pGlobalTXT_LocalizationStrings[6], v95, v132, v93); - pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, v10, 0, pTmpBuf.data(), 0, 0, 0); + a2 = format_4E2E10; + if ( player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_AIR) > 99 || player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_AIR) > 99 ) + a2 = "%s\f%05u\t180%d\f00000 / %d\n"; + pY += LOBYTE(pFontArrus->uFontHeight) - 2; + sprintf(pTmpBuf.data(), a2, pGlobalTXT_LocalizationStrings[6], + UI_GetHealthManaStringColor(player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_AIR), player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_AIR)), + player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_AIR), player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_AIR)); + pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, pY, 0, pTmpBuf.data(), 0, 0, 0); - a2e = format_4E2E10; - v10 += LOBYTE(pFontArrus->uFontHeight) - 2; - v133 = player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_WATER); - v96 = player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_WATER); - if ( v133 > 99 || v96 > 99 ) - a2e = "%s\f%05u\t180%d\f00000 / %d\n"; - v98 = UI_GetHealthManaStringColor(v133, v96); - sprintf(pTmpBuf.data(), a2e, pGlobalTXT_LocalizationStrings[240], v98, v133, v96); - pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, v10, 0, pTmpBuf.data(), 0, 0, 0); - - a2f = format_4E2E10; - v10 += LOBYTE(pFontArrus->uFontHeight) - 2; - v134 = player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_EARTH); - v99 = player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_EARTH); - if ( v134 > 99 ) - a2f = "%s\f%05u\t180%d\f00000 / %d\n"; - v101 = UI_GetHealthManaStringColor(v134, v99); - sprintf(pTmpBuf.data(), a2f, pGlobalTXT_LocalizationStrings[70], v101, v134, v99); - pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, v10, 0, pTmpBuf.data(), 0, 0, 0); + a2 = format_4E2E10; + if ( player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_WATER) > 99 || player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_WATER) > 99 ) + a2 = "%s\f%05u\t180%d\f00000 / %d\n"; + pY += LOBYTE(pFontArrus->uFontHeight) - 2; + sprintf(pTmpBuf.data(), a2, pGlobalTXT_LocalizationStrings[240], + UI_GetHealthManaStringColor(player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_WATER), player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_WATER)), + player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_WATER), player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_WATER)); + pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, pY, 0, pTmpBuf.data(), 0, 0, 0); - a2g = format_4E2E10; - v10 += LOBYTE(pFontArrus->uFontHeight) - 2; - v135 = player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_MIND); - v102 = player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_MIND); - if ( v135 > 99 || v102 > 99 ) - a2g = "%s\f%05u\t180%d\f00000 / %d\n"; - v104 = UI_GetHealthManaStringColor(v135, v102); - sprintf(pTmpBuf.data(), a2g, pGlobalTXT_LocalizationStrings[142], v104, v135, v102); - if ( player->classType == PLAYER_CLASS_LICH && v102 == 200 ) - { - v106 = UI_GetHealthManaStringColor(v135, 200); - sprintf(pTmpBuf.data(), format_4E2E00, pGlobalTXT_LocalizationStrings[142], v106, pGlobalTXT_LocalizationStrings[625]); - } - pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, v10, 0, pTmpBuf.data(), 0, 0, 0); + a2 = format_4E2E10; + if ( player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_EARTH) > 99 ) + a2 = "%s\f%05u\t180%d\f00000 / %d\n"; + pY += LOBYTE(pFontArrus->uFontHeight) - 2; + sprintf(pTmpBuf.data(), a2, pGlobalTXT_LocalizationStrings[70], + UI_GetHealthManaStringColor(player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_EARTH), player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_EARTH)), + player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_EARTH), player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_EARTH)); + pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, pY, 0, pTmpBuf.data(), 0, 0, 0); - a2h = format_4E2E10; - v10 += LOBYTE(pFontArrus->uFontHeight) - 2; - v136 = player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_BODY); - v107 = player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_BODY); - if ( v136 > 99 || v107 > 99 ) - a2h = "%s\f%05u\t180%d\f00000 / %d\n"; - v109 = UI_GetHealthManaStringColor(v136, v107); - sprintf(pTmpBuf.data(), a2h, pGlobalTXT_LocalizationStrings[29], v109, v136, v107); - if ( player->classType == PLAYER_CLASS_LICH && v107 == 200 ) - { - v111 = UI_GetHealthManaStringColor(v136, 200); - sprintf(pTmpBuf.data(), format_4E2E00, pGlobalTXT_LocalizationStrings[29], v111, pGlobalTXT_LocalizationStrings[625]); - } - pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, v10, 0, pTmpBuf.data(), 0, 0, 0); + a2 = format_4E2E10; + if ( player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_MIND) > 99 || player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_MIND) > 99 ) + a2 = "%s\f%05u\t180%d\f00000 / %d\n"; + pY += LOBYTE(pFontArrus->uFontHeight) - 2; + sprintf(pTmpBuf.data(), a2, pGlobalTXT_LocalizationStrings[142], + UI_GetHealthManaStringColor(player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_MIND), player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_MIND)), + player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_MIND), player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_MIND)); + if ( player->classType == PLAYER_CLASS_LICH && player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_MIND) == 200 ) + sprintf(pTmpBuf.data(), format_4E2E00, pGlobalTXT_LocalizationStrings[142], + UI_GetHealthManaStringColor(player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_MIND), 200), pGlobalTXT_LocalizationStrings[625]); + pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, pY, 0, pTmpBuf.data(), 0, 0, 0); + + a2 = format_4E2E10; + if ( player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_BODY) > 99 || player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_BODY) > 99 ) + a2 = "%s\f%05u\t180%d\f00000 / %d\n"; + pY += LOBYTE(pFontArrus->uFontHeight) - 2; + sprintf(pTmpBuf.data(), a2, pGlobalTXT_LocalizationStrings[29], + UI_GetHealthManaStringColor(player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_BODY), player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_BODY)), + player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_BODY), player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_BODY)); + if ( player->classType == PLAYER_CLASS_LICH && player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_BODY) == 200 ) + sprintf(pTmpBuf.data(), format_4E2E00, pGlobalTXT_LocalizationStrings[29], + UI_GetHealthManaStringColor(player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_BODY), 200), pGlobalTXT_LocalizationStrings[625]); + pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, pY, 0, pTmpBuf.data(), 0, 0, 0); } -bool awardSort (int i,int j) { - if (pAwards[i].uPriority == 0) //none - { - return false; - } - else if (pAwards[j].uPriority == 0) - { - return true; - } - else if(pAwards[i].uPriority == 1) //fines,arena stuff,etc - { - return false; - } - else if(pAwards[j].uPriority == 1) - { - return true; - } - else if(pAwards[i].uPriority == 5) //joined guilds - { - return false; - } - else if(pAwards[j].uPriority == 5) - { - return true; - } - else - { - return (pAwards[i].uPriority<pAwards[j].uPriority); - } +bool awardSort (int i, int j) +{ + if (pAwards[i].uPriority == 0) //none + return false; + else if (pAwards[j].uPriority == 0) + return true; + else if(pAwards[i].uPriority == 1) //fines,arena stuff,etc + return false; + else if(pAwards[j].uPriority == 1) + return true; + else if(pAwards[i].uPriority == 5) //joined guilds + return false; + else if(pAwards[j].uPriority == 5) + return true; + else + return (pAwards[i].uPriority < pAwards[j].uPriority); } //----- (00419100) -------------------------------------------------------- void FillAwardsData() { - auto pPlayer = pPlayers[uActiveCharacter]; + Player* pPlayer = pPlayers[uActiveCharacter]; - memset(achieved_awards.data(), 0, 4000); - num_achieved_awards = 0; + memset(achieved_awards.data(), 0, 4000); + num_achieved_awards = 0; - memset(pTmpBuf2.data(), 0, 0x7D0u); - BtnDown_flag = 0; - BtnUp_flag = 0; - books_page_number = 0; - books_primary_item_per_page = 0; - for (int i = 0; i < 105; ++i) + memset(pTmpBuf2.data(), 0, 0x7D0u); + BtnDown_flag = 0; + BtnUp_flag = 0; + books_page_number = 0; + books_primary_item_per_page = 0; + for ( int i = 1; i < 105; ++i ) + { + if ( _449B57_test_bit(pPlayer->_achieved_awards_bits, i) && pAwards[i].pText ) + achieved_awards[num_achieved_awards++] = (AwardType)i; + } + full_num_items_in_book = num_achieved_awards; + num_achieved_awards = 0; + + //sort awards index + + if (full_num_items_in_book>0) + { + for (int i = 0; i< full_num_items_in_book; ++i) + achieved_awards[full_num_items_in_book+i] = (AwardType)(rand()%16); + for (int i = 1; i< full_num_items_in_book; ++i) + { + for (int j = i; j< full_num_items_in_book; ++j) + { + AwardType tmp; + if (pAwards[achieved_awards[j]].uPriority < pAwards[achieved_awards[i]].uPriority) { - if ( _449B57_test_bit(pPlayer->_guilds_member_bits, i) && pAwards[i].pText ) - { - achieved_awards[num_achieved_awards++] = (AwardType)i; - } + tmp= achieved_awards[j]; + achieved_awards[j] = achieved_awards[i]; + achieved_awards[i] = tmp; } - full_num_items_in_book = num_achieved_awards; - num_achieved_awards = 0; + } + } + } - //sort awards index - if (full_num_items_in_book > 0) - { - std::stable_sort(achieved_awards.begin(), achieved_awards.end(), awardSort); - } - } - + // if (full_num_items_in_book > 0) + /* { + std::stable_sort(achieved_awards.begin(), achieved_awards.end(), awardSort); + }*/ +} //----- (0043EF2B) -------------------------------------------------------- void WetsuitOn( unsigned int uPlayerID ) - { - CHARACTER_RACE player_race; // edi@2 - signed int player_sex; // eax@2 - int texture_num; // ecx@5 - char pContainer[20]; // [sp+4h] [bp-1Ch]@7 - - if ( uPlayerID> 0 ) - { - player_race = pPlayers[uPlayerID]->GetRace(); - player_sex = pPlayers[uPlayerID]->GetSexByVoice(); - if ( player_race == CHARACTER_RACE_DWARF ) - texture_num = (player_sex != 0) + 3; - else - texture_num = (player_sex != 0) + 1; - wsprintfA(pContainer, "pc23v%dBod", texture_num); - papredoll_dbods[uPlayerID - 1] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); - wsprintfA(pContainer, "pc23v%dlad", texture_num); - papredoll_dlads[uPlayerID - 1] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); - wsprintfA(pContainer, "pc23v%dlau", texture_num); - papredoll_dlaus[uPlayerID - 1] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); - wsprintfA(pContainer, "pc23v%drh", texture_num); - papredoll_drhs[uPlayerID - 1] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); - wsprintfA(pContainer, "pc23v%dlh", texture_num); - papredoll_dlhs[uPlayerID - 1] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); - wsprintfA(pContainer, "pc23v%dlhu", texture_num); - papredoll_dlhus[uPlayerID - 1] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); +{ + CHARACTER_RACE player_race; // edi@2 + signed int player_sex; // eax@2 + int texture_num; // ecx@5 + char pContainer[20]; // [sp+4h] [bp-1Ch]@7 - if ( pPlayers[uPlayerID]->uCurrentFace == 12 || pPlayers[uPlayerID]->uCurrentFace == 13 ) - papredoll_dbrds[pPlayers[uPlayerID]->uCurrentFace] = 0; + if ( uPlayerID> 0 ) + { + player_race = pPlayers[uPlayerID]->GetRace(); + player_sex = pPlayers[uPlayerID]->GetSexByVoice(); + if ( player_race == CHARACTER_RACE_DWARF ) + texture_num = (player_sex != 0) + 3; + else + texture_num = (player_sex != 0) + 1; + wsprintfA(pContainer, "pc23v%dBod", texture_num); + papredoll_dbods[uPlayerID - 1] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + wsprintfA(pContainer, "pc23v%dlad", texture_num); + papredoll_dlads[uPlayerID - 1] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + wsprintfA(pContainer, "pc23v%dlau", texture_num); + papredoll_dlaus[uPlayerID - 1] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + wsprintfA(pContainer, "pc23v%drh", texture_num); + papredoll_drhs[uPlayerID - 1] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + wsprintfA(pContainer, "pc23v%dlh", texture_num); + papredoll_dlhs[uPlayerID - 1] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + wsprintfA(pContainer, "pc23v%dlhu", texture_num); + papredoll_dlhus[uPlayerID - 1] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); - papredoll_flying_feet[pPlayers[uPlayerID]->uCurrentFace] = 0; - IsPlayerWearingWatersuit[uPlayerID] = 1; - } - } + if ( pPlayers[uPlayerID]->uCurrentFace == 12 || pPlayers[uPlayerID]->uCurrentFace == 13 ) + papredoll_dbrds[pPlayers[uPlayerID]->uCurrentFace] = 0; + papredoll_flying_feet[pPlayers[uPlayerID]->uCurrentFace] = 0; + IsPlayerWearingWatersuit[uPlayerID] = 1; + } +} //----- (0043F0BD) -------------------------------------------------------- void WetsuitOff( unsigned int uPlayerID ) - { - char pContainer[20]; // [sp+0h] [bp-18h]@4 +{ + char pContainer[20]; // [sp+0h] [bp-18h]@4 - if (uPlayerID > 0 ) - { - papredoll_dbods[uPlayerID - 1] = pIcons_LOD->LoadTexture(dbod_texnames_by_face[pPlayers[uPlayerID]->uCurrentFace], TEXTURE_16BIT_PALETTE); - papredoll_dlads[uPlayerID - 1] = pIcons_LOD->LoadTexture(dlad_texnames_by_face[pPlayers[uPlayerID]->uCurrentFace], TEXTURE_16BIT_PALETTE); - papredoll_dlaus[uPlayerID - 1] = pIcons_LOD->LoadTexture(dlau_texnames_by_face[pPlayers[uPlayerID]->uCurrentFace], TEXTURE_16BIT_PALETTE); - papredoll_drhs [uPlayerID - 1] = pIcons_LOD->LoadTexture(drh_texnames_by_face [pPlayers[uPlayerID]->uCurrentFace], TEXTURE_16BIT_PALETTE); - papredoll_dlhs [uPlayerID - 1] = pIcons_LOD->LoadTexture(dlh_texnames_by_face [pPlayers[uPlayerID]->uCurrentFace], TEXTURE_16BIT_PALETTE); - papredoll_dlhus[uPlayerID - 1] = pIcons_LOD->LoadTexture(dlhu_texnames_by_face[pPlayers[uPlayerID]->uCurrentFace], TEXTURE_16BIT_PALETTE); + if (uPlayerID > 0 ) + { + papredoll_dbods[uPlayerID - 1] = pIcons_LOD->LoadTexture(dbod_texnames_by_face[pPlayers[uPlayerID]->uCurrentFace], TEXTURE_16BIT_PALETTE); + papredoll_dlads[uPlayerID - 1] = pIcons_LOD->LoadTexture(dlad_texnames_by_face[pPlayers[uPlayerID]->uCurrentFace], TEXTURE_16BIT_PALETTE); + papredoll_dlaus[uPlayerID - 1] = pIcons_LOD->LoadTexture(dlau_texnames_by_face[pPlayers[uPlayerID]->uCurrentFace], TEXTURE_16BIT_PALETTE); + papredoll_drhs [uPlayerID - 1] = pIcons_LOD->LoadTexture(drh_texnames_by_face [pPlayers[uPlayerID]->uCurrentFace], TEXTURE_16BIT_PALETTE); + papredoll_dlhs [uPlayerID - 1] = pIcons_LOD->LoadTexture(dlh_texnames_by_face [pPlayers[uPlayerID]->uCurrentFace], TEXTURE_16BIT_PALETTE); + papredoll_dlhus[uPlayerID - 1] = pIcons_LOD->LoadTexture(dlhu_texnames_by_face[pPlayers[uPlayerID]->uCurrentFace], TEXTURE_16BIT_PALETTE); - if ( pPlayers[uPlayerID]->uCurrentFace == 12 || pPlayers[uPlayerID]->uCurrentFace == 13 ) - { - wsprintfA(pContainer, "pc%02dbrd", pPlayers[uPlayerID]->uCurrentFace + 1); - papredoll_dbrds[pPlayers[uPlayerID]->uCurrentFace] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); - } - wsprintfA(pContainer, "item281pc%02d", pPlayers[uPlayerID]->uCurrentFace + 1); - papredoll_flying_feet[pPlayers[uPlayerID]->uCurrentFace] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); - IsPlayerWearingWatersuit[uPlayerID] = 0; - } + if ( pPlayers[uPlayerID]->uCurrentFace == 12 || pPlayers[uPlayerID]->uCurrentFace == 13 ) + { + wsprintfA(pContainer, "pc%02dbrd", pPlayers[uPlayerID]->uCurrentFace + 1); + papredoll_dbrds[pPlayers[uPlayerID]->uCurrentFace] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); } + wsprintfA(pContainer, "item281pc%02d", pPlayers[uPlayerID]->uCurrentFace + 1); + papredoll_flying_feet[pPlayers[uPlayerID]->uCurrentFace] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + IsPlayerWearingWatersuit[uPlayerID] = 0; + } +} + //----- (00468F8A) -------------------------------------------------------- -void __cdecl OnPaperdollLeftClick() +void OnPaperdollLeftClick() { int v1; // ecx@1 unsigned int v2; // edi@1 unsigned int v3; // edx@4 unsigned int pSkillType; // esi@5 unsigned __int16 v5; // ax@7 - unsigned int v6; // edi@19 + //unsigned int v6; // edi@19 int v7; // esi@27 int v8; // eax@29 - int v9; // edx@32 + //int v9; // edx@32 int v10; // esi@34 - int v11; // eax@34 + //int v11; // eax@34 int v12; // esi@38 - int v13; // eax@38 + //int v13; // eax@38 char v14; // zf@38 int v15; // esi@42 - int v16; // eax@42 + //int v16; // eax@42 int v17; // eax@44 unsigned int v18; // ecx@55 unsigned int v19; // eax@55 int v20; // esi@60 - int v21; // eax@60 + //int v21; // eax@60 unsigned int v22; // eax@61 int v23; // eax@62 int v24; // esi@65 @@ -2482,8 +2363,7 @@ unsigned int v50; // [sp+38h] [bp-14h]@50 int v51; // [sp+3Ch] [bp-10h]@1 int v52; // [sp+40h] [bp-Ch]@5 - //int v53; // [sp+44h] [bp-8h]@1 - //unsigned int v54; // [sp+48h] [bp-4h]@1 + ITEM_EQUIP_TYPE pEquipType; v51 = 0; _this.Reset(); @@ -2497,7 +2377,7 @@ v3 = pParty->pPickedItem.uItemID; if ( pParty->pPickedItem.uItemID ) { - v52 = pItemsTable->pItems[pParty->pPickedItem.uItemID].uEquipType; + pEquipType = pItemsTable->pItems[pParty->pPickedItem.uItemID].uEquipType; pSkillType = pItemsTable->pItems[pParty->pPickedItem.uItemID].uSkillType; if ( pSkillType == 4 ) { @@ -2538,60 +2418,57 @@ WetsuitOn(uActiveCharacter); return; } - v6 = v52; - switch ( v52 ) + //v6 = v52; + switch ( pEquipType ) { - case 2u: - case 3u: - case 5u: - case 6u: - case 7u: - case 8u: - case 9u: - case 0xBu: + case EQUIP_BOW: + case EQUIP_ARMOUR: + case EQUIP_HELMET: + case EQUIP_BELT: + case EQUIP_CLOAK: + case EQUIP_GAUNTLETS: + case EQUIP_BOOTS: + case EQUIP_AMULET: if ( !pPlayers[uActiveCharacter]->HasSkill(pSkillType) ) { pPlayers[uActiveCharacter]->PlaySound(SPEECH_39, 0); return; } - if ( sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(uActiveCharacter) && (v6 != 3 || bUnderwater) ) - { - pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0); - return; - } - pPlayers[uActiveCharacter]->EquipBody((ITEM_EQUIP_TYPE)v6); + if ( sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(uActiveCharacter) && (pEquipType != EQUIP_ARMOUR || bUnderwater) ) + { + pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0); + return; + } + pPlayers[uActiveCharacter]->EquipBody(pEquipType); if ( pParty->pPickedItem.uItemID == ITEM_WETSUIT ) WetsuitOff(uActiveCharacter); return; - case 0xAu: + + case EQUIP_RING:// if ( sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(uActiveCharacter) ) - { - pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0); - return; - } - v52 = 10; - v7 = (int)&pPlayers[uActiveCharacter]->pEquipment.uRings; - while ( 1 ) { - if ( !*(int *)v7 ) + pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0); + return; + } + // + v7 = 0; + for ( v52 = 10; (signed int)v52 < 16; ++v52 ) + { + if ( !pPlayers[uActiveCharacter]->pEquipment.uRings[v7] ) { v8 = pPlayers[uActiveCharacter]->FindFreeInventoryListSlot(); if ( v8 >= 0 ) - { - v9 = v52; - pParty->pPickedItem.uBodyAnchor = v52 + 1; - memcpy(&pPlayers[uActiveCharacter]->pInventoryItemList[v8], &pParty->pPickedItem, sizeof(pPlayers[uActiveCharacter]->pInventoryItemList[v8])); - *(&pPlayers[uActiveCharacter]->pEquipment.uShield + v9) = v8 + 1; - pMouse->RemoveHoldingItem(); + { + pParty->pPickedItem.uBodyAnchor = v52 + 1; + memcpy(&pPlayers[uActiveCharacter]->pInventoryItemList[v8], &pParty->pPickedItem, sizeof(pPlayers[uActiveCharacter]->pInventoryItemList[v8])); + pPlayers[uActiveCharacter]->pEquipment.uRings[v7] = v8 + 1; + pMouse->RemoveHoldingItem(); break; - } + } } - ++v52; - v7 += 4; - if ( (signed int)v52 > 15 ) - break; + v7++; } - if ( v52 == 16 ) + if ( v52 == 16 )// { v52 = pPlayers[uActiveCharacter]->pEquipment.uRings[6] - 1; memcpy(&_this, &pParty->pPickedItem, sizeof(_this)); @@ -2600,17 +2477,17 @@ pParty->pPickedItem.Reset(); pParty->SetHoldingItem((ItemGen *)(v10 + 532)); _this.uBodyAnchor = 16; - v11 = v52 + 1; memcpy((void *)(v10 + 532), &_this, 0x24u); - pPlayers[uActiveCharacter]->pEquipment.uRings[6] = v11; + pPlayers[uActiveCharacter]->pEquipment.uRings[6] = v52 + 1; } return; - case 4u: + + case EQUIP_SHIELD:// if ( sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(uActiveCharacter) ) - { - pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0); - return; - } + { + pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0); + return; + } if ( !pPlayers[uActiveCharacter]->HasSkill(pSkillType) ) { pPlayers[uActiveCharacter]->PlaySound(SPEECH_39, 0); @@ -2625,10 +2502,9 @@ pParty->pPickedItem.Reset(); pParty->SetHoldingItem((ItemGen *)(v12 + 532)); _this.uBodyAnchor = 1; - v13 = v2 + 1; v14 = v51 == 0; memcpy((void *)(v12 + 532), &_this, 0x24u); - pPlayers[uActiveCharacter]->pEquipment.uShield = v13; + pPlayers[uActiveCharacter]->pEquipment.uShield = v2 + 1; if ( v14 ) return; } @@ -2652,21 +2528,20 @@ pParty->pPickedItem.Reset(); pParty->SetHoldingItem((ItemGen *)(v15 + 532)); _this.uBodyAnchor = 1; - v16 = v52 + 1; memcpy(&pPlayers[uActiveCharacter]->pInventoryItemList[v52], &_this, sizeof(pPlayers[uActiveCharacter]->pInventoryItemList[v52])); - pPlayers[uActiveCharacter]->pEquipment.uShield = v16; + pPlayers[uActiveCharacter]->pEquipment.uShield = v52 + 1; } pPlayers[uActiveCharacter]->pEquipment.uMainHand = 0; return; - case 0u: - case 0xCu: + case EQUIP_OFF_HAND: + case EQUIP_WAND: if ( sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(uActiveCharacter) && pParty->pPickedItem.uItemID != 64 && pParty->pPickedItem.uItemID != 65 ) - { - pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0); - return; - } + { + pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0); + return; + } if ( !pPlayers[uActiveCharacter]->HasSkill(pSkillType) ) { pPlayers[uActiveCharacter]->PlaySound(SPEECH_39, 0); @@ -2676,10 +2551,8 @@ if ( pSkillType == 2 && (unsigned __int16)(pPlayers[uActiveCharacter]->pActiveSkills[2] & 0xFFC0) || pSkillType == 1 && (signed int)SkillToMastery(pPlayers[uActiveCharacter]->pActiveSkills[1]) >= 3 ) { - - v18 = pMouse->uMouseClickX; - v19 = pMouse->uMouseClickY; - + v18 = pMouse->uMouseClickX; + v19 = pMouse->uMouseClickY; v49 = v19; if ( (signed int)v18 >= 560 ) { @@ -2694,20 +2567,19 @@ pParty->pPickedItem.Reset(); pParty->SetHoldingItem((ItemGen *)(v20 + 532)); _this.uBodyAnchor = 1; - v21 = v2 + 1; - v14 = v52 == 12; + v14 = pEquipType == EQUIP_WAND; memcpy((void *)(v20 + 532), &_this, 0x24u); - pPlayers[uActiveCharacter]->pEquipment.uShield = v21; + pPlayers[uActiveCharacter]->pEquipment.uShield = v2 + 1; if ( !v14 ) return; v22 = _this.uItemID; v50 = v22; - if ( v50 ) + if ( v50 ) { __debugbreak(); // looks like offset in player's inventory and wand_lut much like case in 0042ECB5 - stru_A750F8[uActiveCharacter - 1]._494836(*((int *)&pSpellDatas[66].uNormalLevelRecovery + v50), uActiveCharacter - 1 + 9); + stru_A750F8[uActiveCharacter - 1]._494836(*((int *)&pSpellDatas[66].uNormalLevelRecovery + v50), uActiveCharacter - 1 + 9); } - break; + break; } v23 = pPlayers[uActiveCharacter]->FindFreeInventoryListSlot(); if ( v23 < 0 ) @@ -2717,16 +2589,16 @@ memcpy(&pPlayers[uActiveCharacter]->pInventoryItemList[v23], &pParty->pPickedItem, sizeof(pPlayers[uActiveCharacter]->pInventoryItemList[v23])); pPlayers[uActiveCharacter]->pEquipment.uShield = v23 + 1; pMouse->RemoveHoldingItem(); - if ( v52 != 12 ) + if ( pEquipType != 12 ) return; v22 = *(int *)v50; - v50 = v22; - if ( v50 ) + v50 = v22; + if ( v50 ) { __debugbreak(); // looks like offset in player's inventory and wand_lut much like case in 0042ECB5 - stru_A750F8[uActiveCharacter - 1]._494836(*((int *)&pSpellDatas[66].uNormalLevelRecovery + v50), uActiveCharacter - 1 + 9); + stru_A750F8[uActiveCharacter - 1]._494836(*((int *)&pSpellDatas[66].uNormalLevelRecovery + v50), uActiveCharacter - 1 + 9); } - break; + break; } } } @@ -2739,17 +2611,17 @@ v50 = (unsigned int)&pPlayers[uActiveCharacter]->pInventoryItemList[v26]; memcpy(&pPlayers[uActiveCharacter]->pInventoryItemList[v26], &pParty->pPickedItem, sizeof(pPlayers[uActiveCharacter]->pInventoryItemList[v26])); pPlayers[uActiveCharacter]->pEquipment.uMainHand = v26 + 1; - pMouse->RemoveHoldingItem(); - if ( v52 != 12 ) - return; - v22 = *(int *)v50; - v50 = v22; - if ( v50 ) - { - __debugbreak(); // looks like offset in player's inventory and wand_lut much like case in 0042ECB5 - stru_A750F8[uActiveCharacter - 1]._494836(*((int *)&pSpellDatas[66].uNormalLevelRecovery + v50), uActiveCharacter - 1 + 9); - } - break; + pMouse->RemoveHoldingItem(); + if ( pEquipType != 12 ) + return; + v22 = *(int *)v50; + v50 = v22; + if ( v50 ) + { + __debugbreak(); // looks like offset in player's inventory and wand_lut much like case in 0042ECB5 + stru_A750F8[uActiveCharacter - 1]._494836(*((int *)&pSpellDatas[66].uNormalLevelRecovery + v50), uActiveCharacter - 1 + 9); + } + break; } --v1; memcpy(&_this, &pParty->pPickedItem, sizeof(_this)); @@ -2759,7 +2631,7 @@ pParty->SetHoldingItem((ItemGen *)(v24 + 532)); _this.uBodyAnchor = 2; v25 = v1 + 1; - v14 = v52 == 12; + v14 = pEquipType == 12; memcpy((void *)(v24 + 532), &_this, 0x24u); pPlayers[uActiveCharacter]->pEquipment.uMainHand = v25; if ( v14 ) @@ -2772,7 +2644,7 @@ stru_A750F8[uActiveCharacter - 1]._494836( *((int *)&pSpellDatas[66].uNormalLevelRecovery + v50), uActiveCharacter - 1 + 9); } break; - case 1u: + case EQUIP_MAIN_HAND: if ( sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(uActiveCharacter) ) { pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0); @@ -2848,7 +2720,7 @@ v50 = v37; v38 = (ItemGen *)(v37 + 532); v14 = v38->uItemID == ITEM_WETSUIT; - v52 = pItemsTable->pItems[v38->uItemID].uEquipType; + pEquipType = pItemsTable->pItems[v38->uItemID].uEquipType; if ( v14 ) { if ( bUnderwater ) @@ -2862,7 +2734,7 @@ { *((char *)pGUIWindow_Settings->ptr_1C + 8) &= 0x7Fu; *((short *)pGUIWindow_Settings->ptr_1C + 2) = uActiveCharacter - 1; - v39 = v52; + v39 = pEquipType; *((int *)pGUIWindow_Settings->ptr_1C + 3) = v36; *((short *)pGUIWindow_Settings->ptr_1C + 3) = v39; ptr_50C9A4 = v38; @@ -2896,6 +2768,7 @@ } } } + //----- (004196A0) -------------------------------------------------------- void CharacterUI_ReleaseButtons() {