Core/Text: Implemented locales_page_text. (#221)

This commit is contained in:
HeartWell
2016-11-03 22:00:04 +03:00
committed by Shin
parent 7e4328b588
commit b9aa88ac2b
3 changed files with 1982 additions and 1 deletions

File diff suppressed because one or more lines are too long

View File

@@ -1062,6 +1062,12 @@ class ObjectMgr
if (itr == _gameObjectDataStore.end()) return NULL;
return &itr->second;
}
PageTextLocale const* GetPageTextLocale(uint32 entry) const
{
PageTextLocaleContainer::const_iterator itr = _pageTextLocaleStore.find(entry);
if (itr == _pageTextLocaleStore.end()) return NULL;
return &itr->second;
}
GameObjectData& NewGOData(uint32 guid) { return _gameObjectDataStore[guid]; }
void DeleteGOData(uint32 guid);

View File

@@ -275,7 +275,14 @@ void WorldSession::HandlePageTextQueryOpcode(WorldPacket & recvData)
}
else
{
data << pageText->Text;
std::string Text = pageText->Text;
int loc_idx = GetSessionDbLocaleIndex();
if (loc_idx >= 0)
if (PageTextLocale const* player = sObjectMgr->GetPageTextLocale(pageID))
ObjectMgr::GetLocaleString(player->Text, loc_idx, Text);
data << Text;
data << uint32(pageText->NextPage);
pageID = pageText->NextPage;
}