mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-28 08:06:23 +00:00
Core/Locale: fix Locales for gossip menu option (#503)
This commit is contained in:
@@ -14710,7 +14710,21 @@ void Player::PrepareGossipMenu(WorldObject* source, uint32 menuId /*= 0*/, bool
|
||||
|
||||
if (canTalk)
|
||||
{
|
||||
menu->GetGossipMenu().AddMenuItem(itr->second.OptionIndex, itr->second.OptionIcon, itr->second.OptionText, 0, itr->second.OptionType, itr->second.BoxText, itr->second.BoxMoney, itr->second.BoxCoded);
|
||||
std::string strOptionText = itr->second.OptionText;
|
||||
std::string strBoxText = itr->second.BoxText;
|
||||
|
||||
int32 locale = GetSession()->GetSessionDbLocaleIndex();
|
||||
if (locale >= 0)
|
||||
{
|
||||
uint32 idxEntry = MAKE_PAIR32(menuId, itr->second.OptionIndex);
|
||||
if (GossipMenuItemsLocale const* no = sObjectMgr->GetGossipMenuItemsLocale(idxEntry))
|
||||
{
|
||||
ObjectMgr::GetLocaleString(no->OptionText, locale, strOptionText);
|
||||
ObjectMgr::GetLocaleString(no->BoxText, locale, strBoxText);
|
||||
}
|
||||
}
|
||||
|
||||
menu->GetGossipMenu().AddMenuItem(itr->second.OptionIndex, itr->second.OptionIcon, strOptionText, 0, itr->second.OptionType, strBoxText, itr->second.BoxMoney, itr->second.BoxCoded);
|
||||
menu->GetGossipMenu().AddGossipMenuItemData(itr->second.OptionIndex, itr->second.ActionMenuId, itr->second.ActionPoiId);
|
||||
}
|
||||
}
|
||||
@@ -15056,10 +15070,20 @@ void Player::SendPreparedQuest(uint64 guid)
|
||||
if (!gossiptext->Options[0].Text_0.empty())
|
||||
{
|
||||
title = gossiptext->Options[0].Text_0;
|
||||
|
||||
int loc_idx = GetSession()->GetSessionDbLocaleIndex();
|
||||
if (loc_idx >= 0)
|
||||
if (NpcTextLocale const* nl = sObjectMgr->GetNpcTextLocale(textid))
|
||||
ObjectMgr::GetLocaleString(nl->Text_0[0], loc_idx, title);
|
||||
}
|
||||
else
|
||||
{
|
||||
title = gossiptext->Options[0].Text_1;
|
||||
|
||||
int loc_idx = GetSession()->GetSessionDbLocaleIndex();
|
||||
if (loc_idx >= 0)
|
||||
if (NpcTextLocale const* nl = sObjectMgr->GetNpcTextLocale(textid))
|
||||
ObjectMgr::GetLocaleString(nl->Text_1[0], loc_idx, title);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user