Files
crystall-punk-14/Content.Client/UserInterface/GhostGui.cs

35 lines
838 B
C#
Raw Normal View History

2020-03-03 20:37:26 +01:00
using System.Data;
2020-04-05 02:29:04 +02:00
using Content.Client.GameObjects.Components.Observer;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Shared.IoC;
namespace Content.Client.UserInterface
{
public class GhostGui : Control
{
2020-03-03 19:10:07 +01:00
public Button ReturnToBody = new Button(){Text = "Return to body"};
private GhostComponent _owner;
public GhostGui(GhostComponent owner)
{
IoCManager.InjectDependencies(this);
2020-03-03 19:10:07 +01:00
_owner = owner;
MouseFilter = MouseFilterMode.Ignore;
2020-03-03 19:10:07 +01:00
ReturnToBody.OnPressed += (args) => { owner.SendReturnToBodyMessage(); };
AddChild(ReturnToBody);
2020-03-03 20:37:26 +01:00
Update();
}
public void Update()
{
ReturnToBody.Disabled = !_owner.CanReturnToBody;
}
}
}