Remove usages of obsolete SpriteView.Sprite.set() (#19500)

This commit is contained in:
Visne
2023-08-25 03:16:46 +02:00
committed by GitHub
parent 3c667b6f7e
commit 11a57be230
20 changed files with 72 additions and 95 deletions

View File

@@ -120,12 +120,12 @@ public sealed class HandsUIController : UIController, IOnStateEntered<GameplaySt
if (_entities.TryGetComponent(hand.HeldEntity, out HandVirtualItemComponent? virt))
{
handButton.SpriteView.Sprite = _entities.GetComponentOrNull<SpriteComponent>(virt.BlockingEntity);
handButton.SpriteView.SetEntity(virt.BlockingEntity);
handButton.Blocked = true;
}
else
{
handButton.SpriteView.Sprite = _entities.GetComponentOrNull<SpriteComponent>(hand.HeldEntity);
handButton.SpriteView.SetEntity(hand.HeldEntity);
handButton.Blocked = false;
}
}
@@ -171,12 +171,12 @@ public sealed class HandsUIController : UIController, IOnStateEntered<GameplaySt
if (_entities.TryGetComponent(entity, out HandVirtualItemComponent? virt))
{
hand.SpriteView.Sprite = _entities.GetComponentOrNull<SpriteComponent>(virt.BlockingEntity);
hand.SpriteView.SetEntity(virt.BlockingEntity);
hand.Blocked = true;
}
else
{
hand.SpriteView.Sprite = _entities.GetComponentOrNull<SpriteComponent>(entity);
hand.SpriteView.SetEntity(entity);
hand.Blocked = false;
}
@@ -190,7 +190,7 @@ public sealed class HandsUIController : UIController, IOnStateEntered<GameplaySt
if (hand == null)
return;
hand.SpriteView.Sprite = null;
hand.SpriteView.SetEntity(null);
if (_playerHandsComponent?.ActiveHand?.Name == name)
HandsGui?.UpdatePanelEntity(null);
}