diff options
| author | joschiwald <joschiwald.trinity@gmail.com> | 2014-12-23 00:06:36 +0100 |
|---|---|---|
| committer | joschiwald <joschiwald.trinity@gmail.com> | 2014-12-23 00:06:36 +0100 |
| commit | 6c6e4d4328526ccfcd9049efbf9033fe47de41a6 (patch) | |
| tree | 32e7f776afd1b527302f3addd1dde812d84585d8 /src/server/game/Texts/CreatureTextMgr.h | |
| parent | bf8eff8545d092585a1c710dc0b251b8cd0654bb (diff) | |
Core/Packets: moved chat packet building function to packet builder class
Diffstat (limited to 'src/server/game/Texts/CreatureTextMgr.h')
| -rw-r--r-- | src/server/game/Texts/CreatureTextMgr.h | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/server/game/Texts/CreatureTextMgr.h b/src/server/game/Texts/CreatureTextMgr.h index 647d8249e68..f15ec94c69b 100644 --- a/src/server/game/Texts/CreatureTextMgr.h +++ b/src/server/game/Texts/CreatureTextMgr.h @@ -96,24 +96,24 @@ class CreatureTextMgr void LoadCreatureTexts(); void LoadCreatureTextLocales(); - CreatureTextMap const& GetTextMap() const { return mTextMap; } + CreatureTextMap const& GetTextMap() const { return mTextMap; } - void SendSound(Creature* source, uint32 sound, ChatMsg msgType, WorldObject const* whisperTarget, CreatureTextRange range, Team team, bool gmOnly); - void SendEmote(Unit* source, uint32 emote); + static void SendSound(Creature* source, uint32 sound, ChatMsg msgType, WorldObject const* whisperTarget = nullptr, CreatureTextRange range = TEXT_RANGE_NORMAL, Team team = TEAM_OTHER, bool gmOnly = false); + static void SendEmote(Unit* source, uint32 emote); //if sent, returns the 'duration' of the text else 0 if error uint32 SendChat(Creature* source, uint8 textGroup, WorldObject const* whisperTarget = nullptr, ChatMsg msgType = CHAT_MSG_ADDON, Language language = LANG_ADDON, CreatureTextRange range = TEXT_RANGE_NORMAL, uint32 sound = 0, Team team = TEAM_OTHER, bool gmOnly = false, Player* srcPlr = nullptr); - bool TextExist(uint32 sourceEntry, uint8 textGroup); + bool TextExist(uint32 sourceEntry, uint8 textGroup) const; std::string GetLocalizedChatString(uint32 entry, uint8 gender, uint8 textGroup, uint32 id, LocaleConstant locale) const; - template<class Builder> void SendChatPacket(WorldObject* source, Builder const& builder, ChatMsg msgType, WorldObject const* whisperTarget = nullptr, CreatureTextRange range = TEXT_RANGE_NORMAL, Team team = TEAM_OTHER, bool gmOnly = false) const; + template<class Builder> static void SendChatPacket(WorldObject* source, Builder const& builder, ChatMsg msgType, WorldObject const* whisperTarget = nullptr, CreatureTextRange range = TEXT_RANGE_NORMAL, Team team = TEAM_OTHER, bool gmOnly = false); private: - CreatureTextRepeatIds GetRepeatGroup(Creature* source, uint8 textGroup); + CreatureTextRepeatIds GetRepeatGroup(Creature* source, uint8 textGroup) const; void SetRepeatId(Creature* source, uint8 textGroup, uint8 id); - void SendNonChatPacket(WorldObject* source, WorldPacket* data, ChatMsg msgType, WorldObject const* whisperTarget, CreatureTextRange range, Team team, bool gmOnly) const; - float GetRangeForChatType(ChatMsg msgType) const; + static void SendNonChatPacket(WorldObject* source, WorldPacket* data, ChatMsg msgType, WorldObject const* whisperTarget, CreatureTextRange range, Team team, bool gmOnly); + static float GetRangeForChatType(ChatMsg msgType); CreatureTextMap mTextMap; CreatureTextRepeatMap mTextRepeatMap; @@ -171,7 +171,7 @@ class CreatureTextLocalizer }; template<class Builder> -void CreatureTextMgr::SendChatPacket(WorldObject* source, Builder const& builder, ChatMsg msgType, WorldObject const* whisperTarget /*= nullptr*/, CreatureTextRange range /*= TEXT_RANGE_NORMAL*/, Team team /*= TEAM_OTHER*/, bool gmOnly /*= false*/) const +void CreatureTextMgr::SendChatPacket(WorldObject* source, Builder const& builder, ChatMsg msgType, WorldObject const* whisperTarget /*= nullptr*/, CreatureTextRange range /*= TEXT_RANGE_NORMAL*/, Team team /*= TEAM_OTHER*/, bool gmOnly /*= false*/) { if (!source) return; |
