Ghost command, some other stuff

This commit is contained in:
zumorica
2020-03-03 20:37:26 +01:00
parent 055f09d501
commit 7f19381bec
9 changed files with 119 additions and 7 deletions

View File

@@ -69,8 +69,7 @@ namespace Content.Client.Observer
if (!(curState is GhostComponentState state)) return;
_canReturnToBody = state.CanReturnToBody;
if (_gui == null) return;
_gui.ReturnToBody.Disabled = !_canReturnToBody;
_gui?.Update();
}
}
}

View File

@@ -1,3 +1,4 @@
using System.Data;
using Content.Client.Observer;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
@@ -21,6 +22,13 @@ namespace Content.Client.UserInterface
ReturnToBody.OnPressed += (args) => { owner.SendReturnToBodyMessage(); };
AddChild(ReturnToBody);
Update();
}
public void Update()
{
ReturnToBody.Disabled = !_owner.CanReturnToBody;
}
}
}