* PlayerListControl fixes. Fix a button being selected by default always, which then can't be selected properly for real. This affected multiple admin UIs. This broke due to upstream RT changes but ButtonGroup was always kinda busted so whatever. Uses the new IsNoneSetAllowed to implement everything properly. Also make sure the selected player STAYS selected when filtering the list and stuff. Also this PlayerInfo record has been changed to only do equality on the User ID because otherwise it'd need to compare each field individually which would be weird. * Revert changes to ListContainer This change was made default in the engine, no longer necessary here.
35 lines
897 B
C#
35 lines
897 B
C#
using Robust.Shared.Network;
|
|
using Robust.Shared.Serialization;
|
|
|
|
namespace Content.Shared.Administration
|
|
{
|
|
[Serializable, NetSerializable]
|
|
public sealed record PlayerInfo(
|
|
string Username,
|
|
string CharacterName,
|
|
string IdentityName,
|
|
string StartingJob,
|
|
bool Antag,
|
|
NetEntity? NetEntity,
|
|
NetUserId SessionId,
|
|
bool Connected,
|
|
bool ActiveThisRound,
|
|
TimeSpan? OverallPlaytime)
|
|
{
|
|
private string? _playtimeString;
|
|
|
|
public string PlaytimeString => _playtimeString ??=
|
|
OverallPlaytime?.ToString("%d':'hh':'mm") ?? Loc.GetString("generic-unknown-title");
|
|
|
|
public bool Equals(PlayerInfo? other)
|
|
{
|
|
return other?.SessionId == SessionId;
|
|
}
|
|
|
|
public override int GetHashCode()
|
|
{
|
|
return SessionId.GetHashCode();
|
|
}
|
|
}
|
|
}
|