mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-03-06 09:18:04 +00:00
feat(DB/Module): introduce module_string table (#19475)
This commit is contained in:
@@ -493,6 +493,11 @@ typedef std::unordered_map<uint32/*(mapid, spawnMode) pair*/, CellObjectGuidsMap
|
||||
// Acore Trainer Reference start range
|
||||
#define ACORE_TRAINER_START_REF 200000
|
||||
|
||||
struct ModuleString
|
||||
{
|
||||
std::vector<std::string> Content;
|
||||
};
|
||||
|
||||
struct AcoreString
|
||||
{
|
||||
std::vector<std::string> Content;
|
||||
@@ -511,6 +516,7 @@ typedef std::unordered_map<uint32, QuestOfferRewardLocale> QuestOfferRewardLocal
|
||||
typedef std::unordered_map<uint32, QuestRequestItemsLocale> QuestRequestItemsLocaleContainer;
|
||||
typedef std::unordered_map<uint32, NpcTextLocale> NpcTextLocaleContainer;
|
||||
typedef std::unordered_map<uint32, PageTextLocale> PageTextLocaleContainer;
|
||||
typedef std::map<std::pair<std::string, uint32>, ModuleString> ModuleStringContainer;
|
||||
typedef std::unordered_map<int32, AcoreString> AcoreStringContainer;
|
||||
typedef std::unordered_map<uint32, GossipMenuItemsLocale> GossipMenuItemsLocaleContainer;
|
||||
typedef std::unordered_map<uint32, PointOfInterestLocale> PointOfInterestLocaleContainer;
|
||||
@@ -1012,6 +1018,8 @@ public:
|
||||
void ValidateSpellScripts();
|
||||
void InitializeSpellInfoPrecomputedData();
|
||||
|
||||
bool LoadModuleStrings();
|
||||
bool LoadModuleStringsLocale();
|
||||
bool LoadAcoreStrings();
|
||||
void LoadBroadcastTexts();
|
||||
void LoadBroadcastTextLocales();
|
||||
@@ -1310,6 +1318,17 @@ public:
|
||||
GameObjectData& NewGOData(ObjectGuid::LowType guid) { return _gameObjectDataStore[guid]; }
|
||||
void DeleteGOData(ObjectGuid::LowType guid);
|
||||
|
||||
[[nodiscard]] ModuleString const* GetModuleString(std::string module, uint32 id) const
|
||||
{
|
||||
std::pair<std::string, uint32> pairKey = std::make_pair(module, id);
|
||||
ModuleStringContainer::const_iterator itr = _moduleStringStore.find(pairKey);
|
||||
if (itr == _moduleStringStore.end())
|
||||
return nullptr;
|
||||
|
||||
return &itr->second;
|
||||
}
|
||||
[[nodiscard]] std::string const* GetModuleString(std::string module, uint32 id, LocaleConstant locale) const;
|
||||
|
||||
[[nodiscard]] AcoreString const* GetAcoreString(uint32 entry) const
|
||||
{
|
||||
AcoreStringContainer::const_iterator itr = _acoreStringStore.find(entry);
|
||||
@@ -1598,6 +1617,7 @@ private:
|
||||
QuestRequestItemsLocaleContainer _questRequestItemsLocaleStore;
|
||||
NpcTextLocaleContainer _npcTextLocaleStore;
|
||||
PageTextLocaleContainer _pageTextLocaleStore;
|
||||
ModuleStringContainer _moduleStringStore;
|
||||
AcoreStringContainer _acoreStringStore;
|
||||
GossipMenuItemsLocaleContainer _gossipMenuItemsLocaleStore;
|
||||
PointOfInterestLocaleContainer _pointOfInterestLocaleStore;
|
||||
|
||||
Reference in New Issue
Block a user