mirror of
https://github.com/whoahq/whoa.git
synced 2026-02-01 08:12:44 +03:00
feat(component): add CCharacterComponent::AddItem
This commit is contained in:
parent
de3215afc9
commit
9b4e0cfded
@ -440,6 +440,62 @@ void CCharacterComponent::UpdateBaseTexture(EGxTexCommand cmd, uint32_t width, u
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CCharacterComponent::AddItem(ITEM_SLOT itemSlot, const ItemDisplayInfoRec* displayRec, int32_t a4) {
|
||||||
|
this->m_flags |= 0x4;
|
||||||
|
|
||||||
|
this->m_items[itemSlot] = displayRec->m_ID;
|
||||||
|
|
||||||
|
// Helm
|
||||||
|
|
||||||
|
if (itemSlot == ITEMSLOT_0) {
|
||||||
|
// TODO handle helm
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Shoulders
|
||||||
|
|
||||||
|
if (itemSlot == ITEMSLOT_1) {
|
||||||
|
// TODO handle shoulders
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Cape
|
||||||
|
|
||||||
|
if (itemSlot == ITEMSLOT_10) {
|
||||||
|
// TODO handle cape
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Unk
|
||||||
|
|
||||||
|
if (itemSlot == ITEMSLOT_11) {
|
||||||
|
// TODO handle unknown item
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (itemSlot == ITEMSLOT_3) {
|
||||||
|
// TODO flag manipulation
|
||||||
|
}
|
||||||
|
|
||||||
|
bool isNPC = this->m_data.flags & 0x1;
|
||||||
|
|
||||||
|
if (isNPC) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Items don't manipulate head component sections
|
||||||
|
|
||||||
|
for (int32_t section = SECTION_ARM_UPPER; section <= SECTION_FOOT; section++) {
|
||||||
|
if (*displayRec->m_texture[section] && s_itemPriority[itemSlot][section] != -1) {
|
||||||
|
(this->*CCharacterComponent::s_itemFunc[section])(itemSlot, displayRec, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
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;
|
||||||
|
|||||||
@ -70,8 +70,10 @@ class CCharacterComponent {
|
|||||||
HTEXTURE m_baseTexture = nullptr;
|
HTEXTURE m_baseTexture = nullptr;
|
||||||
void* m_texture[NUM_COMPONENT_VARIATIONS * 3] = {};
|
void* m_texture[NUM_COMPONENT_VARIATIONS * 3] = {};
|
||||||
ComponentItemDisplay m_itemDisplays[NUM_COMPONENT_SECTIONS] = {};
|
ComponentItemDisplay m_itemDisplays[NUM_COMPONENT_SECTIONS] = {};
|
||||||
|
int32_t m_items[NUM_ITEM_SLOT] = {};
|
||||||
|
|
||||||
// Member functions
|
// Member functions
|
||||||
|
void AddItem(ITEM_SLOT itemSlot, const ItemDisplayInfoRec* displayRec, 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