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