Improves the HUD (#3655)
* All good except the combat doll * Makes the HUD inventory less terrible * Cleanup, nuke the Combat Mode button * Harm icon * Switch the icon * Basic goon hud * Toggleable * Nuke the popup, properly centers it * Fix clicking the button * Nuke some old code * missed a comment * Remove defaults * Localization * Nuke some old yaml * New sprites Co-authored-by: ike709 <sparebytes@protonmail.com>
This commit is contained in:
@@ -34,45 +34,7 @@ namespace Content.Client.GameObjects.EntitySystems
|
||||
|
||||
private void HandleOpenInventoryMenu()
|
||||
{
|
||||
if (_playerManager.LocalPlayer?.ControlledEntity == null
|
||||
|| !_playerManager.LocalPlayer.ControlledEntity.TryGetComponent(out ClientInventoryComponent? clientInventory))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var menu = clientInventory.InterfaceController.Window;
|
||||
|
||||
if (menu == null) return;
|
||||
|
||||
if (menu.IsOpen)
|
||||
{
|
||||
if (menu.IsAtFront())
|
||||
{
|
||||
_setOpenValue(menu, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
menu.MoveToFront();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_setOpenValue(menu, true);
|
||||
}
|
||||
}
|
||||
|
||||
private void _setOpenValue(SS14Window menu, bool value)
|
||||
{
|
||||
if (value)
|
||||
{
|
||||
_gameHud.InventoryButtonDown = true;
|
||||
menu.OpenCentered();
|
||||
}
|
||||
else
|
||||
{
|
||||
_gameHud.InventoryButtonDown = false;
|
||||
menu.Close();
|
||||
}
|
||||
_gameHud.InventoryButtonDown = !_gameHud.InventoryButtonDown;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,13 +25,7 @@ namespace Content.Client.GameObjects.EntitySystems
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
_gameHud.OnCombatModeChanged = OnCombatModeChanged;
|
||||
_gameHud.OnTargetingZoneChanged = OnTargetingZoneChanged;
|
||||
|
||||
CommandBinds.Builder
|
||||
.Bind(ContentKeyFunctions.ToggleCombatMode,
|
||||
InputCmdHandler.FromDelegate(CombatModeToggled))
|
||||
.Register<CombatModeSystem>();
|
||||
}
|
||||
|
||||
public override void Shutdown()
|
||||
@@ -40,15 +34,6 @@ namespace Content.Client.GameObjects.EntitySystems
|
||||
base.Shutdown();
|
||||
}
|
||||
|
||||
private void CombatModeToggled(ICommonSession? session)
|
||||
{
|
||||
if (_gameTiming.IsFirstTimePredicted)
|
||||
{
|
||||
EntityManager.RaisePredictiveEvent(
|
||||
new CombatModeSystemMessages.SetCombatModeActiveMessage(!IsInCombatMode()));
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsInCombatMode()
|
||||
{
|
||||
var entity = _playerManager.LocalPlayer?.ControlledEntity;
|
||||
@@ -64,10 +49,5 @@ namespace Content.Client.GameObjects.EntitySystems
|
||||
{
|
||||
EntityManager.RaisePredictiveEvent(new CombatModeSystemMessages.SetTargetZoneMessage(obj));
|
||||
}
|
||||
|
||||
private void OnCombatModeChanged(bool obj)
|
||||
{
|
||||
EntityManager.RaisePredictiveEvent(new CombatModeSystemMessages.SetCombatModeActiveMessage(obj));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user