Removes all dependencies on engine component events. (#4199)

This commit is contained in:
Acruid
2021-06-18 01:49:18 -07:00
committed by GitHub
parent 9fea68707c
commit e1e54e9cb1
27 changed files with 235 additions and 184 deletions

View File

@@ -1,4 +1,4 @@
using Content.Client.HUD;
using Content.Client.HUD;
using Content.Shared.CombatMode;
using Content.Shared.Targeting;
using Robust.Client.GameObjects;
@@ -35,21 +35,12 @@ namespace Content.Client.CombatMode
}
}
public override void HandleMessage(ComponentMessage message, IComponent? component)
public void PlayerDetached() { _gameHud.CombatPanelVisible = false; }
public void PlayerAttached()
{
base.HandleMessage(message, component);
switch (message)
{
case PlayerAttachedMsg _:
_gameHud.CombatPanelVisible = true;
UpdateHud();
break;
case PlayerDetachedMsg _:
_gameHud.CombatPanelVisible = false;
break;
}
_gameHud.CombatPanelVisible = true;
UpdateHud();
}
private void UpdateHud()