AzeorthCore 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:110
uint32 constexpr QuestDifficultyColors[MAX_QUEST_DIFFICULTY]
Definition: SharedDefines.h:338
size_t constexpr MAX_QUEST_DIFFICULTY
Definition: SharedDefines.h:337

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:85
#define DEFAULT_LOCALE
Definition: Common.h:88
#define sObjectMgr
Definition: ObjectMgr.h:1606
static std::string_view GetLocaleString(std::vector< std::string > const &data, size_t locale)
Definition: ObjectMgr.h:1390
Definition: QuestDef.h:180
std::vector< std::string > Title
Definition: QuestDef.h:183

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