mirror of
https://github.com/whoahq/whoa.git
synced 2026-02-01 16:22:45 +03:00
feat(component): add CCharacterComponent::AddItemBySlot
This commit is contained in:
parent
e6dba0a7c4
commit
daca438a62
@ -510,6 +510,63 @@ void CCharacterComponent::AddItem(ITEM_SLOT itemSlot, const ItemDisplayInfoRec*
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CCharacterComponent::AddItemBySlot(INVENTORY_SLOTS invSlot, int32_t displayID, int32_t a4) {
|
||||||
|
if (invSlot > EQUIPPED_LAST) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
STORM_ASSERT(displayID > 0);
|
||||||
|
|
||||||
|
switch (invSlot) {
|
||||||
|
case INVSLOT_HEAD:
|
||||||
|
this->AddItem(ITEMSLOT_0, displayID, a4);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case INVSLOT_SHOULDER:
|
||||||
|
this->AddItem(ITEMSLOT_1, displayID, a4);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case INVSLOT_BODY:
|
||||||
|
this->AddItem(ITEMSLOT_2, displayID, a4);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case INVSLOT_CHEST:
|
||||||
|
this->AddItem(ITEMSLOT_3, displayID, a4);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case INVSLOT_WAIST:
|
||||||
|
this->AddItem(ITEMSLOT_4, displayID, a4);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case INVSLOT_LEGS:
|
||||||
|
this->AddItem(ITEMSLOT_5, displayID, a4);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case INVSLOT_FEET:
|
||||||
|
this->AddItem(ITEMSLOT_6, displayID, a4);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case INVSLOT_WRIST:
|
||||||
|
this->AddItem(ITEMSLOT_7, displayID, a4);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case INVSLOT_HAND:
|
||||||
|
this->AddItem(ITEMSLOT_8, displayID, a4);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case INVSLOT_BACK:
|
||||||
|
this->AddItem(ITEMSLOT_10, displayID, a4);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case INVSLOT_TABARD:
|
||||||
|
this->AddItem(ITEMSLOT_9, displayID, a4);
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void CCharacterComponent::ClearItemDisplay(COMPONENT_SECTIONS section, int32_t priority) {
|
void CCharacterComponent::ClearItemDisplay(COMPONENT_SECTIONS section, int32_t priority) {
|
||||||
if (priority == -1) {
|
if (priority == -1) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
#include "component/Types.hpp"
|
#include "component/Types.hpp"
|
||||||
#include "gx/Texture.hpp"
|
#include "gx/Texture.hpp"
|
||||||
|
#include "object/Types.hpp"
|
||||||
#include <tempest/Vector.hpp>
|
#include <tempest/Vector.hpp>
|
||||||
|
|
||||||
class CACHEENTRY;
|
class CACHEENTRY;
|
||||||
@ -75,6 +76,7 @@ class CCharacterComponent {
|
|||||||
// Member functions
|
// Member functions
|
||||||
void AddItem(ITEM_SLOT itemSlot, int32_t displayID, int32_t a4);
|
void AddItem(ITEM_SLOT itemSlot, int32_t displayID, int32_t a4);
|
||||||
void AddItem(ITEM_SLOT itemSlot, const ItemDisplayInfoRec* displayRec, int32_t a4);
|
void AddItem(ITEM_SLOT itemSlot, const ItemDisplayInfoRec* displayRec, int32_t a4);
|
||||||
|
void AddItemBySlot(INVENTORY_SLOTS invSlot, int32_t displayID, int32_t a4);
|
||||||
void ClearItemDisplay(COMPONENT_SECTIONS section, int32_t priority);
|
void ClearItemDisplay(COMPONENT_SECTIONS section, int32_t priority);
|
||||||
void CreateBaseTexture();
|
void CreateBaseTexture();
|
||||||
void GeosRenderPrep();
|
void GeosRenderPrep();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user