diff --git a/Content.Client/UserInterface/RoundEndSummaryWindow.cs b/Content.Client/UserInterface/RoundEndSummaryWindow.cs index 8d40c0b8ba..2fdfac0e2c 100644 --- a/Content.Client/UserInterface/RoundEndSummaryWindow.cs +++ b/Content.Client/UserInterface/RoundEndSummaryWindow.cs @@ -69,8 +69,8 @@ namespace Content.Client.UserInterface scrollContainer.SizeFlagsVertical = SizeFlags.FillExpand; var innerScrollContainer = new VBoxContainer(); - //Put antags on top of the list. - var manifestSortedList = info.OrderBy(p => !p.Antag); + //Put observers at the bottom of the list. Put antags on top. + var manifestSortedList = info.OrderBy(p => p.Observer).ThenBy(p => !p.Antag); //Create labels for each player info. foreach (var plyinfo in manifestSortedList) { @@ -79,12 +79,21 @@ namespace Content.Client.UserInterface SizeFlagsVertical = SizeFlags.Fill, }; - //TODO: On Hover display a popup detailing more play info. - //For example: their antag goals and if they completed them sucessfully. - var icNameColor = plyinfo.Antag ? "red" : "white"; - playerInfoText.SetMarkup( - Loc.GetString("[color=gray]{0}[/color] was [color={1}]{2}[/color] playing role of [color=orange]{3}[/color].", - plyinfo.PlayerOOCName, icNameColor, plyinfo.PlayerICName, Loc.GetString(plyinfo.Role))); + if (plyinfo.Observer) + { + playerInfoText.SetMarkup( + Loc.GetString("[color=gray]{0}[/color] was [color=lightblue]{1}[/color], an observer.", + plyinfo.PlayerOOCName, plyinfo.PlayerICName)); + } + else + { + //TODO: On Hover display a popup detailing more play info. + //For example: their antag goals and if they completed them sucessfully. + var icNameColor = plyinfo.Antag ? "red" : "white"; + playerInfoText.SetMarkup( + Loc.GetString("[color=gray]{0}[/color] was [color={1}]{2}[/color] playing role of [color=orange]{3}[/color].", + plyinfo.PlayerOOCName, icNameColor, plyinfo.PlayerICName, Loc.GetString(plyinfo.Role))); + } innerScrollContainer.AddChild(playerInfoText); } diff --git a/Content.Server/GameTicking/GameTicker.cs b/Content.Server/GameTicking/GameTicker.cs index 78f17b8e78..da6f17c9da 100644 --- a/Content.Server/GameTicking/GameTicker.cs +++ b/Content.Server/GameTicking/GameTicker.cs @@ -352,6 +352,7 @@ namespace Content.Server.GameTicking var mind = ply.ContentData().Mind; if (mind != null) { + _playersInLobby.TryGetValue(ply, out var status); var antag = mind.AllRoles.Any(role => role.Antagonist); var playerEndRoundInfo = new RoundEndPlayerInfo() { @@ -360,7 +361,8 @@ namespace Content.Server.GameTicking Role = antag ? mind.AllRoles.First(role => role.Antagonist).Name : mind.AllRoles.FirstOrDefault()?.Name ?? Loc.GetString("Unknown"), - Antag = antag + Antag = antag, + Observer = status == PlayerStatus.Observer, }; listOfPlayerInfo.Add(playerEndRoundInfo); } diff --git a/Content.Shared/SharedGameTicker.cs b/Content.Shared/SharedGameTicker.cs index 077f4c71b0..7d2f5c8464 100644 --- a/Content.Shared/SharedGameTicker.cs +++ b/Content.Shared/SharedGameTicker.cs @@ -238,6 +238,7 @@ namespace Content.Shared public string PlayerICName; public string Role; public bool Antag; + public bool Observer; } protected class MsgRoundEndMessage : NetMessage @@ -279,7 +280,8 @@ namespace Content.Shared PlayerOOCName = buffer.ReadString(), PlayerICName = buffer.ReadString(), Role = buffer.ReadString(), - Antag = buffer.ReadBoolean() + Antag = buffer.ReadBoolean(), + Observer = buffer.ReadBoolean(), }; AllPlayersEndInfo.Add(readPlayerData); @@ -303,6 +305,7 @@ namespace Content.Shared buffer.Write(playerEndInfo.PlayerICName); buffer.Write(playerEndInfo.Role); buffer.Write(playerEndInfo.Antag); + buffer.Write(playerEndInfo.Observer); } }