Skip to content

Commit

Permalink
Merge branch 'master' into 149-team-info-module
Browse files Browse the repository at this point in the history
  • Loading branch information
araszka authored Aug 2, 2024
2 parents 024b657 + a19a24b commit 2b59d19
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 17 deletions.
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>
16 changes: 8 additions & 8 deletions src/EvoSC.Manialinks/Templates/Containers/Widget.mt
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@
<property type="double" name="cellsize" default="10" /> <!-- If true, position and size acts on the grid system -->

<template>
<frame pos='{{ (position == "left" ? -160 + padding : 160-width - padding ) }} {{ y }}'>
<frame pos='{{ (position == "left" ? -160 + padding : 160-width - padding - 0.7 ) }} {{ y }}'>
<frame if='header != ""'>
<quad
bgcolor="{{ Theme.UI_HeaderBg }}"
size="{{ width }} 4.5"
opacity="0.95"
pos="0.7 0"
pos='{{ position == "left" ? 0.7 : 0 }} 0'
if='headerStyle.ToLower() == "normal"'
/>
<quad
bgcolor="{{ Theme.UI_AccentPrimary }}"
size="0.7 4.5"
pos="0 0"
pos='{{ position == "left" ? 0 : width }} 0'
if='headerStyle.ToLower() == "normal"'
/>
<label
Expand All @@ -42,15 +42,15 @@
<frame pos='0 {{ -4.5 - (header == "" ? 0 : 0.3) }}'>
<quad
size="{{ width }} {{ height }}"
bgcolor="2C2D34"
bgcolor="{{ Theme.UI_BgPrimary }}"
opacity="0.9"
pos="1 0"
pos='{{ position == "left" ? 0.7 : 0 }} 0'
if='bodyStyle.ToLower() == "normal"'
/>
<quad
size="1 {{ height }}"
pos="0 0"
bgcolor="ff0058"
size="0.7 {{ height }}"
pos='{{ position == "left" ? 0 : width }} 0'
bgcolor="{{ Theme.UI_AccentPrimary }}"
if='bodyStyle.ToLower() == "normal"'
/>
<slot name="body" />
Expand Down
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

0 comments on commit 2b59d19

Please sign in to comment.