Find items for given menu id.
Return if there are none.
Iterate over each of them.
Find the one with the given menu item id.
Store texts for localization.
Check need of localization.
Find localizations from database.
Find localizations from database.
Add menu item with existing method. Menu item id -1 is also used in ADD_GOSSIP_ITEM macro.
83 if (bounds.first == bounds.second)
87 for (GossipMenuItemsContainer::const_iterator itr = bounds.first; itr != bounds.second; ++itr)
90 if (itr->second.OptionIndex != menuItemId)
94 std::string strOptionText, strBoxText;
99 if (optionBroadcastText)
102 strOptionText = itr->second.OptionText;
105 if (boxBroadcastText)
108 strBoxText = itr->second.BoxText;
113 if (!optionBroadcastText)
120 if (!boxBroadcastText)
129 AddMenuItem(-1, itr->second.OptionIcon, strOptionText, sender, action, strBoxText, itr->second.BoxMoney, itr->second.BoxCoded);
DB2Storage< BroadcastTextEntry > sBroadcastTextStore("BroadcastText.db2", BroadcastTextFormat, HOTFIX_SEL_BROADCAST_TEXT)
static char const * GetBroadcastTextValue(BroadcastTextEntry const *broadcastText, LocaleConstant locale=DEFAULT_LOCALE, uint8 gender=GENDER_MALE, bool forceGender=false)
Definition: DB2Stores.cpp:610
Definition: DB2Structure.h:112
#define sObjectMgr
Definition: ObjectMgr.h:1567
std::pair< GossipMenuItemsContainer::const_iterator, GossipMenuItemsContainer::const_iterator > GossipMenuItemsMapBounds
Definition: ObjectMgr.h:539
static void GetLocaleString(StringVector const &data, LocaleConstant localeConstant, std::string &value)
Definition: ObjectMgr.h:1345
#define DEFAULT_LOCALE
Definition: Common.h:134
uint32 MAKE_PAIR32(uint16 l, uint16 h)
Definition: ObjectDefines.h:54