From c6110b561ea7de5ac026d58f188fa917938dce86 Mon Sep 17 00:00:00 2001 From: fallenoak Date: Tue, 30 Dec 2025 14:56:51 -0600 Subject: [PATCH] feat(component): add CCharacterComponent::GetPreferences --- src/component/CCharacterComponent.cpp | 15 +++++++++++++++ src/component/CCharacterComponent.hpp | 1 + src/component/Types.hpp | 11 +++++++++++ 3 files changed, 27 insertions(+) diff --git a/src/component/CCharacterComponent.cpp b/src/component/CCharacterComponent.cpp index 65a99d1..83b1d53 100644 --- a/src/component/CCharacterComponent.cpp +++ b/src/component/CCharacterComponent.cpp @@ -1048,6 +1048,21 @@ void CCharacterComponent::GeosRenderPrep() { this->m_flags &= ~0x4; } +void CCharacterComponent::GetPreferences(CharacterPreferences* preferences) { + if (!preferences) { + return; + } + + preferences->raceID = this->m_data.raceID; + preferences->sexID = this->m_data.sexID; + preferences->classID = this->m_data.classID; + preferences->hairColorID = this->m_data.hairColorID; + preferences->skinColorID = this->m_data.skinColorID; + preferences->faceID = this->m_data.faceID; + preferences->facialHairStyleID = this->m_data.facialHairStyleID; + preferences->hairStyleID = this->m_data.hairStyleID; +} + CharSectionsRec* CCharacterComponent::GetSectionsRecord(COMPONENT_VARIATIONS sectionIndex, int32_t variationIndex, int32_t colorIndex, bool* found) { return ComponentGetSectionsRecord( CCharacterComponent::s_chrVarArray, diff --git a/src/component/CCharacterComponent.hpp b/src/component/CCharacterComponent.hpp index 5875c86..e6af43a 100644 --- a/src/component/CCharacterComponent.hpp +++ b/src/component/CCharacterComponent.hpp @@ -87,6 +87,7 @@ class CCharacterComponent { void CreateBaseTexture(); void* CreateTexture(const ItemDisplayInfoRec* displayRec, int32_t section); void GeosRenderPrep(); + void GetPreferences(CharacterPreferences* preferences); CharSectionsRec* GetSectionsRecord(COMPONENT_VARIATIONS sectionIndex, int32_t variationIndex, int32_t colorIndex, bool* found); int32_t Init(ComponentData* data, const char* a3); int32_t ItemsLoaded(int32_t a2); diff --git a/src/component/Types.hpp b/src/component/Types.hpp index 951ae43..0cd8e02 100644 --- a/src/component/Types.hpp +++ b/src/component/Types.hpp @@ -91,6 +91,17 @@ enum ITEM_SLOT { NUM_ITEM_SLOT }; +struct CharacterPreferences { + int32_t raceID; + int32_t sexID; + int32_t classID; + int32_t hairColorID; + int32_t skinColorID; + int32_t faceID; + int32_t facialHairStyleID; + int32_t hairStyleID; +}; + struct ComponentData { int32_t raceID = 0; int32_t sexID = 0;