Admin playerlist antag presentation rework (#35538)

* refactor(src): Minor refactor of Draw in "AdminNameOverlay. And new info about playtime player

* fix(src): Add configure classic admin owerlay

* fix

* antag status indication rework

* the cvars are free, you can just take them

* update playerlist on cvar change

* more overlay options

* tweak(src): Use _antagLabelClassic and tweak style

* tweak(src): Add config display overlay for startingJob and playTime

* tweak(src): Vector2 is replaced by var

* tweak(src): return to the end of the list

* add new option checkboxes

* passing ConfigurationManager through constructor, some format changes

* made sorting values more futureproof

* comments

* labels

* no point commenting this out when the overlay stack PR will uncomment it again anyway

* sorting prototype

* localize symbols because why not

* symmetry

* Revert "localize symbols because why not"

This reverts commit 922d4030300285a45777d62fcfd9c74b25fe7a60.

* layout and formatting stuff

* fix errant space

---------

Co-authored-by: Schrödinger <132720404+Schrodinger71@users.noreply.github.com>
This commit is contained in:
Errant
2025-03-25 17:03:59 +01:00
committed by GitHub
parent 1b74de6dbb
commit 72141abf8a
19 changed files with 199 additions and 58 deletions

View File

@@ -211,20 +211,30 @@ public abstract class SharedRoleSystem : EntitySystem
return true;
}
/// <summary>
/// Return the most recently specified role type, or Neutral
/// </summary>
private ProtoId<RoleTypePrototype> GetRoleTypeByTime(MindComponent mind)
{
// If any Mind Roles specify a Role Type, return the most recent. Otherwise return Neutral
var role = GetRoleCompByTime(mind);
return role?.Comp?.RoleType ?? "Neutral";
}
var roles = new List<ProtoId<RoleTypePrototype>>();
/// <summary>
/// Return the most recently specified role type's mind role entity, or null
/// </summary>
public Entity<MindRoleComponent>? GetRoleCompByTime(MindComponent mind)
{
var roles = new List<Entity<MindRoleComponent>>();
foreach (var role in mind.MindRoles)
{
var comp = Comp<MindRoleComponent>(role);
if (comp.RoleType is not null)
roles.Add(comp.RoleType.Value);
roles.Add((role, comp));
}
ProtoId<RoleTypePrototype> result = (roles.Count > 0) ? roles.LastOrDefault() : "Neutral";
Entity<MindRoleComponent>? result = roles.Count > 0 ? roles.LastOrDefault() : null;
return (result);
}