AzerothCore 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 ( )
277{
278 _questMenuItems.reserve(16); // can be set for max from most often sizes to speedup push_back and less memory use
279}
QuestMenuItemList _questMenuItems
Definition: GossipDef.h:255

References _questMenuItems.

◆ ~QuestMenu()

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

References ClearMenu().

Member Function Documentation

◆ AddMenuItem()

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

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
243 {
244 return _questMenuItems.empty();
245 }

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
302{
303 for (QuestMenuItemList::const_iterator i = _questMenuItems.begin(); i != _questMenuItems.end(); ++i)
304 if (i->QuestId == questId)
305 return true;
306
307 return false;
308}

References _questMenuItems.

Member Data Documentation

◆ _questMenuItems

QuestMenuItemList QuestMenu::_questMenuItems
private