fix implant action icon bug (#21597)

This commit is contained in:
Leon Friedrich
2023-11-13 10:29:46 +11:00
committed by GitHub
parent 173a471929
commit 355e16f470
2 changed files with 11 additions and 8 deletions

View File

@@ -767,11 +767,15 @@ public sealed class ActionUIController : UIController, IOnStateChanged<GameplayS
private bool OnMenuBeginDrag() 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 (_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) else if (action.Icon != null)
{ {

View File

@@ -1,5 +1,4 @@
- type: entity - type: entity
parent: BaseItem
id: BaseSubdermalImplant id: BaseSubdermalImplant
name: implant name: implant
description: A microscopic chip that's injected under the skin. description: A microscopic chip that's injected under the skin.