Fixed bug where ID card computer defaulted to the atmos as the job icon. (#28462)
Fixed ID atmos bug!
This commit is contained in:
@@ -27,6 +27,9 @@ namespace Content.Client.Access.UI
|
|||||||
private string? _lastJobTitle;
|
private string? _lastJobTitle;
|
||||||
private string? _lastJobProto;
|
private string? _lastJobProto;
|
||||||
|
|
||||||
|
// The job that will be picked if the ID doesn't have a job on the station.
|
||||||
|
private static ProtoId<JobPrototype> _defaultJob = "Passenger";
|
||||||
|
|
||||||
public IdCardConsoleWindow(IdCardConsoleBoundUserInterface owner, IPrototypeManager prototypeManager,
|
public IdCardConsoleWindow(IdCardConsoleBoundUserInterface owner, IPrototypeManager prototypeManager,
|
||||||
List<ProtoId<AccessLevelPrototype>> accessLevels)
|
List<ProtoId<AccessLevelPrototype>> accessLevels)
|
||||||
{
|
{
|
||||||
@@ -65,7 +68,6 @@ namespace Content.Client.Access.UI
|
|||||||
}
|
}
|
||||||
|
|
||||||
JobPresetOptionButton.OnItemSelected += SelectJobPreset;
|
JobPresetOptionButton.OnItemSelected += SelectJobPreset;
|
||||||
|
|
||||||
_accessButtons.Populate(accessLevels, prototypeManager);
|
_accessButtons.Populate(accessLevels, prototypeManager);
|
||||||
AccessLevelControlContainer.AddChild(_accessButtons);
|
AccessLevelControlContainer.AddChild(_accessButtons);
|
||||||
|
|
||||||
@@ -172,11 +174,15 @@ namespace Content.Client.Access.UI
|
|||||||
new List<ProtoId<AccessLevelPrototype>>());
|
new List<ProtoId<AccessLevelPrototype>>());
|
||||||
|
|
||||||
var jobIndex = _jobPrototypeIds.IndexOf(state.TargetIdJobPrototype);
|
var jobIndex = _jobPrototypeIds.IndexOf(state.TargetIdJobPrototype);
|
||||||
if (jobIndex >= 0)
|
// If the job index is < 0 that means they don't have a job registered in the station records.
|
||||||
|
// For example, a new ID from a box would have no job index.
|
||||||
|
if (jobIndex < 0)
|
||||||
{
|
{
|
||||||
JobPresetOptionButton.SelectId(jobIndex);
|
jobIndex = _jobPrototypeIds.IndexOf(_defaultJob);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
JobPresetOptionButton.SelectId(jobIndex);
|
||||||
|
|
||||||
_lastFullName = state.TargetIdFullName;
|
_lastFullName = state.TargetIdFullName;
|
||||||
_lastJobTitle = state.TargetIdJobTitle;
|
_lastJobTitle = state.TargetIdJobTitle;
|
||||||
_lastJobProto = state.TargetIdJobPrototype;
|
_lastJobProto = state.TargetIdJobPrototype;
|
||||||
|
|||||||
Reference in New Issue
Block a user