Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Misfiy committed May 11, 2024
1 parent db824cb commit 934a55e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 6 additions & 1 deletion SpectatorList/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,16 @@ public class Config : IConfig
{
public bool IsEnabled { get; set; } = true;
public bool Debug { get; set; } = false;

[Description("A list of teams the hints should be hidden for")]
public List<Team> HiddenFor { get; set; } = new List<Team>();

[Description("How often in seconds to refresh the hud")]
public float RefreshRate { get; set; } = 2;
public string FullText { get; set; } = "<size=23><align=right><voffset=750>%display%</size></voffset></align>";

public string FullText { get; set; } = "<size=23><align=right>%display%</size><voffset=900> </voffset></align>";
public string PlayerDisplay { get; set; } = "-> %name%";
public string NoSpectators { get; set; } = "No one is currently spectating you.";
public string Spectators { get; set; } = "👥 Spectators (%amount%)";
}
}
4 changes: 3 additions & 1 deletion SpectatorList/EventHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ private IEnumerator<float> DoList()
int count = player.CurrentSpectatingPlayers.Count(p => p.Role != RoleTypeId.Overwatch);

StringBuilder sb = new StringBuilder();
sb.AppendLine($"{count} players are spectating{(count == 0 ? string.Empty : ":")}");
sb.AppendLine(count == 0
? _config.NoSpectators
: _config.Spectators.Replace("%amount%", count.ToString()));

foreach (Player spectator in player.CurrentSpectatingPlayers.Where(p => p.Role != RoleTypeId.Overwatch))
sb.AppendLine(_config.PlayerDisplay.Replace("%name%", spectator.CustomName));
Expand Down

0 comments on commit 934a55e

Please sign in to comment.