AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
LinkValidator< LinkTags::quest > Struct Reference

Static Public Member Functions

static bool IsTextValid (QuestLinkData const &data, std::string_view text)
 
static bool IsColorValid (QuestLinkData const &, HyperlinkColor c)
 

Detailed Description

Member Function Documentation

◆ IsColorValid()

static bool LinkValidator< LinkTags::quest >::IsColorValid ( QuestLinkData const &  ,
HyperlinkColor  c 
)
inlinestatic
208 {
209 for (uint8 i = 0; i < MAX_QUEST_DIFFICULTY; ++i)
210 if (c == QuestDifficultyColors[i])
211 return true;
212
213 return false;
214 }
std::uint8_t uint8
Definition: Define.h:109
uint32 constexpr QuestDifficultyColors[MAX_QUEST_DIFFICULTY]
Definition: SharedDefines.h:366
std::size_t constexpr MAX_QUEST_DIFFICULTY
Definition: SharedDefines.h:365

References MAX_QUEST_DIFFICULTY, and QuestDifficultyColors.

◆ IsTextValid()

static bool LinkValidator< LinkTags::quest >::IsTextValid ( QuestLinkData const &  data,
std::string_view  text 
)
inlinestatic
183 {
184 if (text.empty())
185 return false;
186
187 if (text == data.Quest->GetTitle())
188 return true;
189
190 QuestLocale const* locale = sObjectMgr->GetQuestLocale(data.Quest->GetQuestId());
191 if (!locale)
192 return false;
193
194 for (uint8 i = 0; i < TOTAL_LOCALES; ++i)
195 {
196 if (i == DEFAULT_LOCALE)
197 continue;
198
199 std::string_view name = ObjectMgr::GetLocaleString(locale->Title, i);
200 if (!name.empty() && (text == name))
201 return true;
202 }
203
204 return false;
205 }
@ TOTAL_LOCALES
Definition: Common.h:76
#define DEFAULT_LOCALE
Definition: Common.h:79
#define sObjectMgr
Definition: ObjectMgr.h:1623
static std::string_view GetLocaleString(std::vector< std::string > const &data, std::size_t locale)
Definition: ObjectMgr.h:1405
Definition: QuestDef.h:183
std::vector< std::string > Title
Definition: QuestDef.h:186

References DEFAULT_LOCALE, ObjectMgr::GetLocaleString(), Quest::GetQuestId(), Quest::GetTitle(), Acore::Hyperlinks::QuestLinkData::Quest, sObjectMgr, QuestLocale::Title, and TOTAL_LOCALES.