mirror of
https://github.com/whoahq/whoa.git
synced 2026-02-01 00:02:45 +03:00
feat(component): implement CCharacterComponent::SetHairColor
This commit is contained in:
parent
068b32435e
commit
ca58375aa4
@ -840,6 +840,10 @@ void CCharacterComponent::ReplaceExtraSkinTexture(const char* a2) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
void CCharacterComponent::ReplaceHairTexture(int32_t hairStyleID, const char* a3) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
void CCharacterComponent::SetFace(int32_t faceID, bool a3, const char* a4) {
|
||||
bool isNPC = this->m_data.flags & 0x1;
|
||||
|
||||
@ -876,7 +880,38 @@ void CCharacterComponent::SetFace(int32_t faceID, bool a3, const char* a4) {
|
||||
}
|
||||
|
||||
void CCharacterComponent::SetHairColor(int32_t hairColorID, bool a3, const char* a4) {
|
||||
// TODO
|
||||
if (!ComponentValidateBase(
|
||||
CCharacterComponent::s_chrVarArray,
|
||||
this->m_data.raceID,
|
||||
this->m_data.sexID,
|
||||
VARIATION_HAIR,
|
||||
this->m_data.hairStyleID,
|
||||
hairColorID
|
||||
)) {
|
||||
return;
|
||||
}
|
||||
|
||||
this->m_data.hairColorID = hairColorID;
|
||||
|
||||
auto raceRec = g_chrRacesDB.GetRecord(this->m_data.raceID);
|
||||
|
||||
if (this->m_data.sexID == UNITSEX_MALE && this->m_data.hairStyleID == 0 && raceRec->m_flags & 0x8) {
|
||||
this->ReplaceHairTexture(1, a4);
|
||||
}
|
||||
|
||||
this->ReplaceHairTexture(this->m_data.hairStyleID, a4);
|
||||
|
||||
bool isNPC = this->m_data.flags & 0x1;
|
||||
|
||||
if (!isNPC) {
|
||||
if (a3) {
|
||||
this->LoadBaseVariation(VARIATION_HAIR, 1, this->m_data.hairStyleID, this->m_data.hairColorID, SECTION_HEAD_LOWER, a4);
|
||||
this->LoadBaseVariation(VARIATION_HAIR, 2, this->m_data.hairStyleID, this->m_data.hairColorID, SECTION_HEAD_UPPER, a4);
|
||||
}
|
||||
|
||||
this->LoadBaseVariation(VARIATION_FACIAL_HAIR, 0, this->m_data.facialHairStyleID, this->m_data.hairColorID, SECTION_HEAD_LOWER, a4);
|
||||
this->LoadBaseVariation(VARIATION_FACIAL_HAIR, 1, this->m_data.facialHairStyleID, this->m_data.hairColorID, SECTION_HEAD_UPPER, a4);
|
||||
}
|
||||
}
|
||||
|
||||
void CCharacterComponent::SetHairStyle(int32_t hairStyleID, const char* a3) {
|
||||
|
||||
@ -87,6 +87,7 @@ class CCharacterComponent {
|
||||
void RenderPrepAll();
|
||||
void RenderPrepSections();
|
||||
void ReplaceExtraSkinTexture(const char* a2);
|
||||
void ReplaceHairTexture(int32_t hairStyleID, const char* a3);
|
||||
void SetFace(int32_t faceID, bool a3, const char* a4);
|
||||
void SetHairColor(int32_t hairColorID, bool a3, const char* a4);
|
||||
void SetHairStyle(int32_t hairStyleID, const char* a3);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user