mirror of
https://github.com/whoahq/whoa.git
synced 2026-11-27 16:22:32 +03:00
feat(glue): implement CCharacterCreation::CalcClasses
This commit is contained in:
2 files changed
+28
-1
No files matched your search
@@ -8,12 +8,36 @@
|
|||||||
|
|
||||||
CCharacterComponent* CCharacterCreation::s_character;
|
CCharacterComponent* CCharacterCreation::s_character;
|
||||||
CSimpleModelFFX* CCharacterCreation::s_charCustomizeFrame;
|
CSimpleModelFFX* CCharacterCreation::s_charCustomizeFrame;
|
||||||
|
TSFixedArray<const ChrClassesRec*> CCharacterCreation::s_classes;
|
||||||
int32_t CCharacterCreation::s_existingCharacterIndex;
|
int32_t CCharacterCreation::s_existingCharacterIndex;
|
||||||
int32_t CCharacterCreation::s_raceIndex;
|
int32_t CCharacterCreation::s_raceIndex;
|
||||||
int32_t CCharacterCreation::s_selectedClassID;
|
int32_t CCharacterCreation::s_selectedClassID;
|
||||||
|
|
||||||
void CCharacterCreation::CalcClasses(int32_t raceID) {
|
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) {
|
void CCharacterCreation::CreateComponent(ComponentData* data, bool randomize) {
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
#ifndef GLUE_C_CHARACTER_CREATION_HPP
|
#ifndef GLUE_C_CHARACTER_CREATION_HPP
|
||||||
#define GLUE_C_CHARACTER_CREATION_HPP
|
#define GLUE_C_CHARACTER_CREATION_HPP
|
||||||
|
|
||||||
|
#include <storm/Array.hpp>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
|
class ChrClassesRec;
|
||||||
class CCharacterComponent;
|
class CCharacterComponent;
|
||||||
class CSimpleModelFFX;
|
class CSimpleModelFFX;
|
||||||
struct ComponentData;
|
struct ComponentData;
|
||||||
@@ -12,6 +14,7 @@ class CCharacterCreation {
|
|||||||
// Static variables
|
// Static variables
|
||||||
static CCharacterComponent* s_character;
|
static CCharacterComponent* s_character;
|
||||||
static CSimpleModelFFX* s_charCustomizeFrame;
|
static CSimpleModelFFX* s_charCustomizeFrame;
|
||||||
|
static TSFixedArray<const ChrClassesRec*> s_classes;
|
||||||
static int32_t s_existingCharacterIndex;
|
static int32_t s_existingCharacterIndex;
|
||||||
static int32_t s_raceIndex;
|
static int32_t s_raceIndex;
|
||||||
static int32_t s_selectedClassID;
|
static int32_t s_selectedClassID;
|
||||||
|
|||||||
Reference in new issue
Block a user