feat(component): partially implement CCharacterComponent::AddHandItem

This commit is contained in:
fallenoak 2025-11-02 23:34:35 -06:00
parent bb4824cb02
commit 9acffa737e
No known key found for this signature in database
GPG Key ID: 7628F8E61AEA070D
2 changed files with 25 additions and 2 deletions

View File

@ -99,7 +99,30 @@ CStatus s_status;
#define TEXTURE_INDEX(section, texture) (3 * section + texture) #define TEXTURE_INDEX(section, texture) (3 * section + texture)
void CCharacterComponent::AddHandItem(CM2Model* model, const ItemDisplayInfoRec* displayRec, INVENTORY_SLOTS invSlot, SHEATHE_TYPE sheatheType, bool a5, bool a6, bool a7, int32_t a8) { int32_t CCharacterComponent::AddHandItem(CM2Model* model, const ItemDisplayInfoRec* displayRec, INVENTORY_SLOTS invSlot, SHEATHE_TYPE sheatheType, bool a5, bool a6, bool a7, int32_t a8) {
// TODO
GEOCOMPONENTLINKS itemLink;
GEOCOMPONENTLINKS sheatheLink;
if (invSlot == INVSLOT_MAINHAND) {
itemLink = ATTACH_HANDR;
sheatheLink = CCharacterComponent::GetSheatheLink(sheatheType, true);
} else if (invSlot == INVSLOT_OFFHAND) {
itemLink = ATTACH_HANDL;
sheatheLink = CCharacterComponent::GetSheatheLink(sheatheType, false);
} else if (invSlot == INVSLOT_RANGED) {
if (a7) {
itemLink = ATTACH_HANDR;
sheatheLink = CCharacterComponent::GetSheatheLink(sheatheType, true);
} else {
itemLink = ATTACH_HANDL;
sheatheLink = CCharacterComponent::GetSheatheLink(sheatheType, false);
}
} else {
return -1;
}
// TODO // TODO
} }

View File

@ -47,7 +47,7 @@ class CCharacterComponent {
static uint32_t s_textureSize; static uint32_t s_textureSize;
// Static functions // Static functions
static void AddHandItem(CM2Model* model, const ItemDisplayInfoRec* displayRec, INVENTORY_SLOTS invSlot, SHEATHE_TYPE sheatheType, bool a5, bool a6, bool a7, int32_t a8); static int32_t AddHandItem(CM2Model* model, const ItemDisplayInfoRec* displayRec, INVENTORY_SLOTS invSlot, SHEATHE_TYPE sheatheType, bool a5, bool a6, bool a7, int32_t a8);
static CCharacterComponent* AllocComponent(); static CCharacterComponent* AllocComponent();
static HTEXTURE CreateTexture(const char* fileName, CStatus* status); static HTEXTURE CreateTexture(const char* fileName, CStatus* status);
static GEOCOMPONENTLINKS GetSheatheLink(SHEATHE_TYPE sheatheType, bool a2); static GEOCOMPONENTLINKS GetSheatheLink(SHEATHE_TYPE sheatheType, bool a2);