Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create ClubTag as a built-in component instead to avoid dependency er… #256

Merged
merged 1 commit into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/EvoSC.Manialinks/ManialinkManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -74,6 +75,7 @@ public ManialinkManager(ILogger<ManialinkManager> logger, IServerClient server,
themeManager.AddThemeAsync<DefaultSeparatorTheme>();
themeManager.AddThemeAsync<DefaultSelectTheme>();
themeManager.AddThemeAsync<DefaultDialogTheme>();
themeManager.AddThemeAsync<DefaultClubTagTheme>();

_engine.GlobalVariables["Util"] = new GlobalManialinkUtils(themeManager);
_engine.GlobalVariables["Icons"] = new GameIcons();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<component>
<property type="double" name="h" />
<property type="int" name="hidden" default="0" />
<property type="bool" name="hidden" default="false" />

<template>
<!-- Club Tag Background -->
<quad id="club_bg"
size="{{ h * 2 }} {{ h }}"
valign="center"
modulatecolor="{{ Theme.ScoreboardModule_ClubTag_Bg }}"
modulatecolor="{{ Theme.UI_ClubTag_Bg }}"
image="file://Media/Manialinks/Nadeo/Trackmania/Menus/PageClub/ClubActivities/Clubs_ActivityIcon_Mask.dds"
alphamask="file://Media/Manialinks/Nadeo/Trackmania/Menus/PageClub/ClubActivities/Clubs_ActivityIcon_Mask.dds"
hidden="{{ hidden }}"
hidden="{{ hidden ? 1 : 0 }}"
/>

<!-- Club Tag Text -->
Expand All @@ -21,8 +21,8 @@
halign="center"
textsize="0.9"
textfont="{{ Font.Regular }}"
hidden="{{ hidden }}"
textcolor="{{ Theme.ScoreboardModule_PlayerRow_Text }}"
hidden="{{ hidden ? 1 : 0 }}"
textcolor="{{ Theme.UI_TextPrimary }}"
/>
</template>
</component>
</component>
Original file line number Diff line number Diff line change
@@ -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<DefaultClubTagTheme>
{
private readonly dynamic _theme = theme.Theme;

public override Task ConfigureAsync()
{
Set("UI.ClubTag.Bg").To(_theme.UI_BgHighlight);

return Task.CompletedTask;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<import component="Scoreboard.Components.PlayerRow.PointsBox" as="PointsBox"/>
<import component="Scoreboard.Components.PlayerRow.PositionBox" as="Position"/>
<import component="Scoreboard.Components.PlayerRow.PlayerActions" as="PlayerActions"/>
<import component="Scoreboard.Components.PlayerRow.ClubTag" as="ClubTag"/>
<import component="EvoSC.Advanced.ClubTag" as="ClubTag"/>

<property type="double" name="w"/>
<property type="double" name="padding"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<component>
<import component="Scoreboard.Components.PlayerRow.ClubTag" as="ClubTag"/>
<import component="EvoSC.Advanced.ClubTag" as="ClubTag"/>

<property type="string" name="backgroundColor"/>
<property type="string" name="headerColor"/>
Expand Down Expand Up @@ -78,7 +78,7 @@

<frame id="name_box" pos="0 {{ h / -2.0 }}">
<ClubTag h="{{ h / 2.0 }}"
hidden="{{ 1 }}"
hidden="{{ true }}"
/>
<label id="name_label"
size="{{ centerBoxWidth - 10.0 }} {{ h }}"
Expand Down
Loading