Add placeholder ghost UI, ghost component
This commit is contained in:
53
Content.Client/Observer/GhostComponent.cs
Normal file
53
Content.Client/Observer/GhostComponent.cs
Normal file
@@ -0,0 +1,53 @@
|
||||
using Content.Client.UserInterface;
|
||||
using Content.Shared.Observer;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Interfaces.GameObjects;
|
||||
using Robust.Shared.Interfaces.Network;
|
||||
using Robust.Shared.IoC;
|
||||
|
||||
namespace Content.Client.Observer
|
||||
{
|
||||
[RegisterComponent]
|
||||
public class GhostComponent : SharedGhostComponent
|
||||
{
|
||||
private GhostGui _gui;
|
||||
|
||||
#pragma warning disable 649
|
||||
[Dependency] private readonly IGameHud _gameHud;
|
||||
#pragma warning restore 649
|
||||
|
||||
public override void OnRemove()
|
||||
{
|
||||
base.OnRemove();
|
||||
|
||||
_gui?.Dispose();
|
||||
}
|
||||
|
||||
public override void HandleMessage(ComponentMessage message, INetChannel netChannel = null,
|
||||
IComponent component = null)
|
||||
{
|
||||
base.HandleMessage(message, netChannel, component);
|
||||
|
||||
switch (message)
|
||||
{
|
||||
case PlayerAttachedMsg _:
|
||||
if (_gui == null)
|
||||
{
|
||||
_gui = new GhostGui();
|
||||
}
|
||||
else
|
||||
{
|
||||
_gui.Parent?.RemoveChild(_gui);
|
||||
}
|
||||
|
||||
_gameHud.HandsContainer.AddChild(_gui);
|
||||
break;
|
||||
|
||||
case PlayerDetachedMsg _:
|
||||
_gui.Parent?.RemoveChild(_gui);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
18
Content.Client/UserInterface/GhostGui.cs
Normal file
18
Content.Client/UserInterface/GhostGui.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using Robust.Client.UserInterface;
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
using Robust.Shared.IoC;
|
||||
|
||||
namespace Content.Client.UserInterface
|
||||
{
|
||||
public class GhostGui : Control
|
||||
{
|
||||
public GhostGui()
|
||||
{
|
||||
IoCManager.InjectDependencies(this);
|
||||
|
||||
MouseFilter = MouseFilterMode.Ignore;
|
||||
|
||||
AddChild(new Label(){Text = "YES THIS IS GHOST WHOOOOOO"});
|
||||
}
|
||||
}
|
||||
}
|
||||
9
Content.Shared/Observer/SharedGhostComponent.cs
Normal file
9
Content.Shared/Observer/SharedGhostComponent.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
using Robust.Shared.GameObjects;
|
||||
|
||||
namespace Content.Shared.Observer
|
||||
{
|
||||
public class SharedGhostComponent : Component
|
||||
{
|
||||
public override string Name => "Ghost";
|
||||
}
|
||||
}
|
||||
@@ -15,3 +15,4 @@
|
||||
- type: Examiner
|
||||
DoRangeCheck: false
|
||||
- type: IgnorePause
|
||||
- type: Ghost
|
||||
|
||||
Reference in New Issue
Block a user