QoL для ХоПа (#369)

* add: nice job icons ui for HoP console

* Ebanniy rot

* add: Changing id visuals with HoP console

* cleanup

* add: remove drop down list and replace it with icon-buttons

* add: colored and sorted by department buttons

* add: columns

* tweak: nicer colors

* cleanup
This commit is contained in:
ThereDrD0
2024-06-20 22:29:26 +03:00
committed by GitHub
parent 76e46de7e9
commit cb37ba5714
12 changed files with 332 additions and 122 deletions

View File

@@ -2,6 +2,7 @@ using System.Linq;
using Content.Server.Administration.Logs;
using Content.Server.Kitchen.Components;
using Content.Server.Popups;
using Content.Shared._White.NiceIdCards;
using Content.Shared.Access;
using Content.Shared.Access.Components;
using Content.Shared.Access.Systems;
@@ -9,6 +10,7 @@ using Content.Shared.Database;
using Content.Shared.Popups;
using Content.Shared.Roles;
using Content.Shared.StatusIcon;
using Robust.Server.GameObjects;
using Robust.Shared.Prototypes;
using Robust.Shared.Random;
@@ -21,6 +23,7 @@ public sealed class IdCardSystem : SharedIdCardSystem
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
[Dependency] private readonly MetaDataSystem _metaSystem = default!;
[Dependency] private readonly SharedAppearanceSystem _sharedAppearance = default!;
public override void Initialize()
{
@@ -144,6 +147,17 @@ public sealed class IdCardSystem : SharedIdCardSystem
return true;
}
public bool TryChangeVisuals(EntityUid uid, string jobIconName, IdCardComponent? id = null)
{
if (!Resolve(uid, ref id))
return false;
var name = jobIconName.Replace("JobIcon", "");
_sharedAppearance.SetData(uid, IdVisuals.State, name);
return true;
}
public bool TryChangeJobDepartment(EntityUid uid, JobPrototype job, IdCardComponent? id = null)
{
if (!Resolve(uid, ref id))