Body System Part 1 POGGERS!!! (#855)

This commit is contained in:
GlassEclipse
2020-05-13 14:48:49 -05:00
committed by GitHub
parent c9ce38a6a7
commit 27d27f2b59
66 changed files with 2794 additions and 1 deletions

View File

@@ -0,0 +1,53 @@
using Content.Client.UserInterface;
using Content.Shared.BodySystem;
using Robust.Client.GameObjects.Components.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Shared.GameObjects.Components.UserInterface;
using Robust.Shared.ViewVariables;
using System.Collections.Generic;
namespace Content.Client.BodySystem
{
public class BodyScannerBoundUserInterface : BoundUserInterface
{
[ViewVariables]
private BodyScannerDisplay _display;
[ViewVariables]
private BodyScannerTemplateData _template;
[ViewVariables]
private Dictionary<string, BodyScannerBodyPartData> _parts;
public BodyScannerBoundUserInterface(ClientUserInterfaceComponent owner, object uiKey) : base(owner, uiKey)
{
}
protected override void Open()
{
base.Open();
_display = new BodyScannerDisplay(this);
_display.OnClose += Close;
_display.OpenCentered();
}
protected override void UpdateState(BoundUserInterfaceState state)
{
base.UpdateState(state);
if (!(state is BodyScannerInterfaceState scannerState))
return;
_template = scannerState.Template;
_parts = scannerState.Parts;
_display.UpdateDisplay(_template, _parts);
}
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
}
}
}