mirror of
https://github.com/whoahq/whoa.git
synced 2026-02-01 16:22:45 +03:00
feat(db): add ItemDisplayInfoRec
This commit is contained in:
parent
7cc8da4ac1
commit
86f902423b
@ -12,6 +12,7 @@ WowClientDB<ChrClassesRec> g_chrClassesDB;
|
|||||||
WowClientDB<ChrRacesRec> g_chrRacesDB;
|
WowClientDB<ChrRacesRec> g_chrRacesDB;
|
||||||
WowClientDB<CreatureDisplayInfoRec> g_creatureDisplayInfoDB;
|
WowClientDB<CreatureDisplayInfoRec> g_creatureDisplayInfoDB;
|
||||||
WowClientDB<CreatureModelDataRec> g_creatureModelDataDB;
|
WowClientDB<CreatureModelDataRec> g_creatureModelDataDB;
|
||||||
|
WowClientDB<ItemDisplayInfoRec> g_itemDisplayInfoDB;
|
||||||
WowClientDB<MapRec> g_mapDB;
|
WowClientDB<MapRec> g_mapDB;
|
||||||
|
|
||||||
void LoadDB(WowClientDB_Base* db, const char* filename, int32_t linenumber) {
|
void LoadDB(WowClientDB_Base* db, const char* filename, int32_t linenumber) {
|
||||||
@ -30,6 +31,7 @@ void StaticDBLoadAll(void (*loadFn)(WowClientDB_Base*, const char*, int32_t)) {
|
|||||||
loadFn(&g_chrRacesDB, __FILE__, __LINE__);
|
loadFn(&g_chrRacesDB, __FILE__, __LINE__);
|
||||||
loadFn(&g_creatureDisplayInfoDB, __FILE__, __LINE__);
|
loadFn(&g_creatureDisplayInfoDB, __FILE__, __LINE__);
|
||||||
loadFn(&g_creatureModelDataDB, __FILE__, __LINE__);
|
loadFn(&g_creatureModelDataDB, __FILE__, __LINE__);
|
||||||
|
loadFn(&g_itemDisplayInfoDB, __FILE__, __LINE__);
|
||||||
loadFn(&g_mapDB, __FILE__, __LINE__);
|
loadFn(&g_mapDB, __FILE__, __LINE__);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -13,6 +13,7 @@
|
|||||||
#include "db/rec/ChrRacesRec.hpp"
|
#include "db/rec/ChrRacesRec.hpp"
|
||||||
#include "db/rec/CreatureDisplayInfoRec.hpp"
|
#include "db/rec/CreatureDisplayInfoRec.hpp"
|
||||||
#include "db/rec/CreatureModelDataRec.hpp"
|
#include "db/rec/CreatureModelDataRec.hpp"
|
||||||
|
#include "db/rec/ItemDisplayInfoRec.hpp"
|
||||||
#include "db/rec/MapRec.hpp"
|
#include "db/rec/MapRec.hpp"
|
||||||
|
|
||||||
extern WowClientDB<AchievementRec> g_achievementDB;
|
extern WowClientDB<AchievementRec> g_achievementDB;
|
||||||
@ -26,6 +27,7 @@ extern WowClientDB<ChrClassesRec> g_chrClassesDB;
|
|||||||
extern WowClientDB<ChrRacesRec> g_chrRacesDB;
|
extern WowClientDB<ChrRacesRec> g_chrRacesDB;
|
||||||
extern WowClientDB<CreatureDisplayInfoRec> g_creatureDisplayInfoDB;
|
extern WowClientDB<CreatureDisplayInfoRec> g_creatureDisplayInfoDB;
|
||||||
extern WowClientDB<CreatureModelDataRec> g_creatureModelDataDB;
|
extern WowClientDB<CreatureModelDataRec> g_creatureModelDataDB;
|
||||||
|
extern WowClientDB<ItemDisplayInfoRec> g_itemDisplayInfoDB;
|
||||||
extern WowClientDB<MapRec> g_mapDB;
|
extern WowClientDB<MapRec> g_mapDB;
|
||||||
|
|
||||||
void ClientDBInitialize();
|
void ClientDBInitialize();
|
||||||
|
|||||||
99
src/db/rec/ItemDisplayInfoRec.cpp
Normal file
99
src/db/rec/ItemDisplayInfoRec.cpp
Normal file
@ -0,0 +1,99 @@
|
|||||||
|
// DO NOT EDIT: generated by whoa-autocode
|
||||||
|
#include "db/rec/ItemDisplayInfoRec.hpp"
|
||||||
|
#include "util/Locale.hpp"
|
||||||
|
#include "util/SFile.hpp"
|
||||||
|
|
||||||
|
const char* ItemDisplayInfoRec::GetFilename() {
|
||||||
|
return "DBFilesClient\\ItemDisplayInfo.dbc";
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t ItemDisplayInfoRec::GetNumColumns() {
|
||||||
|
return 25;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t ItemDisplayInfoRec::GetRowSize() {
|
||||||
|
return 100;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ItemDisplayInfoRec::NeedIDAssigned() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t ItemDisplayInfoRec::GetID() {
|
||||||
|
return this->m_ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ItemDisplayInfoRec::SetID(int32_t id) {
|
||||||
|
this->m_ID = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ItemDisplayInfoRec::Read(SFile* f, const char* stringBuffer) {
|
||||||
|
uint32_t modelNameOfs[2];
|
||||||
|
uint32_t modelTextureOfs[2];
|
||||||
|
uint32_t inventoryIconOfs[2];
|
||||||
|
uint32_t textureOfs[8];
|
||||||
|
|
||||||
|
if (
|
||||||
|
!SFile::Read(f, &this->m_ID, sizeof(this->m_ID), nullptr, nullptr, nullptr)
|
||||||
|
|| !SFile::Read(f, &modelNameOfs[0], sizeof(uint32_t), nullptr, nullptr, nullptr)
|
||||||
|
|| !SFile::Read(f, &modelNameOfs[1], sizeof(uint32_t), nullptr, nullptr, nullptr)
|
||||||
|
|| !SFile::Read(f, &modelTextureOfs[0], sizeof(uint32_t), nullptr, nullptr, nullptr)
|
||||||
|
|| !SFile::Read(f, &modelTextureOfs[1], sizeof(uint32_t), nullptr, nullptr, nullptr)
|
||||||
|
|| !SFile::Read(f, &inventoryIconOfs[0], sizeof(uint32_t), nullptr, nullptr, nullptr)
|
||||||
|
|| !SFile::Read(f, &inventoryIconOfs[1], sizeof(uint32_t), nullptr, nullptr, nullptr)
|
||||||
|
|| !SFile::Read(f, &this->m_geosetGroup[0], sizeof(m_geosetGroup[0]), nullptr, nullptr, nullptr)
|
||||||
|
|| !SFile::Read(f, &this->m_geosetGroup[1], sizeof(m_geosetGroup[0]), nullptr, nullptr, nullptr)
|
||||||
|
|| !SFile::Read(f, &this->m_geosetGroup[2], sizeof(m_geosetGroup[0]), nullptr, nullptr, nullptr)
|
||||||
|
|| !SFile::Read(f, &this->m_flags, sizeof(this->m_flags), nullptr, nullptr, nullptr)
|
||||||
|
|| !SFile::Read(f, &this->m_spellVisualID, sizeof(this->m_spellVisualID), nullptr, nullptr, nullptr)
|
||||||
|
|| !SFile::Read(f, &this->m_groupSoundIndex, sizeof(this->m_groupSoundIndex), nullptr, nullptr, nullptr)
|
||||||
|
|| !SFile::Read(f, &this->m_helmetGeosetVisID[0], sizeof(m_helmetGeosetVisID[0]), nullptr, nullptr, nullptr)
|
||||||
|
|| !SFile::Read(f, &this->m_helmetGeosetVisID[1], sizeof(m_helmetGeosetVisID[0]), nullptr, nullptr, nullptr)
|
||||||
|
|| !SFile::Read(f, &textureOfs[0], sizeof(uint32_t), nullptr, nullptr, nullptr)
|
||||||
|
|| !SFile::Read(f, &textureOfs[1], sizeof(uint32_t), nullptr, nullptr, nullptr)
|
||||||
|
|| !SFile::Read(f, &textureOfs[2], sizeof(uint32_t), nullptr, nullptr, nullptr)
|
||||||
|
|| !SFile::Read(f, &textureOfs[3], sizeof(uint32_t), nullptr, nullptr, nullptr)
|
||||||
|
|| !SFile::Read(f, &textureOfs[4], sizeof(uint32_t), nullptr, nullptr, nullptr)
|
||||||
|
|| !SFile::Read(f, &textureOfs[5], sizeof(uint32_t), nullptr, nullptr, nullptr)
|
||||||
|
|| !SFile::Read(f, &textureOfs[6], sizeof(uint32_t), nullptr, nullptr, nullptr)
|
||||||
|
|| !SFile::Read(f, &textureOfs[7], sizeof(uint32_t), nullptr, nullptr, nullptr)
|
||||||
|
|| !SFile::Read(f, &this->m_itemVisual, sizeof(this->m_itemVisual), nullptr, nullptr, nullptr)
|
||||||
|
|| !SFile::Read(f, &this->m_particleColorID, sizeof(this->m_particleColorID), nullptr, nullptr, nullptr)
|
||||||
|
) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (stringBuffer) {
|
||||||
|
this->m_modelName[0] = &stringBuffer[modelNameOfs[0]];
|
||||||
|
this->m_modelName[1] = &stringBuffer[modelNameOfs[1]];
|
||||||
|
this->m_modelTexture[0] = &stringBuffer[modelTextureOfs[0]];
|
||||||
|
this->m_modelTexture[1] = &stringBuffer[modelTextureOfs[1]];
|
||||||
|
this->m_inventoryIcon[0] = &stringBuffer[inventoryIconOfs[0]];
|
||||||
|
this->m_inventoryIcon[1] = &stringBuffer[inventoryIconOfs[1]];
|
||||||
|
this->m_texture[0] = &stringBuffer[textureOfs[0]];
|
||||||
|
this->m_texture[1] = &stringBuffer[textureOfs[1]];
|
||||||
|
this->m_texture[2] = &stringBuffer[textureOfs[2]];
|
||||||
|
this->m_texture[3] = &stringBuffer[textureOfs[3]];
|
||||||
|
this->m_texture[4] = &stringBuffer[textureOfs[4]];
|
||||||
|
this->m_texture[5] = &stringBuffer[textureOfs[5]];
|
||||||
|
this->m_texture[6] = &stringBuffer[textureOfs[6]];
|
||||||
|
this->m_texture[7] = &stringBuffer[textureOfs[7]];
|
||||||
|
} else {
|
||||||
|
this->m_modelName[0] = "";
|
||||||
|
this->m_modelName[1] = "";
|
||||||
|
this->m_modelTexture[0] = "";
|
||||||
|
this->m_modelTexture[1] = "";
|
||||||
|
this->m_inventoryIcon[0] = "";
|
||||||
|
this->m_inventoryIcon[1] = "";
|
||||||
|
this->m_texture[0] = "";
|
||||||
|
this->m_texture[1] = "";
|
||||||
|
this->m_texture[2] = "";
|
||||||
|
this->m_texture[3] = "";
|
||||||
|
this->m_texture[4] = "";
|
||||||
|
this->m_texture[5] = "";
|
||||||
|
this->m_texture[6] = "";
|
||||||
|
this->m_texture[7] = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
33
src/db/rec/ItemDisplayInfoRec.hpp
Normal file
33
src/db/rec/ItemDisplayInfoRec.hpp
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
// DO NOT EDIT: generated by whoa-autocode
|
||||||
|
#ifndef DB_REC_ITEM_DISPLAY_INFO_REC_HPP
|
||||||
|
#define DB_REC_ITEM_DISPLAY_INFO_REC_HPP
|
||||||
|
|
||||||
|
#include <cstdint>
|
||||||
|
|
||||||
|
class SFile;
|
||||||
|
|
||||||
|
class ItemDisplayInfoRec {
|
||||||
|
public:
|
||||||
|
int32_t m_ID;
|
||||||
|
const char* m_modelName[2];
|
||||||
|
const char* m_modelTexture[2];
|
||||||
|
const char* m_inventoryIcon[2];
|
||||||
|
int32_t m_geosetGroup[3];
|
||||||
|
int32_t m_flags;
|
||||||
|
int32_t m_spellVisualID;
|
||||||
|
int32_t m_groupSoundIndex;
|
||||||
|
int32_t m_helmetGeosetVisID[2];
|
||||||
|
const char* m_texture[8];
|
||||||
|
int32_t m_itemVisual;
|
||||||
|
int32_t m_particleColorID;
|
||||||
|
|
||||||
|
static const char* GetFilename();
|
||||||
|
static uint32_t GetNumColumns();
|
||||||
|
static uint32_t GetRowSize();
|
||||||
|
static bool NeedIDAssigned();
|
||||||
|
int32_t GetID();
|
||||||
|
void SetID(int32_t id);
|
||||||
|
bool Read(SFile* f, const char* stringBuffer);
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
Loading…
Reference in New Issue
Block a user