Fix disposal unit flush animation (#30677)
* Fix disposal unit flush animation * Revert "Fix disposal unit flush animation" This reverts commit a596ecfd5f5368f87ef52cfb27884a8e000185c6. * control by setting layer visibility rather than overwriting * restore changes
This commit is contained in:
@@ -69,7 +69,8 @@ public sealed class DisposalUnitSystem : SharedDisposalUnitSystem
|
|||||||
|
|
||||||
sprite.LayerSetVisible(DisposalUnitVisualLayers.Unanchored, state == DisposalUnitComponent.VisualState.UnAnchored);
|
sprite.LayerSetVisible(DisposalUnitVisualLayers.Unanchored, state == DisposalUnitComponent.VisualState.UnAnchored);
|
||||||
sprite.LayerSetVisible(DisposalUnitVisualLayers.Base, state == DisposalUnitComponent.VisualState.Anchored);
|
sprite.LayerSetVisible(DisposalUnitVisualLayers.Base, state == DisposalUnitComponent.VisualState.Anchored);
|
||||||
sprite.LayerSetVisible(DisposalUnitVisualLayers.OverlayFlush, state is DisposalUnitComponent.VisualState.OverlayFlushing or DisposalUnitComponent.VisualState.OverlayCharging);
|
sprite.LayerSetVisible(DisposalUnitVisualLayers.OverlayFlush, state == DisposalUnitComponent.VisualState.OverlayFlushing);
|
||||||
|
sprite.LayerSetVisible(DisposalUnitVisualLayers.BaseCharging, state == DisposalUnitComponent.VisualState.OverlayCharging);
|
||||||
|
|
||||||
var chargingState = sprite.LayerMapTryGet(DisposalUnitVisualLayers.BaseCharging, out var chargingLayer)
|
var chargingState = sprite.LayerMapTryGet(DisposalUnitVisualLayers.BaseCharging, out var chargingLayer)
|
||||||
? sprite.LayerGetState(chargingLayer)
|
? sprite.LayerGetState(chargingLayer)
|
||||||
@@ -97,10 +98,6 @@ public sealed class DisposalUnitSystem : SharedDisposalUnitSystem
|
|||||||
{
|
{
|
||||||
// Play the flush animation
|
// Play the flush animation
|
||||||
new AnimationTrackSpriteFlick.KeyFrame(flushState, 0),
|
new AnimationTrackSpriteFlick.KeyFrame(flushState, 0),
|
||||||
// Return to base state (though, depending on how the unit is
|
|
||||||
// configured we might get an appearance change event telling
|
|
||||||
// us to go to charging state)
|
|
||||||
new AnimationTrackSpriteFlick.KeyFrame(chargingState, (float) ent.Comp.FlushDelay.TotalSeconds)
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -121,8 +118,6 @@ public sealed class DisposalUnitSystem : SharedDisposalUnitSystem
|
|||||||
_animationSystem.Play(ent, anim, AnimationKey);
|
_animationSystem.Play(ent, anim, AnimationKey);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (state == DisposalUnitComponent.VisualState.OverlayCharging)
|
|
||||||
sprite.LayerSetState(DisposalUnitVisualLayers.OverlayFlush, chargingState);
|
|
||||||
else
|
else
|
||||||
_animationSystem.Stop(ent.Owner, AnimationKey);
|
_animationSystem.Stop(ent.Owner, AnimationKey);
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,8 @@
|
|||||||
map: [ "enum.DisposalUnitVisualLayers.Unanchored" ]
|
map: [ "enum.DisposalUnitVisualLayers.Unanchored" ]
|
||||||
- state: disposal
|
- state: disposal
|
||||||
map: [ "enum.DisposalUnitVisualLayers.Base" ]
|
map: [ "enum.DisposalUnitVisualLayers.Base" ]
|
||||||
|
- state: disposal-charging
|
||||||
|
map: [ "enum.DisposalUnitVisualLayers.BaseCharging" ]
|
||||||
- state: disposal-flush
|
- state: disposal-flush
|
||||||
map: [ "enum.DisposalUnitVisualLayers.OverlayFlush" ]
|
map: [ "enum.DisposalUnitVisualLayers.OverlayFlush" ]
|
||||||
- state: dispover-charge
|
- state: dispover-charge
|
||||||
|
|||||||
Reference in New Issue
Block a user