![]() |
TrinityCore
|
#include <CreatureTextMgr.h>
Public Member Functions | |
| CreatureTextMgr (CreatureTextMgr const &)=delete | |
| CreatureTextMgr (CreatureTextMgr &&)=delete | |
| CreatureTextMgr & | operator= (CreatureTextMgr const &)=delete |
| CreatureTextMgr & | operator= (CreatureTextMgr &&)=delete |
| void | LoadCreatureTexts () |
| void | LoadCreatureTextLocales () |
| CreatureTextMap const & | GetTextMap () const |
| 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, SoundKitPlayType playType=SoundKitPlayType::Normal, Team team=TEAM_OTHER, bool gmOnly=false, Player *srcPlr=nullptr) |
| bool | TextExist (uint32 sourceEntry, uint8 textGroup) const |
| std::string | GetLocalizedChatString (uint32 entry, uint8 gender, uint8 textGroup, uint32 id, LocaleConstant locale) const |
Static Public Member Functions | |
| static CreatureTextMgr * | instance () |
| 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) |
| static float | GetRangeForChatType (ChatMsg msgType) |
Private Member Functions | |
| CreatureTextMgr () | |
| ~CreatureTextMgr () | |
Private Attributes | |
| CreatureTextMap | mTextMap |
| LocaleCreatureTextMap | mLocaleTextMap |
Definition at line 82 of file CreatureTextMgr.h.
|
privatedefault |
|
privatedefault |
|
delete |
|
delete |
| std::string CreatureTextMgr::GetLocalizedChatString | ( | uint32 | entry, |
| uint8 | gender, | ||
| uint8 | textGroup, | ||
| uint32 | id, | ||
| LocaleConstant | locale | ||
| ) | const |
Definition at line 290 of file CreatureTextMgr.cpp.
References DEFAULT_LOCALE, DB2Manager::GetBroadcastTextValue(), ObjectMgr::GetLocaleString(), mLocaleTextMap, mTextMap, sBroadcastTextStore, and TOTAL_LOCALES.
|
static |
Definition at line 248 of file CreatureTextMgr.cpp.
References CHAT_MSG_MONSTER_EMOTE, CHAT_MSG_MONSTER_YELL, CHAT_MSG_RAID_BOSS_EMOTE, CONFIG_LISTEN_RANGE_SAY, CONFIG_LISTEN_RANGE_TEXTEMOTE, CONFIG_LISTEN_RANGE_YELL, and sWorld.
Referenced by Spell::EffectSendChatMessage(), and SendChatPacket().
|
inline |
Definition at line 99 of file CreatureTextMgr.h.
|
static |
| void CreatureTextMgr::LoadCreatureTextLocales | ( | ) |
Definition at line 142 of file CreatureTextMgr.cpp.
References ObjectMgr::AddLocaleString(), GetLocaleByName(), getMSTime(), GetMSTimeDiffToNow(), Field::GetStringView(), Field::GetUInt32(), Field::GetUInt8(), IsValidLocale(), LOCALE_enUS, mLocaleTextMap, TC_LOG_INFO, CreatureTextLocale::Text, and WorldDatabase.
| void CreatureTextMgr::LoadCreatureTexts | ( | ) |
Definition at line 43 of file CreatureTextMgr.cpp.
References CreatureTextEntry::BroadcastTextId, CHAT_MSG_SAY, CreatureTextEntry::creatureId, CreatureTextEntry::duration, CreatureTextEntry::emote, EMOTE_ONESHOT_NONE, Field::GetFloat(), getMSTime(), GetMSTimeDiffToNow(), Field::GetString(), Field::GetUInt32(), Field::GetUInt8(), CreatureTextEntry::groupId, CreatureTextEntry::id, CreatureTextEntry::lang, LANG_UNIVERSAL, Max, MAX_CHAT_MSG_TYPE, mTextMap, Normal, CreatureTextEntry::probability, sBroadcastTextStore, sEmotesStore, sLanguageMgr, CreatureTextEntry::sound, CreatureTextEntry::SoundPlayType, sSoundKitStore, TC_LOG_ERROR, TC_LOG_INFO, CreatureTextEntry::text, TEXT_RANGE_NORMAL, TEXT_RANGE_PERSONAL, CreatureTextEntry::TextRange, CreatureTextEntry::type, WORLD_SEL_CREATURE_TEXT, and WorldDatabase.
|
delete |
|
delete |
| uint32 CreatureTextMgr::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, |
||
| SoundKitPlayType | playType = SoundKitPlayType::Normal, |
||
| Team | team = TEAM_OTHER, |
||
| bool | gmOnly = false, |
||
| Player * | srcPlr = nullptr |
||
| ) |
Definition at line 173 of file CreatureTextMgr.cpp.
References CHAT_MSG_ADDON, Creature::ClearTextRepeatGroup(), BroadcastTextEntry::ConditionID, GENDER_FEMALE, Object::GetEntry(), Unit::GetGender(), BaseEntity::GetGUID(), WorldObject::GetName(), Creature::GetTextRepeatGroup(), LANG_ADDON, mTextMap, CreatureTextEntry::probability, sBroadcastTextStore, Trinity::Containers::SelectRandomWeightedContainerElement(), SendChatPacket(), Creature::SetTextRepeatId(), BroadcastTextEntry::SoundKitID, TC_LOG_ERROR, TEXT_RANGE_NORMAL, and ObjectGuid::ToString().
|
static |
Definition at line 75 of file CreatureTextMgrImpl.h.
References RefManager< ReferenceType >::begin(), CHAT_MSG_MONSTER_PARTY, CHAT_MSG_MONSTER_WHISPER, CHAT_MSG_RAID_BOSS_WHISPER, RefManager< ReferenceType >::end(), WorldObject::GetAreaId(), WorldObject::GetMap(), Map::GetPlayers(), GetRangeForChatType(), BaseEntity::GetTypeId(), WorldObject::GetZoneId(), BaseEntity::IsPlayer(), sWorld, TEXT_RANGE_AREA, TEXT_RANGE_MAP, TEXT_RANGE_NORMAL, TEXT_RANGE_PERSONAL, TEXT_RANGE_WORLD, TEXT_RANGE_ZONE, Object::ToPlayer(), TYPEID_PLAYER, and Cell::VisitWorldObjects().
Referenced by SmartScript::ProcessAction(), and SendChat().
Definition at line 267 of file CreatureTextMgr.cpp.
References mTextMap, and TC_LOG_DEBUG.
|
private |
Definition at line 113 of file CreatureTextMgr.h.
Referenced by GetLocalizedChatString(), and LoadCreatureTextLocales().
|
private |
Definition at line 112 of file CreatureTextMgr.h.
Referenced by GetLocalizedChatString(), LoadCreatureTexts(), SendChat(), and TextExist().