]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Update dragon devour action icon (#20020)
authorDrSmugleaf <DrSmugleaf@users.noreply.github.com>
Wed, 13 Sep 2023 05:05:04 +0000 (22:05 -0700)
committerGitHub <noreply@github.com>
Wed, 13 Sep 2023 05:05:04 +0000 (22:05 -0700)
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
Content.Client/UserInterface/Systems/Actions/ActionUIController.cs
Resources/Prototypes/Entities/Mobs/Player/dragon.yml
Resources/Textures/Interface/Actions/devour.png [deleted file]
Resources/Textures/Interface/Actions/devour.rsi/icon-on.png [new file with mode: 0644]
Resources/Textures/Interface/Actions/devour.rsi/icon.png [new file with mode: 0644]
Resources/Textures/Interface/Actions/devour.rsi/meta.json [new file with mode: 0644]
Resources/Textures/Interface/Actions/meta.json

index 57ec0c40d5edcf2afedbf35edd7b811128fdb9d1..65817aaf4accbe07113682629c4fea7d9f6edb73 100644 (file)
@@ -961,6 +961,8 @@ public sealed class ActionUIController : UIController, IOnStateChanged<GameplayS
         StopTargeting();
 
         SelectingTargetFor = actionId;
+        // TODO inform the server
+        action.Toggled = true;
 
         // override "held-item" overlay
         var provider = action.Provider;
@@ -977,6 +979,15 @@ public sealed class ActionUIController : UIController, IOnStateChanged<GameplayS
                 handOverlay.IconOverride = _spriteSystem.Frame0(action.Icon);
         }
 
+        if (_container != null)
+        {
+            foreach (var button in _container.GetButtons())
+            {
+                if (button.ActionId == actionId)
+                    button.UpdateIcons();
+            }
+        }
+
         // TODO: allow world-targets to check valid positions. E.g., maybe:
         // - Draw a red/green ghost entity
         // - Add a yes/no checkmark where the HandItemOverlay usually is
@@ -1005,10 +1016,27 @@ public sealed class ActionUIController : UIController, IOnStateChanged<GameplayS
         if (SelectingTargetFor == null)
             return;
 
+        var oldAction = SelectingTargetFor;
+        if (_actionsSystem != null && _actionsSystem.TryGetActionData(oldAction, out var action))
+        {
+            // TODO inform the server
+            action.Toggled = false;
+        }
+
         SelectingTargetFor = null;
+
         _targetOutline?.Disable();
         _interactionOutline?.SetEnabled(true);
 
+        if (_container != null)
+        {
+            foreach (var button in _container.GetButtons())
+            {
+                if (button.ActionId == oldAction)
+                    button.UpdateIcons();
+            }
+        }
+
         if (!_overlays.TryGetOverlay<ShowHandItemOverlay>(out var handOverlay))
             return;
 
index 5fa8b8327e0e9f5d4003ee5c3c2d5c67a5ae996c..73600767722cf4b88b666516a0d2cc3d96383b7a 100644 (file)
   noSpawn: true
   components:
   - type: EntityTargetAction
-    icon: Interface/Actions/devour.png
+    icon: { sprite : Interface/Actions/devour.rsi, state: icon }
+    iconOn: { sprite : Interface/Actions/devour.rsi, state: icon-on }
     event: !type:DevourActionEvent
diff --git a/Resources/Textures/Interface/Actions/devour.png b/Resources/Textures/Interface/Actions/devour.png
deleted file mode 100644 (file)
index d23d26c..0000000
Binary files a/Resources/Textures/Interface/Actions/devour.png and /dev/null differ
diff --git a/Resources/Textures/Interface/Actions/devour.rsi/icon-on.png b/Resources/Textures/Interface/Actions/devour.rsi/icon-on.png
new file mode 100644 (file)
index 0000000..3c77155
Binary files /dev/null and b/Resources/Textures/Interface/Actions/devour.rsi/icon-on.png differ
diff --git a/Resources/Textures/Interface/Actions/devour.rsi/icon.png b/Resources/Textures/Interface/Actions/devour.rsi/icon.png
new file mode 100644 (file)
index 0000000..50af5c2
Binary files /dev/null and b/Resources/Textures/Interface/Actions/devour.rsi/icon.png differ
diff --git a/Resources/Textures/Interface/Actions/devour.rsi/meta.json b/Resources/Textures/Interface/Actions/devour.rsi/meta.json
new file mode 100644 (file)
index 0000000..b176d2e
--- /dev/null
@@ -0,0 +1,17 @@
+{
+  "version": 1,
+  "license": "CC0-1.0",
+  "copyright": "Created by EmoGarbage404 (github)",
+  "size": {
+    "x": 32,
+    "y": 32
+  },
+  "states": [
+    {
+      "name": "icon"
+    },
+    {
+      "name": "icon-on"
+    }
+  ]
+}
index a26a13636584a29653968d594485c4558fed65fd..cbe06c11c537b45cef9743cd1778c80cc665bb98 100644 (file)
@@ -25,9 +25,6 @@
         {
             "name": "manifest"
         },
-        {
-            "name": "devour"
-        },
         {
             "name": "carp_summon"
         },