add and fix a lot
This commit is contained in:
@@ -65,8 +65,6 @@ namespace VisibleSpectators
|
||||
|
||||
private void AddPlayerHint(Player player)
|
||||
{
|
||||
if (player == null) return;
|
||||
|
||||
var hint = new Hint
|
||||
{
|
||||
Text = $"{Config!.HeaderMessage}\n{Config!.NoSpectatorsMessage}",
|
||||
@@ -118,6 +116,7 @@ namespace VisibleSpectators
|
||||
private static string PlayerToDisplay(Player player)
|
||||
{
|
||||
if (player == null) return "";
|
||||
if (!player.IsReady) return "";
|
||||
|
||||
// Default color if GroupColor is null or not found in the map
|
||||
const string defaultColor = "FFFFFF";
|
||||
@@ -143,11 +142,6 @@ namespace VisibleSpectators
|
||||
|
||||
private void UpdateSpectators(Player player)
|
||||
{
|
||||
if (player == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Safety check - if player doesn't have a hint, create one
|
||||
if (!_spectatorHints.ContainsKey(player))
|
||||
{
|
||||
@@ -185,7 +179,7 @@ namespace VisibleSpectators
|
||||
|
||||
private static Player[] GetPlayers()
|
||||
{
|
||||
return Player.Dictionary.Values.Where(x=>!x.IsHost).ToArray();
|
||||
return Player.ReadyList.Where(IsNotOverwatch).ToArray();
|
||||
}
|
||||
|
||||
private static void OnSpectate(PlayerChangedSpectatorEventArgs ev)
|
||||
@@ -203,7 +197,7 @@ namespace VisibleSpectators
|
||||
|
||||
public class SpectatorConfig
|
||||
{
|
||||
public string HeaderMessage => "Spectators:";
|
||||
public string NoSpectatorsMessage => "No spectators";
|
||||
public string HeaderMessage { get; set; } = "Spectators:";
|
||||
public string NoSpectatorsMessage { get; set; } = "No spectators";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user