Add scrollable player list to round end menu with OOC Usernames.
This commit is contained in:
@@ -8,13 +8,22 @@ using Robust.Shared.IoC;
|
|||||||
using Robust.Shared.Localization;
|
using Robust.Shared.Localization;
|
||||||
using Robust.Shared.Maths;
|
using Robust.Shared.Maths;
|
||||||
using Content.Client.Utility;
|
using Content.Client.Utility;
|
||||||
|
using Robust.Client.Player;
|
||||||
|
using System.Linq;
|
||||||
|
using static Robust.Client.UserInterface.Controls.ItemList;
|
||||||
|
|
||||||
namespace Content.Client.UserInterface
|
namespace Content.Client.UserInterface
|
||||||
{
|
{
|
||||||
public sealed class RoundEndSummaryWindow : SS14Window
|
public sealed class RoundEndSummaryWindow : SS14Window
|
||||||
{
|
{
|
||||||
|
|
||||||
|
#pragma warning disable 649
|
||||||
|
[Dependency] private IPlayerManager _playerManager;
|
||||||
|
#pragma warning restore 649
|
||||||
|
|
||||||
private readonly int _headerFontSize = 14;
|
private readonly int _headerFontSize = 14;
|
||||||
private VBoxContainer VBox { get; }
|
private VBoxContainer VBox { get; }
|
||||||
|
private ItemList _playerList;
|
||||||
|
|
||||||
protected override Vector2? CustomSize => (520, 580);
|
protected override Vector2? CustomSize => (520, 580);
|
||||||
|
|
||||||
@@ -32,7 +41,7 @@ namespace Content.Client.UserInterface
|
|||||||
|
|
||||||
//Gamemode Name
|
//Gamemode Name
|
||||||
var gamemodeLabel = new RichTextLabel();
|
var gamemodeLabel = new RichTextLabel();
|
||||||
gamemodeLabel.SetMarkup(Loc.GetString("Round of: [color=white]{0}[/color] has ended.", gm));
|
gamemodeLabel.SetMarkup(Loc.GetString("Round of [color=white]{0}[/color] has ended.", gm));
|
||||||
VBox.AddChild(gamemodeLabel);
|
VBox.AddChild(gamemodeLabel);
|
||||||
|
|
||||||
//Duration
|
//Duration
|
||||||
@@ -40,9 +49,27 @@ namespace Content.Client.UserInterface
|
|||||||
roundDurationInfo.SetMarkup(Loc.GetString("The round lasted for [color=yellow]{0}[/color] hours.", duration));
|
roundDurationInfo.SetMarkup(Loc.GetString("The round lasted for [color=yellow]{0}[/color] hours.", duration));
|
||||||
VBox.AddChild(roundDurationInfo);
|
VBox.AddChild(roundDurationInfo);
|
||||||
|
|
||||||
|
|
||||||
|
//Populate list of players.
|
||||||
|
_playerManager = IoCManager.Resolve<IPlayerManager>();
|
||||||
|
_playerList = new ItemList()
|
||||||
|
{
|
||||||
|
SizeFlagsStretchRatio = 8,
|
||||||
|
SizeFlagsVertical = SizeFlags.FillExpand,
|
||||||
|
SelectMode = ItemList.ItemListSelectMode.Button
|
||||||
|
};
|
||||||
|
|
||||||
|
foreach (var session in _playerManager.Sessions.OrderBy(s => s.Name))
|
||||||
|
{
|
||||||
|
var playerOOCName = session.SessionId.Username;
|
||||||
|
//No Mind data so no ICName/Job/Role, etc.
|
||||||
|
_playerList.AddItem(playerOOCName);
|
||||||
|
}
|
||||||
|
VBox.AddChild(_playerList);
|
||||||
OpenCentered();
|
OpenCentered();
|
||||||
MoveToFront();
|
MoveToFront();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user