Observers are shown as observers in the RoundEndSummary (#1838)
* Observers are shown as observers in the RoundEndSummary * Fix typo Co-authored-by: DrSmugleaf <DrSmugleaf@users.noreply.github.com>
This commit is contained in:
@@ -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,
|
||||
};
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user