[Dependency] private readonly IClyde _clyde = default!;
[Dependency] private readonly IEntityManager _entMan = default!;
+ private HandsSystem? _hands;
private readonly IRenderTexture _renderBackbuffer;
public override OverlaySpace Space => OverlaySpace.ScreenSpace;
return;
}
- var handEntity = EntityOverride ?? EntitySystem.Get<HandsSystem>().GetActiveHandEntity();
+ _hands ??= _entMan.System<HandsSystem>();
+ var handEntity = _hands.GetActiveHandEntity();
- if (handEntity == null || !_entMan.HasComponent<SpriteComponent>(handEntity))
+ if (handEntity == null || !_entMan.TryGetComponent(handEntity, out SpriteComponent? sprite))
return;
var halfSize = _renderBackbuffer.Size / 2;
screen.RenderInRenderTarget(_renderBackbuffer, () =>
{
- screen.DrawEntity(handEntity.Value, halfSize, new Vector2(1f, 1f) * uiScale, Direction.South);
+ screen.DrawEntity(handEntity.Value, halfSize, new Vector2(1f, 1f) * uiScale, Angle.Zero, Angle.Zero, Direction.South, sprite);
}, Color.Transparent);
screen.DrawTexture(_renderBackbuffer.Texture, mousePos - halfSize + offset, Color.White.WithAlpha(0.75f));
+++ /dev/null
-- type: entity
- id: debugRotation1
- name: dbg_rotation1
- suffix: DEBUG
- components:
- - type: Tag
- tags:
- - Debug
- - type: Clickable
- - type: InteractionOutline
- - type: Sprite
- netsync: false
- visible: true
- sprite: debugRotation.rsi
- state: direction1
- placement:
- mode: AlignTileAny
-
-- type: entity
- id: debugRotation4
- name: dbg_rotation4
- suffix: DEBUG
- components:
- - type: Tag
- tags:
- - Debug
- - type: Clickable
- - type: InteractionOutline
- - type: Sprite
- netsync: false
- visible: true
- sprite: debugRotation.rsi
- state: direction4
- placement:
- mode: AlignTileAny
-
-- type: entity
- id: debugRotationTex
- name: dbg_rotationTex
- suffix: DEBUG
- components:
- - type: Tag
- tags:
- - Debug
- - type: Clickable
- - type: InteractionOutline
- - type: Sprite
- netsync: false
- visible: true
- sprite: debugRotation.rsi
- state: direction1
- placement:
- mode: AlignTileAny