Add methods to transfer actions between containers (#20901)

This commit is contained in:
Leon Friedrich
2023-10-12 04:50:10 +11:00
committed by GitHub
parent 8177c406f6
commit fcd0d9ef0f
3 changed files with 98 additions and 17 deletions

View File

@@ -769,10 +769,9 @@ public sealed class ActionUIController : UIController, IOnStateChanged<GameplayS
{
if (_actionsSystem != null && _actionsSystem.TryGetActionData(_menuDragHelper.Dragged?.ActionId, out var action))
{
if (action.EntityIcon is {} entIcon)
if (EntityManager.TryGetComponent(action.EntityIcon, out SpriteComponent? sprite))
{
_dragShadow.Texture = EntityManager.GetComponent<SpriteComponent>(entIcon).Icon?
.GetFrame(RsiDirection.South, 0);
_dragShadow.Texture = sprite.Icon?.GetFrame(RsiDirection.South, 0);
}
else if (action.Icon != null)
{