mirror of
https://github.com/whoahq/whoa.git
synced 2026-02-01 00:02:45 +03:00
feat(glue): implement CCharacterCreation::CalcClasses
This commit is contained in:
parent
94fcfef5c0
commit
f24a7596f7
@ -8,12 +8,36 @@
|
||||
|
||||
CCharacterComponent* CCharacterCreation::s_character;
|
||||
CSimpleModelFFX* CCharacterCreation::s_charCustomizeFrame;
|
||||
TSFixedArray<const ChrClassesRec*> CCharacterCreation::s_classes;
|
||||
int32_t CCharacterCreation::s_existingCharacterIndex;
|
||||
int32_t CCharacterCreation::s_raceIndex;
|
||||
int32_t CCharacterCreation::s_selectedClassID;
|
||||
|
||||
void CCharacterCreation::CalcClasses(int32_t raceID) {
|
||||
// TODO
|
||||
uint32_t classCount = 0;
|
||||
|
||||
for (int32_t i = 0; i < g_charBaseInfoDB.GetNumRecords(); i++) {
|
||||
auto infoRec = g_charBaseInfoDB.GetRecord(i);
|
||||
|
||||
if (infoRec->m_raceID == raceID) {
|
||||
classCount++;
|
||||
}
|
||||
}
|
||||
|
||||
CCharacterCreation::s_classes.SetCount(classCount);
|
||||
|
||||
uint32_t classIndex = 0;
|
||||
|
||||
for (int32_t i = 0; i < g_charBaseInfoDB.GetNumRecords(); i++) {
|
||||
auto infoRec = g_charBaseInfoDB.GetRecord(i);
|
||||
|
||||
if (infoRec->m_raceID != raceID) {
|
||||
continue;
|
||||
}
|
||||
|
||||
auto classRec = g_chrClassesDB.GetRecord(infoRec->m_classID);
|
||||
CCharacterCreation::s_classes[classIndex++] = classRec;
|
||||
}
|
||||
}
|
||||
|
||||
void CCharacterCreation::CreateComponent(ComponentData* data, bool randomize) {
|
||||
|
||||
@ -1,8 +1,10 @@
|
||||
#ifndef GLUE_C_CHARACTER_CREATION_HPP
|
||||
#define GLUE_C_CHARACTER_CREATION_HPP
|
||||
|
||||
#include <storm/Array.hpp>
|
||||
#include <cstdint>
|
||||
|
||||
class ChrClassesRec;
|
||||
class CCharacterComponent;
|
||||
class CSimpleModelFFX;
|
||||
struct ComponentData;
|
||||
@ -12,6 +14,7 @@ class CCharacterCreation {
|
||||
// Static variables
|
||||
static CCharacterComponent* s_character;
|
||||
static CSimpleModelFFX* s_charCustomizeFrame;
|
||||
static TSFixedArray<const ChrClassesRec*> s_classes;
|
||||
static int32_t s_existingCharacterIndex;
|
||||
static int32_t s_raceIndex;
|
||||
static int32_t s_selectedClassID;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user