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:
28
Content.Server/Actions/CombatMode.cs
Normal file
28
Content.Server/Actions/CombatMode.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
#nullable enable
|
||||
using Content.Server.GameObjects.Components.Mobs;
|
||||
using Content.Shared.Actions;
|
||||
using Content.Shared.Interfaces;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.Localization;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
|
||||
namespace Content.Server.Actions
|
||||
{
|
||||
[UsedImplicitly]
|
||||
[DataDefinition]
|
||||
public class CombatMode : IToggleAction
|
||||
{
|
||||
public bool DoToggleAction(ToggleActionEventArgs args)
|
||||
{
|
||||
if (!args.Performer.TryGetComponent(out CombatModeComponent? combatMode))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
args.Performer.PopupMessage(args.ToggledOn ? Loc.GetString("hud-combat-enabled") : Loc.GetString("hud-combat-disabled"));
|
||||
combatMode.IsInCombatMode = args.ToggledOn;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user