add: hands to equip tab

10-use-item-shortcut-client
bensaine 3 years ago
parent 5676438aff
commit d6d0417419

@ -315,6 +315,8 @@ CInventoryManager::CInventoryManager()
{
Hands[i] = ServerHands[i] = 0;
UIHands[i] = NULL;
UIHands2[i] = NULL;
UIHands3[i] = NULL;
}
for (i = 0; i < MAX_EQUIPINV_ENTRIES; ++i)
@ -558,6 +560,9 @@ void CInventoryManager::init()
UIHotbar[3] = dynamic_cast<CDBCtrlSheet*>(CWidgetManager::getInstance()->getElementFromId(CTRL_HOTBAR_4));
UIHotbar[4] = dynamic_cast<CDBCtrlSheet*>(CWidgetManager::getInstance()->getElementFromId(CTRL_HOTBAR_5));
UIHands2[0] = dynamic_cast<CDBCtrlSheet*>(CWidgetManager::getInstance()->getElementFromId(CTRL_HAND2_RIGHT));
UIHands2[1] = dynamic_cast<CDBCtrlSheet*>(CWidgetManager::getInstance()->getElementFromId(CTRL_HAND2_LEFT));
UIEquip2[SLOT_EQUIPMENT::HEADDRESS] = dynamic_cast<CDBCtrlSheet*>(CWidgetManager::getInstance()->getElementFromId(CTRL_JEWL2_HEADDRESS));
UIEquip2[SLOT_EQUIPMENT::EARL] = dynamic_cast<CDBCtrlSheet*>(CWidgetManager::getInstance()->getElementFromId(CTRL_JEWL2_EARING_LEFT));
UIEquip2[SLOT_EQUIPMENT::EARR] = dynamic_cast<CDBCtrlSheet*>(CWidgetManager::getInstance()->getElementFromId(CTRL_JEWL2_EARING_RIGHT));
@ -582,6 +587,9 @@ void CInventoryManager::init()
UIHotbar2[3] = dynamic_cast<CDBCtrlSheet*>(CWidgetManager::getInstance()->getElementFromId(CTRL_HOTBAR2_4));
UIHotbar2[4] = dynamic_cast<CDBCtrlSheet*>(CWidgetManager::getInstance()->getElementFromId(CTRL_HOTBAR2_5));
UIHands3[0] = dynamic_cast<CDBCtrlSheet*>(CWidgetManager::getInstance()->getElementFromId(CTRL_HAND3_RIGHT));
UIHands3[1] = dynamic_cast<CDBCtrlSheet*>(CWidgetManager::getInstance()->getElementFromId(CTRL_HAND3_LEFT));
UIHotbar3[0] = dynamic_cast<CDBCtrlSheet*>(CWidgetManager::getInstance()->getElementFromId(CTRL_HOTBAR3_1));
UIHotbar3[1] = dynamic_cast<CDBCtrlSheet*>(CWidgetManager::getInstance()->getElementFromId(CTRL_HOTBAR3_2));
UIHotbar3[2] = dynamic_cast<CDBCtrlSheet*>(CWidgetManager::getInstance()->getElementFromId(CTRL_HOTBAR3_3));
@ -700,6 +708,14 @@ std::string CInventoryManager::getDBIndexPath(CDBCtrlSheet *pCS)
{
return string(LOCAL_INVENTORY) + ":HAND:" + toString(i);
}
if (UIHands2[i] == pCS)
{
return string(LOCAL_INVENTORY) + ":HAND:" + toString(i);
}
if (UIHands3[i] == pCS)
{
return string(LOCAL_INVENTORY) + ":HAND:" + toString(i);
}
}
for (i = 0; i < MAX_EQUIPINV_ENTRIES; ++i)
@ -1269,10 +1285,16 @@ void CInventoryManager::CDBEquipObs::update(ICDBNode* node)
sTmp = sTmp.substr(0,sTmp.rfind(':'));
sint index;
fromString(sTmp, index);
if (index == 0)
if (index == 0) {
sIE = CTRL_HAND_RIGHT;
else
sIE2 = CTRL_HAND2_RIGHT;
sIE3 = CTRL_HAND3_RIGHT;
}
else {
sIE = CTRL_HAND_LEFT;
sIE2 = CTRL_HAND2_LEFT;
sIE3 = CTRL_HAND3_LEFT;
}
// update Hands.
getInventory().Hands[index]= pNL->getValue16();
}

@ -340,6 +340,8 @@ private:
CItemImage TempInv[MAX_TEMPINV_ENTRIES];
sint32 Hands[MAX_HANDINV_ENTRIES];
CDBCtrlSheet *UIHands[MAX_HANDINV_ENTRIES];
CDBCtrlSheet *UIHands2[MAX_HANDINV_ENTRIES];
CDBCtrlSheet *UIHands3[MAX_HANDINV_ENTRIES];
sint32 Equip[MAX_EQUIPINV_ENTRIES];
CDBCtrlSheet *UIEquip[MAX_EQUIPINV_ENTRIES];
CDBCtrlSheet *UIEquip2[MAX_EQUIPINV_ENTRIES];
@ -871,8 +873,6 @@ private:
#define CTRL_HAND_RIGHT "ui:interface:gestionsets:hands:handr"
#define CTRL_HAND_LEFT "ui:interface:gestionsets:hands:handl"
#define CTRL_HAND_LEFT_2HAND "ui:interface:gestionsets:hands:handl_2h"
#define CTRL_HAND_LEFT_AMMO "ui:interface:gestionsets:hands:handl_ammo"
#define CTRL_JEWEL_EARING_LEFT "ui:interface:inv_equip:content:equip:jewelry:earing_l"
#define CTRL_JEWEL_BRACELET_LEFT "ui:interface:inv_equip:content:equip:jewelry:bracelet_l"
@ -898,6 +898,9 @@ private:
#define CTRL_HOTBAR_4 "ui:interface:inv_equip:content:equip:hotbar_c:hotbar:hotbar4"
#define CTRL_HOTBAR_5 "ui:interface:inv_equip:content:equip:hotbar_c:hotbar:hotbar5"
#define CTRL_HAND2_RIGHT "ui:interface:inv_equip:content:equip:hands:handr"
#define CTRL_HAND2_LEFT "ui:interface:inv_equip:content:equip:hands:handl"
#define CTRL_JEWL2_EARING_LEFT "ui:interface:inventory:content:equip:jewelry:earing_l"
#define CTRL_JEWL2_BRACELET_LEFT "ui:interface:inventory:content:equip:jewelry:bracelet_l"
#define CTRL_JEWL2_RING_LEFT "ui:interface:inventory:content:equip:jewelry:ring_l"
@ -922,6 +925,9 @@ private:
#define CTRL_HOTBAR2_4 "ui:interface:inventory:content:equip:hotbar_c:hotbar:hotbar4"
#define CTRL_HOTBAR2_5 "ui:interface:inventory:content:equip:hotbar_c:hotbar:hotbar5"
#define CTRL_HAND3_RIGHT "ui:interface:inventory:content:equip:hands:handr"
#define CTRL_HAND3_LEFT "ui:interface:inventory:content:equip:hands:handl"
#define CTRL_HOTBAR3_1 "ui:interface:inv_hotbar:content:hot:hotbar:hotbar1"
#define CTRL_HOTBAR3_2 "ui:interface:inv_hotbar:content:hot:hotbar:hotbar2"
#define CTRL_HOTBAR3_3 "ui:interface:inv_hotbar:content:hot:hotbar:hotbar3"

Loading…
Cancel
Save