diff options
author | Shauren <shauren.trinity@gmail.com> | 2025-04-27 17:09:17 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2025-04-27 17:09:17 +0200 |
commit | 6a20d3181d1ef939bca61e7fe2ce265a974678f4 (patch) | |
tree | b306ed5b8af2761d44911abf76693824c547db1a /src/server/game/Chat/Hyperlinks.h | |
parent | 93f3b605418b95461e5bf117739099ce9052468f (diff) |
Core/Chat: Support new 11.1.5 chat link color format and more chat link types
Diffstat (limited to 'src/server/game/Chat/Hyperlinks.h')
-rw-r--r-- | src/server/game/Chat/Hyperlinks.h | 39 |
1 files changed, 25 insertions, 14 deletions
diff --git a/src/server/game/Chat/Hyperlinks.h b/src/server/game/Chat/Hyperlinks.h index 8adb96187f9..01412544e09 100644 --- a/src/server/game/Chat/Hyperlinks.h +++ b/src/server/game/Chat/Hyperlinks.h @@ -38,11 +38,13 @@ struct GarrMissionEntry; struct GlyphPropertiesEntry; struct ItemModifiedAppearanceEntry; struct ItemNameDescriptionEntry; +enum ItemQualities : uint8; struct ItemTemplate; struct LocalizedString; struct MapEntry; struct MapChallengeModeEntry; struct MawPowerEntry; +struct PerksActivityEntry; struct PvpTalentEntry; class Quest; struct SkillLineEntry; @@ -375,6 +377,13 @@ namespace Trinity::Hyperlinks static bool StoreTo(SoulbindConduitRankEntry const*& val, std::string_view text); }; + struct TC_GAME_API curio + { + using value_type = SpellInfo const*; + static constexpr std::string_view tag() { return "curio"; } + static bool StoreTo(SpellInfo const*& val, std::string_view text); + }; + struct TC_GAME_API currency { using value_type = CurrencyLinkData const&; @@ -459,6 +468,13 @@ namespace Trinity::Hyperlinks static bool StoreTo(MountLinkData& val, std::string_view text); }; + struct TC_GAME_API perksactivity + { + using value_type = PerksActivityEntry const*; + static constexpr std::string_view tag() { return "perksactivity"; } + static bool StoreTo(PerksActivityEntry const*& val, std::string_view text); + }; + struct TC_GAME_API pvptal { using value_type = PvpTalentEntry const*; @@ -532,29 +548,24 @@ namespace Trinity::Hyperlinks struct HyperlinkColor { - HyperlinkColor(uint32 c) : r(c >> 16), g(c >> 8), b(c), a(c >> 24) {} - uint8 const r, g, b, a; + HyperlinkColor() = default; + HyperlinkColor(std::string_view c) : data(c) {} + std::string_view data; bool operator==(uint32 c) const { - if ((c & 0xff) ^ b) - return false; - if (((c >>= 8) & 0xff) ^ g) - return false; - if (((c >>= 8) & 0xff) ^ r) - return false; - if ((c >>= 8) ^ a) - return false; - return true; + return Trinity::StringTo<uint32>(data, 16) == c; } + + bool operator==(ItemQualities q) const; }; struct HyperlinkInfo { - HyperlinkInfo() : ok(false), color(0) {} - HyperlinkInfo(std::string_view t, uint32 c, std::string_view ta, std::string_view d, std::string_view te) : + HyperlinkInfo() : ok(false) {} + HyperlinkInfo(std::string_view t, std::string_view c, std::string_view ta, std::string_view d, std::string_view te) : ok(true), tail(t), color(c), tag(ta), data(d), text(te) {} - explicit operator bool() { return ok; } + explicit operator bool() const { return ok; } bool const ok; std::string_view const tail; HyperlinkColor const color; |