Cleanup more SpriteComponent warnings (part 2) (#37522)
* Cleanup warnings in DamageMarkerSystem * Cleanup warnings in CuffableSystem * Cleanup warnings in DeployableTurretSystem * Cleanup warnings in StorageContainerVisualsSystem * Cleanup warnings in ItemMapperSystem * Cleanup warnings in ItemCounterSystem * Cleanup warnings in RandomSpriteSystem * Cleanup warnings in PowerCellSystem * Cleanup warnings in ParticleAcceleratorPartVisualizerSystem * Cleanup warnings in PaperVisualizerSystem * Cleanup warnings in PoweredLightVisualizerSystem * Cleanup warnings in LightBulbSystem * Cleanup warnings in EmergencyLightSystem * Cleanup warnings in DoorSystem * Cleanup warnings in ClockSystem * Cleanup warnings in BuckleSystem * Cleanup warnings in JukeboxSystem
This commit is contained in:
@@ -5,6 +5,8 @@ namespace Content.Client.Clock;
|
||||
|
||||
public sealed class ClockSystem : SharedClockSystem
|
||||
{
|
||||
[Dependency] private readonly SpriteSystem _sprite = default!;
|
||||
|
||||
public override void Update(float frameTime)
|
||||
{
|
||||
base.Update(frameTime);
|
||||
@@ -12,15 +14,15 @@ public sealed class ClockSystem : SharedClockSystem
|
||||
var query = EntityQueryEnumerator<ClockComponent, SpriteComponent>();
|
||||
while (query.MoveNext(out var uid, out var comp, out var sprite))
|
||||
{
|
||||
if (!sprite.LayerMapTryGet(ClockVisualLayers.HourHand, out var hourLayer) ||
|
||||
!sprite.LayerMapTryGet(ClockVisualLayers.MinuteHand, out var minuteLayer))
|
||||
if (!_sprite.LayerMapTryGet((uid, sprite), ClockVisualLayers.HourHand, out var hourLayer, false) ||
|
||||
!_sprite.LayerMapTryGet((uid, sprite), ClockVisualLayers.MinuteHand, out var minuteLayer, false))
|
||||
continue;
|
||||
|
||||
var time = GetClockTime((uid, comp));
|
||||
var hourState = $"{comp.HoursBase}{time.Hours % 12}";
|
||||
var minuteState = $"{comp.MinutesBase}{time.Minutes / 5}";
|
||||
sprite.LayerSetState(hourLayer, hourState);
|
||||
sprite.LayerSetState(minuteLayer, minuteState);
|
||||
_sprite.LayerSetRsiState((uid, sprite), hourLayer, hourState);
|
||||
_sprite.LayerSetRsiState((uid, sprite), minuteLayer, minuteState);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user