AzeorthCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
QuestMenu Class Reference

#include "GossipDef.h"

Public Member Functions

uint8 GetMenuItemCount () const
 
bool Empty () const
 
QuestMenuItem const & GetItem (uint16 index) const
 
AddMenuItem

Adds a localized gossip menu item from db by menu id and menu item id.

Parameters
menuIdGossip menu id.
menuItemIdGossip menu item id.
senderIdentifier of the current menu.
actionCustom action given to OnGossipHello.
boxMoneyCustom price for pop-up box. If > 0, it will replace DB value.
 QuestMenu ()
 
 ~QuestMenu ()
 
void AddMenuItem (uint32 QuestId, uint8 Icon)
 
void ClearMenu ()
 
bool HasItem (uint32 questId) const
 

Private Attributes

QuestMenuItemList _questMenuItems
 

Detailed Description

Constructor & Destructor Documentation

◆ QuestMenu()

QuestMenu::QuestMenu ( )
278{
279 _questMenuItems.reserve(16); // can be set for max from most often sizes to speedup push_back and less memory use
280}
QuestMenuItemList _questMenuItems
Definition: GossipDef.h:254

References _questMenuItems.

◆ ~QuestMenu()

QuestMenu::~QuestMenu ( )
283{
284 ClearMenu();
285}
void ClearMenu()
Definition: GossipDef.cpp:311

References ClearMenu().

Member Function Documentation

◆ AddMenuItem()

void QuestMenu::AddMenuItem ( uint32  QuestId,
uint8  Icon 
)
288{
289 if (!sObjectMgr->GetQuestTemplate(QuestId))
290 return;
291
293
294 QuestMenuItem questMenuItem;
295
296 questMenuItem.QuestId = QuestId;
297 questMenuItem.QuestIcon = Icon;
298
299 _questMenuItems.push_back(questMenuItem);
300}
#define ASSERT
Definition: Errors.h:68
#define GOSSIP_MAX_MENU_ITEMS
Definition: GossipDef.h:29
#define sObjectMgr
Definition: ObjectMgr.h:1606
Definition: GossipDef.h:154
uint32 QuestId
Definition: GossipDef.h:155
uint8 QuestIcon
Definition: GossipDef.h:156

References _questMenuItems, ASSERT, GOSSIP_MAX_MENU_ITEMS, QuestMenuItem::QuestIcon, QuestMenuItem::QuestId, and sObjectMgr.

Referenced by npc_wg_quest_giver::OnGossipHello(), Player::PrepareQuestMenu(), and npc_costumed_orphan_matron::sGossipHello().

◆ ClearMenu()

◆ Empty()

bool QuestMenu::Empty ( ) const
inline
242 {
243 return _questMenuItems.empty();
244 }

References _questMenuItems.

Referenced by PlayerMenu::Empty(), Player::SendPreparedGossip(), and Player::SendPreparedQuest().

◆ GetItem()

QuestMenuItem const & QuestMenu::GetItem ( uint16  index) const
inline

◆ GetMenuItemCount()

uint8 QuestMenu::GetMenuItemCount ( ) const
inline

◆ HasItem()

bool QuestMenu::HasItem ( uint32  questId) const
303{
304 for (QuestMenuItemList::const_iterator i = _questMenuItems.begin(); i != _questMenuItems.end(); ++i)
305 if (i->QuestId == questId)
306 return true;
307
308 return false;
309}

References _questMenuItems.

Member Data Documentation

◆ _questMenuItems

QuestMenuItemList QuestMenu::_questMenuItems
private