From 665cc259c5a8d53118e514ff52395bfde1ca84c9 Mon Sep 17 00:00:00 2001 From: Clyybber Date: Tue, 16 Nov 2021 06:03:34 +0100 Subject: [PATCH] Add off icon for disarm, allow off/on icons for Target actions (#5360) --- .../Actions/Prototypes/BaseActionPrototype.cs | 19 +++++++++--------- Resources/Prototypes/Actions/actions.yml | 3 ++- .../Textures/Interface/Actions/disarmOff.png | Bin 0 -> 632 bytes 3 files changed, 11 insertions(+), 11 deletions(-) create mode 100644 Resources/Textures/Interface/Actions/disarmOff.png diff --git a/Content.Shared/Actions/Prototypes/BaseActionPrototype.cs b/Content.Shared/Actions/Prototypes/BaseActionPrototype.cs index ed7eb4b06e..671e40c3ac 100644 --- a/Content.Shared/Actions/Prototypes/BaseActionPrototype.cs +++ b/Content.Shared/Actions/Prototypes/BaseActionPrototype.cs @@ -97,7 +97,7 @@ namespace Content.Shared.Actions.Prototypes /// True if this is an action that requires selecting a target /// public bool IsTargetAction => - BehaviorType == BehaviorType.TargetEntity || BehaviorType == BehaviorType.TargetPoint; + BehaviorType is BehaviorType.TargetEntity or BehaviorType.TargetPoint; public virtual void AfterDeserialization() { @@ -106,20 +106,19 @@ namespace Content.Shared.Actions.Prototypes if (BehaviorType == BehaviorType.None) { - Logger.ErrorS("action", "Missing behaviorType for action with name {0}", Name); + Logger.ErrorS("action", $"Missing behaviorType for action with name {Name}"); } - if (BehaviorType != BehaviorType.Toggle && IconOn != SpriteSpecifier.Invalid) + if (BehaviorType is not (BehaviorType.Toggle or BehaviorType.TargetEntity or BehaviorType.TargetPoint) && IconOn != SpriteSpecifier.Invalid) { - Logger.ErrorS("action", "for action {0}, iconOn was specified but behavior" + - " type was {1}. iconOn is only supported for Toggle behavior type.", Name); + Logger.ErrorS("action", $"for action {Name}, iconOn was specified but behavior" + + " $type was {BehaviorType}. iconOn is only supported for Toggle behavior type."); } if (Repeat && BehaviorType != BehaviorType.TargetEntity && BehaviorType != BehaviorType.TargetPoint) { - Logger.ErrorS("action", " action named {0} used repeat: true, but this is only supported for" + - " TargetEntity and TargetPoint behaviorType and its behaviorType is {1}", - Name, BehaviorType); + Logger.ErrorS("action", $" action named {Name} used repeat: true, but this is only supported for" + + " $TargetEntity and TargetPoint behaviorType and its behaviorType is {BehaviorType}"); } } @@ -127,8 +126,8 @@ namespace Content.Shared.Actions.Prototypes { if (BehaviorType != expected) { - Logger.ErrorS("action", "for action named {0}, behavior implements " + - "{1}, so behaviorType should be {2} but was {3}", Name, actualInterface.Name, expected, BehaviorType); + Logger.ErrorS("action", $"for action named {Name}, behavior implements " + + $"{actualInterface.Name}, so behaviorType should be {expected} but was {BehaviorType}"); } } } diff --git a/Resources/Prototypes/Actions/actions.yml b/Resources/Prototypes/Actions/actions.yml index b42dfb91d3..420e81982d 100644 --- a/Resources/Prototypes/Actions/actions.yml +++ b/Resources/Prototypes/Actions/actions.yml @@ -11,7 +11,8 @@ - type: action actionType: Disarm - icon: Interface/Actions/disarm.png + icon: Interface/Actions/disarmOff.png + iconOn: Interface/Actions/disarm.png name: "[color=red]Disarm[/color]" description: "Attempt to [color=red]disarm[/color] someone." filters: diff --git a/Resources/Textures/Interface/Actions/disarmOff.png b/Resources/Textures/Interface/Actions/disarmOff.png new file mode 100644 index 0000000000000000000000000000000000000000..d453936f610e737bf0ce340d9e037c3775b990cb GIT binary patch literal 632 zcmV-;0*C#HP)Px%GD$>1R9J<@SItVpKoI^~f^U#QZcER(iN$!YC!a#_IZB@+kf-ou?u{tDz+01UXiuyqzoy^Yn?ab^?fPcmW0IrsopQjgv*D23)v~7z#&!d8hZ`-zB zpY5i>ZGAVH0KjUs`rK|Byd~x+_20$GyT$26f%SSlnTqkJ z0M_oX-@o?ACEX!E4b$LTf&_J+g}ixq3Htq5fCeFddj9x!jA#MY?gr0gRpaUT1IEme zrZcZ!2vI#Cb(Mg|%)RO5nu|}U52gTu>zkX(M{Mn`vx`5Ek?b&pGXdb;FqoXlT!_!v z*|{3WnE4R)MuUb(UOP5pirbq6E0J z(q^tTnjj?VsEvrb+ifaMl#q`uLk&D5US=U^#2IBbh@q3{g| z*<;@`28R*f>B_1GaJX=kRgGei_09{q0kK_d9LM!5tGc_y^fJK2#Uks7SuJ0?*v?|* zy=#;4Le5wA!C@o=TwyoY%g)Z?wA--Q*spnb=>&58!73;g*&v_Z z0ZqAxa(iG5S|&AgUq)_ye;dUj>wg)YyxTt`XRZV|d?^0y$7zP`rioYloA?4fVvR@v S&haDw0000