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:
@@ -15,6 +15,8 @@ public sealed class MappingOverlay : Overlay
|
||||
[Dependency] private readonly IPlayerManager _player = default!;
|
||||
[Dependency] private readonly IPrototypeManager _prototypes = default!;
|
||||
|
||||
private readonly SpriteSystem _sprite;
|
||||
|
||||
// 1 off in case something else uses these colors since we use them to compare
|
||||
private static readonly Color PickColor = new(1, 255, 0);
|
||||
private static readonly Color DeleteColor = new(255, 1, 0);
|
||||
@@ -30,6 +32,8 @@ public sealed class MappingOverlay : Overlay
|
||||
{
|
||||
IoCManager.InjectDependencies(this);
|
||||
|
||||
_sprite = _entities.System<SpriteSystem>();
|
||||
|
||||
_state = state;
|
||||
_shader = _prototypes.Index<ShaderPrototype>("unshaded").Instance();
|
||||
}
|
||||
@@ -42,7 +46,7 @@ public sealed class MappingOverlay : Overlay
|
||||
continue;
|
||||
|
||||
if (sprite.Color == DeleteColor || sprite.Color == PickColor)
|
||||
sprite.Color = color;
|
||||
_sprite.SetColor((id, sprite), color);
|
||||
}
|
||||
|
||||
_oldColors.Clear();
|
||||
@@ -61,7 +65,7 @@ public sealed class MappingOverlay : Overlay
|
||||
_entities.TryGetComponent(entity, out SpriteComponent? sprite))
|
||||
{
|
||||
_oldColors[entity] = sprite.Color;
|
||||
sprite.Color = PickColor;
|
||||
_sprite.SetColor((entity, sprite), PickColor);
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -72,7 +76,7 @@ public sealed class MappingOverlay : Overlay
|
||||
_entities.TryGetComponent(entity, out SpriteComponent? sprite))
|
||||
{
|
||||
_oldColors[entity] = sprite.Color;
|
||||
sprite.Color = DeleteColor;
|
||||
_sprite.SetColor((entity, sprite), DeleteColor);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user