Fix misc cuffing issues (#12127)
This commit is contained in:
@@ -108,7 +108,17 @@ public sealed class HandsUIController : UIController, IOnStateEntered<GameplaySt
|
||||
foreach (var (name, hand) in handsComp.Hands)
|
||||
{
|
||||
var handButton = AddHand(name, hand.Location);
|
||||
handButton.SpriteView.Sprite = _entities.GetComponentOrNull<SpriteComponent>(hand.HeldEntity);
|
||||
|
||||
if (_entities.TryGetComponent(hand.HeldEntity, out HandVirtualItemComponent? virt))
|
||||
{
|
||||
handButton.SpriteView.Sprite = _entities.GetComponentOrNull<SpriteComponent>(virt.BlockingEntity);
|
||||
handButton.Blocked = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
handButton.SpriteView.Sprite = _entities.GetComponentOrNull<SpriteComponent>(hand.HeldEntity);
|
||||
handButton.Blocked = false;
|
||||
}
|
||||
}
|
||||
|
||||
var activeHand = handsComp.ActiveHand;
|
||||
@@ -149,9 +159,16 @@ public sealed class HandsUIController : UIController, IOnStateEntered<GameplaySt
|
||||
var hand = GetHand(name);
|
||||
if (hand == null)
|
||||
return;
|
||||
if (_entities.TryGetComponent(entity, out ISpriteComponent? sprite))
|
||||
|
||||
if (_entities.TryGetComponent(entity, out HandVirtualItemComponent? virt))
|
||||
{
|
||||
hand.SpriteView.Sprite = sprite;
|
||||
hand.SpriteView.Sprite = _entities.GetComponentOrNull<SpriteComponent>(virt.BlockingEntity);
|
||||
hand.Blocked = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
hand.SpriteView.Sprite = _entities.GetComponentOrNull<SpriteComponent>(entity);
|
||||
hand.Blocked = false;
|
||||
}
|
||||
|
||||
if (_playerHandsComponent?.ActiveHand?.Name == name)
|
||||
|
||||
Reference in New Issue
Block a user