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
209 {
210 for (uint8 i = 0; i < MAX_QUEST_DIFFICULTY; ++i)
211 if (c == QuestDifficultyColors[i])
212 return true;
213
214 return false;
215 }
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
184 {
185 if (text.empty())
186 return false;
187
188 if (text == data.Quest->GetTitle())
189 return true;
190
191 QuestLocale const* locale = sObjectMgr->GetQuestLocale(data.Quest->GetQuestId());
192 if (!locale)
193 return false;
194
195 for (uint8 i = 0; i < TOTAL_LOCALES; ++i)
196 {
197 if (i == DEFAULT_LOCALE)
198 continue;
199
200 std::string_view name = ObjectMgr::GetLocaleString(locale->Title, i);
201 if (!name.empty() && (text == name))
202 return true;
203 }
204
205 return false;
206 }
@ TOTAL_LOCALES
Definition: Common.h:76
#define DEFAULT_LOCALE
Definition: Common.h:79
#define sObjectMgr
Definition: ObjectMgr.h:1635
static std::string_view GetLocaleString(std::vector< std::string > const &data, std::size_t locale)
Definition: ObjectMgr.h:1407
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.