From c05ab915e64358537a1a39bab8c27f79c07873a1 Mon Sep 17 00:00:00 2001 From: snixtho Date: Wed, 31 Jul 2024 13:23:38 +0200 Subject: [PATCH] Create ClubTag as a built-in component instead to avoid dependency errors. --- src/EvoSC.Manialinks/ManialinkManager.cs | 2 ++ .../Templates/Advanced}/ClubTag.mt | 12 ++++++------ .../AdvancedComponents/DefaultClubTagTheme.cs | 18 ++++++++++++++++++ .../Components/PlayerRow/Framemodel.mt | 2 +- .../Templates/SpectatorTargetInfo.mt | 4 ++-- 5 files changed, 29 insertions(+), 9 deletions(-) rename src/{Modules/Scoreboard/Templates/Components/PlayerRow => EvoSC.Manialinks/Templates/Advanced}/ClubTag.mt (72%) create mode 100644 src/EvoSC.Manialinks/Themes/AdvancedComponents/DefaultClubTagTheme.cs diff --git a/src/EvoSC.Manialinks/ManialinkManager.cs b/src/EvoSC.Manialinks/ManialinkManager.cs index 87928429b..9e3239894 100644 --- a/src/EvoSC.Manialinks/ManialinkManager.cs +++ b/src/EvoSC.Manialinks/ManialinkManager.cs @@ -16,6 +16,7 @@ using EvoSC.Manialinks.Interfaces.Models; using EvoSC.Manialinks.Models; using EvoSC.Manialinks.Themes; +using EvoSC.Manialinks.Themes.AdvancedComponents; using EvoSC.Manialinks.Util; using GbxRemoteNet; using GbxRemoteNet.Events; @@ -74,6 +75,7 @@ public ManialinkManager(ILogger logger, IServerClient server, themeManager.AddThemeAsync(); themeManager.AddThemeAsync(); themeManager.AddThemeAsync(); + themeManager.AddThemeAsync(); _engine.GlobalVariables["Util"] = new GlobalManialinkUtils(themeManager); _engine.GlobalVariables["Icons"] = new GameIcons(); diff --git a/src/Modules/Scoreboard/Templates/Components/PlayerRow/ClubTag.mt b/src/EvoSC.Manialinks/Templates/Advanced/ClubTag.mt similarity index 72% rename from src/Modules/Scoreboard/Templates/Components/PlayerRow/ClubTag.mt rename to src/EvoSC.Manialinks/Templates/Advanced/ClubTag.mt index cfd82f9ad..d924e1341 100644 --- a/src/Modules/Scoreboard/Templates/Components/PlayerRow/ClubTag.mt +++ b/src/EvoSC.Manialinks/Templates/Advanced/ClubTag.mt @@ -1,16 +1,16 @@  - + - \ No newline at end of file + diff --git a/src/EvoSC.Manialinks/Themes/AdvancedComponents/DefaultClubTagTheme.cs b/src/EvoSC.Manialinks/Themes/AdvancedComponents/DefaultClubTagTheme.cs new file mode 100644 index 000000000..49e04c732 --- /dev/null +++ b/src/EvoSC.Manialinks/Themes/AdvancedComponents/DefaultClubTagTheme.cs @@ -0,0 +1,18 @@ +using EvoSC.Common.Interfaces.Themes; +using EvoSC.Common.Themes; +using EvoSC.Common.Themes.Attributes; + +namespace EvoSC.Manialinks.Themes.AdvancedComponents; + +[Theme(Name = "ClubTag Component", Description = "Default theme for the ClubTag component.")] +public class DefaultClubTagTheme(IThemeManager theme) : Theme +{ + private readonly dynamic _theme = theme.Theme; + + public override Task ConfigureAsync() + { + Set("UI.ClubTag.Bg").To(_theme.UI_BgHighlight); + + return Task.CompletedTask; + } +} diff --git a/src/Modules/Scoreboard/Templates/Components/PlayerRow/Framemodel.mt b/src/Modules/Scoreboard/Templates/Components/PlayerRow/Framemodel.mt index 816733766..37cdafd0d 100644 --- a/src/Modules/Scoreboard/Templates/Components/PlayerRow/Framemodel.mt +++ b/src/Modules/Scoreboard/Templates/Components/PlayerRow/Framemodel.mt @@ -4,7 +4,7 @@ - + diff --git a/src/Modules/SpectatorTargetInfoModule/Templates/SpectatorTargetInfo.mt b/src/Modules/SpectatorTargetInfoModule/Templates/SpectatorTargetInfo.mt index 161a70eda..2728ff2bc 100644 --- a/src/Modules/SpectatorTargetInfoModule/Templates/SpectatorTargetInfo.mt +++ b/src/Modules/SpectatorTargetInfoModule/Templates/SpectatorTargetInfo.mt @@ -1,5 +1,5 @@  - + @@ -78,7 +78,7 @@