Forums WoW Modding Support Archives Azerothcore Discord Archives [DiscordArchive] Good evening, there is a way to grab a gossip from the database in a c++ code but that takes it tran

[DiscordArchive] Good evening, there is a way to grab a gossip from the database in a c++ code but that takes it tran

[DiscordArchive] Good evening, there is a way to grab a gossip from the database in a c++ code but that takes it tran

rektbyfaith
Administrator
0
11-20-2018, 05:34 AM
#1
Archived author: stevej • Posted: 2018-11-20T05:34:19.267000+00:00
Original source

Good evening, there is a way to grab a gossip from the database in a c++ code but that takes it translated from local_gossip_menu_id?
rektbyfaith
11-20-2018, 05:34 AM #1

Archived author: stevej • Posted: 2018-11-20T05:34:19.267000+00:00
Original source

Good evening, there is a way to grab a gossip from the database in a c++ code but that takes it translated from local_gossip_menu_id?

rektbyfaith
Administrator
0
11-20-2018, 05:38 AM
#2
Archived author: stevej • Posted: 2018-11-20T05:38:59.412000+00:00
Original source

```c
void AddGossipItemFor(Player* player, uint32 gossipMenuID, uint32 gossipMenuItemID, uint32 sender, uint32 action);
```

That method, takes the gossip from the database but doesn't show it translated.
rektbyfaith
11-20-2018, 05:38 AM #2

Archived author: stevej • Posted: 2018-11-20T05:38:59.412000+00:00
Original source

```c
void AddGossipItemFor(Player* player, uint32 gossipMenuID, uint32 gossipMenuItemID, uint32 sender, uint32 action);
```

That method, takes the gossip from the database but doesn't show it translated.

rektbyfaith
Administrator
0
11-20-2018, 05:42 AM
#3
Archived author: stevej • Posted: 2018-11-20T05:42:41.033000+00:00
Original source

```c
void GossipMenu::AddMenuItem(uint32 menuId, uint32 menuItemId, uint32 sender, uint32 action)
{
/// Find items for given menu id.
GossipMenuItemsMapBounds bounds = sObjectMgr->GetGossipMenuItemsMapBounds(menuId);
/// Return if there are none.
if (bounds.first == bounds.second)
return;

/// Iterate over each of them.
for (GossipMenuItemsContainer::const_iterator itr = bounds.first; itr != bounds.second; ++itr)
{
/// Find the one with the given menu item id.
if (itr->second.OptionIndex != menuItemId)
continue;

/// Store texts for localization.
std:Confusedtring strOptionText = itr->second.OptionText;
std:Confusedtring strBoxText = itr->second.BoxText;

/// Check need of localization.
if (GetLocale() != DEFAULT_LOCALE)
/// Find localizations from database.
if (GossipMenuItemsLocale const* no = sObjectMgr->GetGossipMenuItemsLocale(MAKE_PAIR32(menuId, menuItemId)))
{
/// Translate texts if there are any.
ObjectMgr::GetLocaleString(no->OptionText, GetLocale(), strOptionText);
ObjectMgr::GetLocaleString(no->BoxText, GetLocale(), strBoxText);
}

/// Add menu item with existing method. Menu item id -1 is also used in ADD_GOSSIP_ITEM macro.
AddMenuItem(-1, itr->second.OptionIcon, strOptionText, sender, action, strBoxText, itr->second.BoxMoney, itr->second.BoxCoded);
}
}
```

Although looking at this code it seems that the method takes the translations in case they exist, but as never use it yet. Anyone who has used it?
rektbyfaith
11-20-2018, 05:42 AM #3

Archived author: stevej • Posted: 2018-11-20T05:42:41.033000+00:00
Original source

```c
void GossipMenu::AddMenuItem(uint32 menuId, uint32 menuItemId, uint32 sender, uint32 action)
{
/// Find items for given menu id.
GossipMenuItemsMapBounds bounds = sObjectMgr->GetGossipMenuItemsMapBounds(menuId);
/// Return if there are none.
if (bounds.first == bounds.second)
return;

/// Iterate over each of them.
for (GossipMenuItemsContainer::const_iterator itr = bounds.first; itr != bounds.second; ++itr)
{
/// Find the one with the given menu item id.
if (itr->second.OptionIndex != menuItemId)
continue;

/// Store texts for localization.
std:Confusedtring strOptionText = itr->second.OptionText;
std:Confusedtring strBoxText = itr->second.BoxText;

/// Check need of localization.
if (GetLocale() != DEFAULT_LOCALE)
/// Find localizations from database.
if (GossipMenuItemsLocale const* no = sObjectMgr->GetGossipMenuItemsLocale(MAKE_PAIR32(menuId, menuItemId)))
{
/// Translate texts if there are any.
ObjectMgr::GetLocaleString(no->OptionText, GetLocale(), strOptionText);
ObjectMgr::GetLocaleString(no->BoxText, GetLocale(), strBoxText);
}

/// Add menu item with existing method. Menu item id -1 is also used in ADD_GOSSIP_ITEM macro.
AddMenuItem(-1, itr->second.OptionIcon, strOptionText, sender, action, strBoxText, itr->second.BoxMoney, itr->second.BoxCoded);
}
}
```

Although looking at this code it seems that the method takes the translations in case they exist, but as never use it yet. Anyone who has used it?

Recently Browsing
 1 Guest(s)
Recently Browsing
 1 Guest(s)