Skip to content

Commit

Permalink
Scoreboard improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
araszka committed Sep 29, 2024
1 parent d9273a7 commit 6c4d70c
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 37 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ public interface IScoreboardNicknamesService
{
public Task AddNicknameByLoginAsync(string login);

public Task RemoveNicknameAsync(string login);

public Task ClearNicknamesAsync();

public Task LoadNicknamesAsync();
Expand Down
18 changes: 8 additions & 10 deletions src/Modules/ScoreboardModule/ScoreboardModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,16 @@
namespace EvoSC.Modules.Official.ScoreboardModule;

[Module(IsInternal = true)]
public class ScoreboardModule(IScoreboardService scoreboardService, IScoreboardNicknamesService nicknamesService) : EvoScModule, IToggleable
public class ScoreboardModule(IScoreboardService scoreboardService, IScoreboardNicknamesService nicknamesService)
: EvoScModule, IToggleable
{
public Task EnableAsync()
public async Task EnableAsync()
{
nicknamesService.LoadNicknamesAsync();
scoreboardService.HideNadeoScoreboardAsync();

return scoreboardService.SendScoreboardAsync();
await nicknamesService.LoadNicknamesAsync();
await scoreboardService.HideNadeoScoreboardAsync();
await scoreboardService.SendScoreboardAsync();
}

public Task DisableAsync()
{
return scoreboardService.ShowNadeoScoreboardAsync();
}
public Task DisableAsync() =>
scoreboardService.ShowNadeoScoreboardAsync();
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,6 @@ public async Task AddNicknameByLoginAsync(string login)
_nicknames[login] = player.NickName;
}

public Task RemoveNicknameAsync(string login)
{
_nicknames.Remove(login);

return Task.CompletedTask;
}

public Task ClearNicknamesAsync()
{
_nicknames.Clear();
Expand Down
6 changes: 5 additions & 1 deletion src/Modules/ScoreboardModule/Templates/Scoreboard.mt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<property type="double" name="legendHeight" default="3.8"/>
<property type="int" name="actionButtonCount" default="2"/>

<template layer="ScoresTable_x">
<template layer="ScoresTable">
<!-- UI Styles -->
<UIStyle/>

Expand Down Expand Up @@ -151,6 +151,10 @@
out ^= "0";
}

if(points == "0"){
return out ^ points;
}

return out ^ primaryTextColor ^ points;
}

Expand Down

0 comments on commit 6c4d70c

Please sign in to comment.