]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
fix implant action icon bug (#21597)
authorLeon Friedrich <60421075+ElectroJr@users.noreply.github.com>
Sun, 12 Nov 2023 23:29:46 +0000 (10:29 +1100)
committerGitHub <noreply@github.com>
Sun, 12 Nov 2023 23:29:46 +0000 (16:29 -0700)
Content.Client/UserInterface/Systems/Actions/ActionUIController.cs
Resources/Prototypes/Entities/Objects/Misc/subdermal_implants.yml

index e2de86201e72734a737b54a98322397332ad6676..340aa5447ddea6fbc47071c3cea28e0ce699db1a 100644 (file)
@@ -767,11 +767,15 @@ public sealed class ActionUIController : UIController, IOnStateChanged<GameplayS
 
     private bool OnMenuBeginDrag()
     {
+        // TODO ACTIONS
+        // The dragging icon shuld be based on the entity's icon style. I.e. if the action has a large icon texture,
+        // and a small item/provider sprite, then the dragged icon should be the big texture, not the provider.
         if (_actionsSystem != null && _actionsSystem.TryGetActionData(_menuDragHelper.Dragged?.ActionId, out var action))
         {
-            if (EntityManager.TryGetComponent(action.EntityIcon, out SpriteComponent? sprite))
+            if (EntityManager.TryGetComponent(action.EntityIcon, out SpriteComponent? sprite)
+                && sprite.Icon?.GetFrame(RsiDirection.South, 0) is {} frame)
             {
-                _dragShadow.Texture = sprite.Icon?.GetFrame(RsiDirection.South, 0);
+                _dragShadow.Texture = frame;
             }
             else if (action.Icon != null)
             {
index d8d808c8934f3d77a43ee9e591fe2b632ea1747b..f893ba91d4ed972346247fc1c81e716da036cd2a 100644 (file)
@@ -1,15 +1,14 @@
 - type: entity
-  parent: BaseItem
   id: BaseSubdermalImplant
   name: implant
   description: A microscopic chip that's injected under the skin.
   abstract: true
   components:
-    - type: SubdermalImplant
-    - type: Tag
-      tags:
-        - SubdermalImplant
-        - HideContextMenu
+  - type: SubdermalImplant
+  - type: Tag
+    tags:
+    - SubdermalImplant
+    - HideContextMenu
 
 #Fun implants