Make grinder use item slots (& misc eject-button changes) (#7197)

This commit is contained in:
Leon Friedrich
2022-03-28 17:03:03 +13:00
committed by GitHub
parent 9cccc6da99
commit 80699543d9
31 changed files with 163 additions and 297 deletions

View File

@@ -1,7 +1,5 @@
using System.Collections.Generic;
using Content.Shared.Containers.ItemSlots;
using Robust.Client.GameObjects;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Prototypes;
using static Content.Shared.Access.Components.SharedIdCardConsoleComponent;
@@ -23,6 +21,10 @@ namespace Content.Client.Access.UI
base.Open();
_window = new IdCardConsoleWindow(this, _prototypeManager) {Title = _entityManager.GetComponent<MetaDataComponent>(Owner.Owner).EntityName};
_window.PrivilegedIdButton.OnPressed += _ => SendMessage(new ItemSlotButtonPressedEvent(PrivilegedIdCardSlotId));
_window.TargetIdButton.OnPressed += _ => SendMessage(new ItemSlotButtonPressedEvent(TargetIdCardSlotId));
_window.OnClose += Close;
_window.OpenCentered();
}
@@ -41,11 +43,6 @@ namespace Content.Client.Access.UI
_window?.UpdateState(castState);
}
public void ButtonPressed(UiButton button)
{
SendMessage(new IdButtonPressedMessage(button));
}
public void SubmitData(string newFullName, string newJobTitle, List<string> newAccessList)
{
if (newFullName.Length > MaxFullNameLength)

View File

@@ -1,13 +1,13 @@
<DefaultWindow xmlns="https://spacestation14.io"
<DefaultWindow xmlns="https://spacestation14.io"
MinSize="650 290">
<BoxContainer Orientation="Vertical">
<GridContainer Columns="3">
<Label Text="{Loc 'id-card-console-window-privileged-id'}" />
<Button Name="PrivilegedIdButton" />
<Button Name="PrivilegedIdButton" Access="Public"/>
<Label Name="PrivilegedIdLabel" />
<Label Text="{Loc 'id-card-console-window-target-id'}" />
<Button Name="TargetIdButton" />
<Button Name="TargetIdButton" Access="Public"/>
<Label Name="TargetIdLabel" />
</GridContainer>
<Control MinSize="0 8" />

View File

@@ -28,9 +28,6 @@ namespace Content.Client.Access.UI
_owner = owner;
PrivilegedIdButton.OnPressed += _ => _owner.ButtonPressed(UiButton.PrivilegedId);
TargetIdButton.OnPressed += _ => _owner.ButtonPressed(UiButton.TargetId);
FullNameLineEdit.OnTextEntered += _ => SubmitData();
FullNameLineEdit.OnTextChanged += _ =>
{