- fix: Job icon fixes (#38)
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -76,7 +76,12 @@ public sealed class ShowSecurityIconsSystem : EquipmentHudSystem<ShowSecurityIco
|
||||
if (_prototypeMan.TryIndex<StatusIconPrototype>(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<StatusIconPrototype>(JobIconForNoId));
|
||||
}
|
||||
// WD EDIT END
|
||||
|
||||
if (TryComp<MindShieldComponent>(uid, out var comp))
|
||||
{
|
||||
|
||||
@@ -85,14 +85,13 @@ public sealed class IdCardConsoleSystem : SharedIdCardConsoleSystem
|
||||
var targetAccessComponent = EntityManager.GetComponent<AccessComponent>(targetId);
|
||||
|
||||
var jobProto = string.Empty;
|
||||
var jobIcon = string.Empty; //WD-EDIT
|
||||
var jobIcon = targetIdComponent.JobIcon; //WD-EDIT
|
||||
|
||||
if (TryComp<StationRecordKeyStorageComponent>(targetId, out var keyStorage)
|
||||
&& keyStorage.Key is {} key
|
||||
&& _record.TryGetRecord<GeneralStationRecord>(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<IdCardComponent>(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<JobPrototype>(newJobProto, out var job)
|
||||
&& _prototype.TryIndex<StatusIconPrototype>(job.Icon, out var jobIcon))
|
||||
// WD EDIT START
|
||||
if (_prototype.TryIndex<JobPrototype>(newJobProto, out var job))
|
||||
newJobIcon ??= job.Icon;
|
||||
|
||||
if (newJobIcon != null && _prototype.TryIndex<StatusIconPrototype>(newJobIcon, out var jobIcon)) // WD EDIT END
|
||||
{
|
||||
_idCard.TryChangeJobIcon(targetId, jobIcon, player: player);
|
||||
}
|
||||
|
||||
@@ -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"
|
||||
};
|
||||
|
||||
@@ -661,6 +661,13 @@
|
||||
- JobIconZookeeper
|
||||
- JobIconInspector
|
||||
- JobIconVisitor
|
||||
- JobIconNoId
|
||||
- JobIconCustomId
|
||||
- JobIconBorg
|
||||
- JobIconSeniorPhysician
|
||||
- JobIconSeniorOfficer
|
||||
- JobIconSeniorEngineer
|
||||
- JobIconSeniorResearcher
|
||||
- type: ActivatableUI
|
||||
key: enum.AgentIDCardUiKey.Key
|
||||
inHandsOnly: true
|
||||
|
||||
Reference in New Issue
Block a user