diff --git a/Content.Client/Access/UI/IdCardConsoleWindow.xaml.cs b/Content.Client/Access/UI/IdCardConsoleWindow.xaml.cs index 0224d36d19..815728fb70 100644 --- a/Content.Client/Access/UI/IdCardConsoleWindow.xaml.cs +++ b/Content.Client/Access/UI/IdCardConsoleWindow.xaml.cs @@ -127,7 +127,7 @@ namespace Content.Client.Access.UI _jobIconButtons.Add(jobIcon, newButton); newButton.OnPressed += _ => { - _lastJobIcon = jobIcon; + _lastJobIcon = "JobIcon" + jobIcon; SubmitData(); }; @@ -279,7 +279,7 @@ namespace Content.Client.Access.UI foreach (var (jobIcon, button) in _jobIconButtons) { button.Disabled = !interfaceEnabled; - button.Pressed = state.TargetIdJobIcon == jobIcon; + button.Pressed = state.TargetIdJobIcon?.Contains(jobIcon) ?? false; } //WD-EDIT diff --git a/Content.Client/Overlays/ShowSecurityIconsSystem.cs b/Content.Client/Overlays/ShowSecurityIconsSystem.cs index b13d069ef4..ddf827cc03 100644 --- a/Content.Client/Overlays/ShowSecurityIconsSystem.cs +++ b/Content.Client/Overlays/ShowSecurityIconsSystem.cs @@ -76,7 +76,12 @@ public sealed class ShowSecurityIconsSystem : EquipmentHudSystem(jobIconToGet, out var jobIcon)) result.Add(jobIcon); else - Log.Error($"Invalid job icon prototype: {jobIcon}"); + // WD EDIT START + { + Log.Error($"Invalid job icon prototype: {jobIconToGet}"); + result.Add(_prototypeMan.Index(JobIconForNoId)); + } + // WD EDIT END if (TryComp(uid, out var comp)) { diff --git a/Content.Server/Access/Systems/IdCardConsoleSystem.cs b/Content.Server/Access/Systems/IdCardConsoleSystem.cs index eb04484dcb..3b102d4c3a 100644 --- a/Content.Server/Access/Systems/IdCardConsoleSystem.cs +++ b/Content.Server/Access/Systems/IdCardConsoleSystem.cs @@ -85,14 +85,13 @@ public sealed class IdCardConsoleSystem : SharedIdCardConsoleSystem var targetAccessComponent = EntityManager.GetComponent(targetId); var jobProto = string.Empty; - var jobIcon = string.Empty; //WD-EDIT + var jobIcon = targetIdComponent.JobIcon; //WD-EDIT if (TryComp(targetId, out var keyStorage) && keyStorage.Key is {} key && _record.TryGetRecord(key, out var record)) { jobProto = record.JobPrototype; - jobIcon = record.JobIcon; Dirty(targetId, targetIdComponent); } @@ -135,18 +134,14 @@ public sealed class IdCardConsoleSystem : SharedIdCardConsoleSystem if (component.TargetIdSlot.Item is not { Valid: true } targetId || !PrivilegedIdIsAuthorized(uid, component)) return; - //WD-EDIT - if (TryComp(targetId, out var idCardComponent) && newJobIcon != null) - { - idCardComponent.JobIcon = newJobIcon; - } - //WD-EDIT - _idCard.TryChangeFullName(targetId, newFullName, player: player); _idCard.TryChangeJobTitle(targetId, newJobTitle, player: player); - if (_prototype.TryIndex(newJobProto, out var job) - && _prototype.TryIndex(job.Icon, out var jobIcon)) + // WD EDIT START + if (_prototype.TryIndex(newJobProto, out var job)) + newJobIcon ??= job.Icon; + + if (newJobIcon != null && _prototype.TryIndex(newJobIcon, out var jobIcon)) // WD EDIT END { _idCard.TryChangeJobIcon(targetId, jobIcon, player: player); } diff --git a/Content.Shared/Access/Components/IdCardConsoleComponent.cs b/Content.Shared/Access/Components/IdCardConsoleComponent.cs index 34daf45077..d2ff7b281f 100644 --- a/Content.Shared/Access/Components/IdCardConsoleComponent.cs +++ b/Content.Shared/Access/Components/IdCardConsoleComponent.cs @@ -42,7 +42,7 @@ public sealed partial class IdCardConsoleComponent : Component JobTitle = jobTitle; AccessList = accessList; JobPrototype = jobPrototype; - SelectedIcon = "JobIcon" + selectedIcon; + SelectedIcon = selectedIcon; } } @@ -89,6 +89,7 @@ public sealed partial class IdCardConsoleComponent : Component { "AtmosphericTechnician", "Bartender", + "Borg", "Botanist", "Boxer", "Brigmedic", @@ -100,10 +101,12 @@ public sealed partial class IdCardConsoleComponent : Component "ChiefEngineer", "ChiefMedicalOfficer", "Clown", + "CustomId", "Detective", "Geneticist", "HeadOfPersonnel", "HeadOfSecurity", + "Inspector", "Janitor", "Lawyer", "Librarian", @@ -124,12 +127,14 @@ public sealed partial class IdCardConsoleComponent : Component "SecurityOfficer", "SeniorEngineer", "SeniorOfficer", + "SeniorPhysician", "SeniorResearcher", "ServiceWorker", "ShaftMiner", "StationEngineer", "TechnicalAssistant", "Virologist", + "Visitor", "Warden", "Zookeeper" }; diff --git a/Resources/Prototypes/Entities/Objects/Misc/identification_cards.yml b/Resources/Prototypes/Entities/Objects/Misc/identification_cards.yml index 3df267555e..85097ad582 100644 --- a/Resources/Prototypes/Entities/Objects/Misc/identification_cards.yml +++ b/Resources/Prototypes/Entities/Objects/Misc/identification_cards.yml @@ -661,6 +661,13 @@ - JobIconZookeeper - JobIconInspector - JobIconVisitor + - JobIconNoId + - JobIconCustomId + - JobIconBorg + - JobIconSeniorPhysician + - JobIconSeniorOfficer + - JobIconSeniorEngineer + - JobIconSeniorResearcher - type: ActivatableUI key: enum.AgentIDCardUiKey.Key inHandsOnly: true