* -Added Crayons + CrayonBox
-Can set any crayon state and color
-Added CrayonDecals

* Allows to cycle through decals (not the final thing)

* ItemStatus

* -UI (WIP)
-Selection thing works
-Changed some shitty state names

* -Icons
-Changed decal name

* Pure Texture Grid

* Charges

* -Reach check
-Toggle interface on use

* Can't draw on windows anymore

* UI now shows selected decal and color

* -UseSound
-Nullable

* Remove unused imports

* -Rotation
-Made decal abstract

* Remove some duplicate images

* Space Cleaner cleans

* Loc Title

Co-authored-by: Pieter-Jan Briers <pieterjan.briers@gmail.com>

* Review adressed

Co-authored-by: Pieter-Jan Briers <pieterjan.briers@gmail.com>
This commit is contained in:
Exp
2020-10-13 13:40:05 +02:00
committed by GitHub
parent cb29db60d1
commit 47ba7fc690
187 changed files with 2393 additions and 1 deletions

View File

@@ -0,0 +1,49 @@
using Content.Shared.GameObjects.Components;
using Robust.Client.GameObjects.Components.UserInterface;
using Robust.Shared.GameObjects.Components.UserInterface;
using Robust.Shared.IoC;
using Robust.Shared.Prototypes;
using System.Linq;
namespace Content.Client.GameObjects.Components.Crayon
{
public class CrayonBoundUserInterface : BoundUserInterface
{
public CrayonBoundUserInterface(ClientUserInterfaceComponent owner, object uiKey) : base(owner, uiKey)
{
}
private CrayonWindow _menu;
protected override void Open()
{
base.Open();
_menu = new CrayonWindow(this);
_menu.OnClose += Close;
var prototypeManager = IoCManager.Resolve<IPrototypeManager>();
var crayonDecals = prototypeManager.EnumeratePrototypes<CrayonDecalPrototype>().FirstOrDefault();
if (crayonDecals != null)
_menu.Populate(crayonDecals);
_menu.OpenCentered();
}
protected override void UpdateState(BoundUserInterfaceState state)
{
base.UpdateState(state);
_menu.UpdateState((CrayonBoundUserInterfaceState) state);
}
public void Select(string state)
{
SendMessage(new CrayonSelectMessage(state));
}
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
_menu.Close();
}
}
}