Station records patches (#10636)
This commit is contained in:
@@ -59,7 +59,7 @@ namespace Content.Client.Access.UI
|
||||
_window?.UpdateState(castState);
|
||||
}
|
||||
|
||||
public void SubmitData(string newFullName, string newJobTitle, List<string> newAccessList)
|
||||
public void SubmitData(string newFullName, string newJobTitle, List<string> newAccessList, string newJobPrototype)
|
||||
{
|
||||
if (newFullName.Length > MaxFullNameLength)
|
||||
newFullName = newFullName[..MaxFullNameLength];
|
||||
@@ -70,7 +70,8 @@ namespace Content.Client.Access.UI
|
||||
SendMessage(new WriteToTargetIdMessage(
|
||||
newFullName,
|
||||
newJobTitle,
|
||||
newAccessList));
|
||||
newAccessList,
|
||||
newJobPrototype));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,8 +26,10 @@ namespace Content.Client.Access.UI
|
||||
|
||||
private string? _lastFullName;
|
||||
private string? _lastJobTitle;
|
||||
private string? _lastJobProto;
|
||||
|
||||
public IdCardConsoleWindow(IdCardConsoleBoundUserInterface owner, IPrototypeManager prototypeManager, List<string> accessLevels)
|
||||
public IdCardConsoleWindow(IdCardConsoleBoundUserInterface owner, IPrototypeManager prototypeManager,
|
||||
List<string> accessLevels)
|
||||
{
|
||||
RobustXamlLoader.Load(this);
|
||||
IoCManager.InjectDependencies(this);
|
||||
@@ -101,6 +103,7 @@ namespace Content.Client.Access.UI
|
||||
}
|
||||
|
||||
JobTitleLineEdit.Text = Loc.GetString(job.Name);
|
||||
args.Button.SelectId(args.Id);
|
||||
|
||||
ClearAllAccess();
|
||||
|
||||
@@ -181,17 +184,29 @@ namespace Content.Client.Access.UI
|
||||
}
|
||||
}
|
||||
|
||||
var jobIndex = _jobPrototypeIds.IndexOf(state.TargetIdJobPrototype);
|
||||
if (jobIndex >= 0)
|
||||
{
|
||||
JobPresetOptionButton.SelectId(jobIndex);
|
||||
}
|
||||
|
||||
_lastFullName = state.TargetIdFullName;
|
||||
_lastJobTitle = state.TargetIdJobTitle;
|
||||
_lastJobProto = state.TargetIdJobPrototype;
|
||||
}
|
||||
|
||||
private void SubmitData()
|
||||
{
|
||||
// Don't send this if it isn't dirty.
|
||||
var jobProtoDirty = _lastJobProto != null &&
|
||||
_jobPrototypeIds[JobPresetOptionButton.SelectedId] != _lastJobProto;
|
||||
|
||||
_owner.SubmitData(
|
||||
FullNameLineEdit.Text,
|
||||
JobTitleLineEdit.Text,
|
||||
// Iterate over the buttons dictionary, filter by `Pressed`, only get key from the key/value pair
|
||||
_accessButtons.Where(x => x.Value.Pressed).Select(x => x.Key).ToList());
|
||||
_accessButtons.Where(x => x.Value.Pressed).Select(x => x.Key).ToList(),
|
||||
jobProtoDirty ? _jobPrototypeIds[JobPresetOptionButton.SelectedId] : string.Empty);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -131,11 +131,11 @@ public sealed partial class CrewManifestUi : DefaultWindow
|
||||
|
||||
foreach (var entry in entries)
|
||||
{
|
||||
var name = new Label()
|
||||
var name = new RichTextLabel()
|
||||
{
|
||||
HorizontalExpand = true,
|
||||
Text = entry.Name
|
||||
};
|
||||
name.SetMessage(entry.Name);
|
||||
|
||||
var titleContainer = new BoxContainer()
|
||||
{
|
||||
@@ -143,10 +143,8 @@ public sealed partial class CrewManifestUi : DefaultWindow
|
||||
HorizontalExpand = true
|
||||
};
|
||||
|
||||
var title = new Label()
|
||||
{
|
||||
Text = Loc.GetString(entry.JobTitle)
|
||||
};
|
||||
var title = new RichTextLabel();
|
||||
title.SetMessage(Loc.GetString(entry.JobTitle));
|
||||
|
||||
|
||||
if (rsi != null)
|
||||
|
||||
Reference in New Issue
Block a user