mirror of
https://github.com/DeltaV-Station/Delta-v.git
synced 2026-10-03 17:47:29 +00:00
* make jugg not atmos hardsuit reable lmao * re machine yaml refactor * use the enum name to localize re results * move a lot of code to shared and refactor * clientside rework * add test for missing recipes * untroll * make exped board recipe yml consistent with upstream * fix unearthed sneaky bugs + generic does nothing so remove * add mass media console board, remove roundstart boards from dynamic recipes * remove roundstart stuff, add rcd ammo to protolathe * dont dupe because of access electronics prototypes * fix final fails * final untroll * final untroll 2 --------- Co-authored-by: deltanedas <@deltanedas:kde.org> Co-authored-by: Null <56081759+NullWanderer@users.noreply.github.com>
81 lines
2.0 KiB
C#
81 lines
2.0 KiB
C#
using Content.Shared.ReverseEngineering;
|
|
using Robust.Client.GameObjects;
|
|
using Robust.Shared.Timing;
|
|
|
|
namespace Content.Client.Nyanotrasen.ReverseEngineering;
|
|
|
|
public sealed class ReverseEngineeringMachineBoundUserInterface : BoundUserInterface
|
|
{
|
|
[Dependency] private readonly IEntityManager _entMan = default!;
|
|
[Dependency] private readonly IGameTiming _timing = default!;
|
|
|
|
private ReverseEngineeringMachineMenu? _menu;
|
|
|
|
public ReverseEngineeringMachineBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
|
{
|
|
}
|
|
|
|
protected override void Open()
|
|
{
|
|
base.Open();
|
|
|
|
if (_menu != null)
|
|
return;
|
|
|
|
_menu = new ReverseEngineeringMachineMenu(Owner, _entMan, _timing);
|
|
|
|
_menu.OnClose += Close;
|
|
_menu.OpenCentered();
|
|
|
|
_menu.OnScanButtonPressed += () =>
|
|
{
|
|
// every button flickering is bad so no prediction
|
|
SendMessage(new ReverseEngineeringScanMessage());
|
|
};
|
|
|
|
_menu.OnSafetyButtonToggled += () =>
|
|
{
|
|
SendPredictedMessage(new ReverseEngineeringSafetyMessage());
|
|
};
|
|
|
|
_menu.OnAutoScanButtonToggled += () =>
|
|
{
|
|
SendPredictedMessage(new ReverseEngineeringAutoScanMessage());
|
|
};
|
|
|
|
_menu.OnStopButtonPressed += () =>
|
|
{
|
|
// see scan button
|
|
SendMessage(new ReverseEngineeringStopMessage());
|
|
};
|
|
|
|
_menu.OnEjectButtonPressed += () =>
|
|
{
|
|
// doesn't sound nice when predicted
|
|
SendMessage(new ReverseEngineeringEjectMessage());
|
|
};
|
|
}
|
|
|
|
protected override void UpdateState(BoundUserInterfaceState state)
|
|
{
|
|
base.UpdateState(state);
|
|
|
|
if (state is not ReverseEngineeringMachineState cast)
|
|
return;
|
|
|
|
_menu?.UpdateState(cast);
|
|
}
|
|
|
|
protected override void Dispose(bool disposing)
|
|
{
|
|
base.Dispose(disposing);
|
|
|
|
if (!disposing)
|
|
return;
|
|
|
|
_menu?.Close();
|
|
_menu?.Dispose();
|
|
}
|
|
}
|
|
|