mirror of
https://github.com/thunderbrewhq/thunderbrew
synced 2025-04-19 03:20:11 +03:00
feat(glue): initialize realm list
This commit is contained in:
parent
ef834d938e
commit
780de91468
@ -243,8 +243,7 @@ void CGlueMgr::Initialize() {
|
||||
|
||||
CGlueMgr::Resume();
|
||||
|
||||
// TODO
|
||||
// CRealmList::Initialize();
|
||||
CRealmList::Initialize();
|
||||
|
||||
EventRegisterEx(EVENT_ID_IDLE, &CGlueMgr::Idle, 0, 0.0);
|
||||
|
||||
|
@ -12,6 +12,7 @@ target_include_directories(glue
|
||||
target_link_libraries(glue
|
||||
PRIVATE
|
||||
client
|
||||
db
|
||||
event
|
||||
gx
|
||||
net
|
||||
|
@ -1,4 +1,23 @@
|
||||
#include "glue/CRealmList.hpp"
|
||||
#include "db/Db.hpp"
|
||||
#include <storm/Memory.hpp>
|
||||
|
||||
TSFixedArray<RealmCategory*> CRealmList::s_categories;
|
||||
|
||||
void CRealmList::Initialize() {
|
||||
CRealmList::s_categories.SetCount(g_cfg_CategoriesDB.m_numRecords);
|
||||
|
||||
for (int32_t i = 0; i < g_cfg_CategoriesDB.m_numRecords; i++) {
|
||||
auto m = SMemAlloc(sizeof(RealmCategory), __FILE__, __LINE__, 0x0);
|
||||
auto category = new (m) RealmCategory();
|
||||
|
||||
CRealmList::s_categories[i] = category;
|
||||
CRealmList::s_categories[i]->m_category = g_cfg_CategoriesDB.GetRecordByIndex(i);
|
||||
CRealmList::s_categories[i]->uint14 = 0;
|
||||
}
|
||||
|
||||
// TODO Initialize CRealmList::s_sortCriteria
|
||||
}
|
||||
|
||||
void CRealmList::UpdateList() {
|
||||
// TODO
|
||||
|
@ -1,9 +1,24 @@
|
||||
#ifndef GLUE_C_REALM_LIST_HPP
|
||||
#define GLUE_C_REALM_LIST_HPP
|
||||
|
||||
#include <cstdint>
|
||||
#include <storm/Array.hpp>
|
||||
|
||||
class Cfg_CategoriesRec;
|
||||
|
||||
struct RealmCategory {
|
||||
Cfg_CategoriesRec* m_category;
|
||||
TSGrowableArray<uint32_t> m_realms;
|
||||
uint32_t uint14;
|
||||
};
|
||||
|
||||
class CRealmList {
|
||||
public:
|
||||
// Static variables
|
||||
static TSFixedArray<RealmCategory*> s_categories;
|
||||
|
||||
// Static functions
|
||||
static void Initialize();
|
||||
static void UpdateList();
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user