Admin ghosts can now interact with stuff (#4178)
* Ghosts now have a bool for interacting with stuff * Wrong ghost * Simping for Swept * Merge cleanup * IT'S ODNE Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
This commit is contained in:
@@ -3,6 +3,7 @@ using Content.Shared.Ghost;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Client.Player;
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
|
||||
@@ -62,6 +63,7 @@ namespace Content.Client.Ghost
|
||||
private void OnGhostRemove(EntityUid uid, GhostComponent component, ComponentRemove args)
|
||||
{
|
||||
component.Gui?.Dispose();
|
||||
component.Gui = null;
|
||||
|
||||
// PlayerDetachedMsg might not fire due to deletion order so...
|
||||
if (component.IsAttached)
|
||||
@@ -72,15 +74,12 @@ namespace Content.Client.Ghost
|
||||
|
||||
private void OnGhostPlayerAttach(EntityUid uid, GhostComponent component, PlayerAttachedEvent playerAttachedEvent)
|
||||
{
|
||||
// I hate UI I hate UI I Hate UI
|
||||
if (component.Gui == null)
|
||||
{
|
||||
component.Gui = new GhostGui(component, EntityManager.EntityNetManager!);
|
||||
component.Gui.Update();
|
||||
}
|
||||
else
|
||||
{
|
||||
component.Gui.Orphan();
|
||||
}
|
||||
|
||||
_gameHud.HandsContainer.AddChild(component.Gui);
|
||||
GhostVisibility = true;
|
||||
|
||||
@@ -339,10 +339,11 @@ namespace Content.Client.HUD
|
||||
LC.SetMarginBottom(centerBottomContainer, -10f);
|
||||
RootControl.AddChild(centerBottomContainer);
|
||||
|
||||
HandsContainer = new Control
|
||||
HandsContainer = new BoxContainer()
|
||||
{
|
||||
VerticalAlignment = Control.VAlignment.Bottom,
|
||||
HorizontalAlignment = Control.HAlignment.Center
|
||||
HorizontalAlignment = Control.HAlignment.Center,
|
||||
Orientation = LayoutOrientation.Vertical,
|
||||
};
|
||||
BottomRightInventoryQuickButtonContainer = new BoxContainer
|
||||
{
|
||||
|
||||
@@ -128,6 +128,7 @@ namespace Content.Client.Hands
|
||||
{
|
||||
component.Gui = new HandsGui(component, this);
|
||||
_gameHud.HandsContainer.AddChild(component.Gui);
|
||||
component.Gui.SetPositionFirst();
|
||||
}
|
||||
|
||||
private static void HandlePlayerDetached(EntityUid uid, HandsComponent component, PlayerDetachedEvent args)
|
||||
|
||||
@@ -76,6 +76,17 @@ namespace Content.Client.Input
|
||||
common.AddFunction(ContentKeyFunctions.Loadout8);
|
||||
common.AddFunction(ContentKeyFunctions.Loadout9);
|
||||
|
||||
var aghost = contexts.New("aghost", "common");
|
||||
aghost.AddFunction(EngineKeyFunctions.MoveUp);
|
||||
aghost.AddFunction(EngineKeyFunctions.MoveDown);
|
||||
aghost.AddFunction(EngineKeyFunctions.MoveLeft);
|
||||
aghost.AddFunction(EngineKeyFunctions.MoveRight);
|
||||
aghost.AddFunction(EngineKeyFunctions.Walk);
|
||||
aghost.AddFunction(ContentKeyFunctions.OpenContextMenu);
|
||||
aghost.AddFunction(ContentKeyFunctions.SwapHands);
|
||||
aghost.AddFunction(ContentKeyFunctions.Drop);
|
||||
aghost.AddFunction(ContentKeyFunctions.ThrowItemInHand);
|
||||
|
||||
var ghost = contexts.New("ghost", "common");
|
||||
ghost.AddFunction(EngineKeyFunctions.MoveUp);
|
||||
ghost.AddFunction(EngineKeyFunctions.MoveDown);
|
||||
|
||||
Reference in New Issue
Block a user