Cleanup more SpriteComponent warnings (part 2) (#37527)

* Cleanup warnings in MagazineVisualsSpriteTest

* Cleanup warnings in WiresVisualizerSystem

* Cleanup warnings in GunSystem.SpentAmmo

* Cleanup warnings in GunSystem

* Cleanup warnings in GunSystem.ChamberMagazine

* Cleanup warnings in MeleeWeaponSystem.Effects

* Cleanup warnings in ToggleableLightVisualsSystem

* Cleanup warnings in StatusIconOverlay

* Cleanup warnings in SpriteFadeSystem

* Cleanup warnings in PdaVisualizerSystem

* Cleanup warnings in EnvelopeSystem

* Cleanup warnings in MechSystem

* Cleanup warnings in MappingOverlay

* Cleanup warnings in LockVisualizerSystem

* Cleanup warnings in DragDropSystem

* Cleanup warnings in GhostSystem

* Cleanup warnings in TriggerSystem.Proximity

* Cleanup warnings in DragonSystem

* Cleanup warnings in PortableScrubberVisualsSystem

* File-scoped namespace for PortableScrubberVisualsSystem
This commit is contained in:
Tayrtahn
2025-05-16 23:29:03 -04:00
committed by GitHub
parent 33f111c090
commit bd22361a6a
20 changed files with 108 additions and 92 deletions

View File

@@ -43,6 +43,7 @@ public sealed class DragDropSystem : SharedDragDropSystem
[Dependency] private readonly EntityLookupSystem _lookup = default!;
[Dependency] private readonly SharedPopupSystem _popup = default!;
[Dependency] private readonly SharedTransformSystem _transformSystem = default!;
[Dependency] private readonly SpriteSystem _sprite = default!;
// how often to recheck possible targets (prevents calling expensive
// check logic each update)
@@ -178,7 +179,7 @@ public sealed class DragDropSystem : SharedDragDropSystem
private bool OnUseMouseDown(in PointerInputCmdHandler.PointerInputCmdArgs args)
{
if (args.Session?.AttachedEntity is not {Valid: true} dragger ||
if (args.Session?.AttachedEntity is not { Valid: true } dragger ||
_combatMode.IsInCombatMode())
{
return false;
@@ -249,11 +250,11 @@ public sealed class DragDropSystem : SharedDragDropSystem
var mousePos = _eyeManager.PixelToMap(screenPos);
_dragShadow = EntityManager.SpawnEntity("dragshadow", mousePos);
var dragSprite = Comp<SpriteComponent>(_dragShadow.Value);
dragSprite.CopyFrom(draggedSprite);
_sprite.CopySprite((_draggedEntity.Value, draggedSprite), (_dragShadow.Value, dragSprite));
dragSprite.RenderOrder = EntityManager.CurrentTick.Value;
dragSprite.Color = dragSprite.Color.WithAlpha(0.7f);
_sprite.SetColor((_dragShadow.Value, dragSprite), dragSprite.Color.WithAlpha(0.7f));
// keep it on top of everything
dragSprite.DrawDepth = (int) DrawDepth.Overlays;
_sprite.SetDrawDepth((_dragShadow.Value, dragSprite), (int)DrawDepth.Overlays);
if (!dragSprite.NoRotation)
{
_transformSystem.SetWorldRotationNoLerp(_dragShadow.Value, _transformSystem.GetWorldRotation(_draggedEntity.Value));