fix: фикс света дверей
This commit is contained in:
@@ -34,29 +34,31 @@ public sealed class AirlockSystem : SharedAirlockSystem
|
|||||||
if (comp.OpenUnlitVisible) // Otherwise there are flashes of the fallback sprite between clicking on the door and the door closing animation starting.
|
if (comp.OpenUnlitVisible) // Otherwise there are flashes of the fallback sprite between clicking on the door and the door closing animation starting.
|
||||||
{
|
{
|
||||||
door.OpenSpriteStates.Add((DoorVisualLayers.BaseUnlit, comp.OpenSpriteState));
|
door.OpenSpriteStates.Add((DoorVisualLayers.BaseUnlit, comp.OpenSpriteState));
|
||||||
|
door.OpenSpriteStates.Add((DoorVisualLayers.BaseBolted, "bolted_open_unlit"));
|
||||||
door.ClosedSpriteStates.Add((DoorVisualLayers.BaseUnlit, comp.ClosedSpriteState));
|
door.ClosedSpriteStates.Add((DoorVisualLayers.BaseUnlit, comp.ClosedSpriteState));
|
||||||
|
door.ClosedSpriteStates.Add((DoorVisualLayers.BaseBolted, "bolted_unlit"));
|
||||||
}
|
}
|
||||||
|
|
||||||
((Animation)door.OpeningAnimation).AnimationTracks.Add(new AnimationTrackSpriteFlick()
|
((Animation) door.OpeningAnimation).AnimationTracks.Add(new AnimationTrackSpriteFlick
|
||||||
{
|
{
|
||||||
LayerKey = DoorVisualLayers.BaseUnlit,
|
LayerKey = DoorVisualLayers.BaseUnlit,
|
||||||
KeyFrames = { new AnimationTrackSpriteFlick.KeyFrame(comp.OpeningSpriteState, 0f) },
|
KeyFrames = { new AnimationTrackSpriteFlick.KeyFrame(comp.OpeningSpriteState, 0f) },
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
((Animation)door.ClosingAnimation).AnimationTracks.Add(new AnimationTrackSpriteFlick()
|
((Animation) door.ClosingAnimation).AnimationTracks.Add(new AnimationTrackSpriteFlick
|
||||||
{
|
{
|
||||||
LayerKey = DoorVisualLayers.BaseUnlit,
|
LayerKey = DoorVisualLayers.BaseUnlit,
|
||||||
KeyFrames = { new AnimationTrackSpriteFlick.KeyFrame(comp.ClosingSpriteState, 0f) },
|
KeyFrames = { new AnimationTrackSpriteFlick.KeyFrame(comp.ClosingSpriteState, 0f) },
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
door.DenyingAnimation = new Animation()
|
door.DenyingAnimation = new Animation
|
||||||
{
|
{
|
||||||
Length = TimeSpan.FromSeconds(comp.DenyAnimationTime),
|
Length = TimeSpan.FromSeconds(comp.DenyAnimationTime),
|
||||||
AnimationTracks =
|
AnimationTracks =
|
||||||
{
|
{
|
||||||
new AnimationTrackSpriteFlick()
|
new AnimationTrackSpriteFlick
|
||||||
{
|
{
|
||||||
LayerKey = DoorVisualLayers.BaseUnlit,
|
LayerKey = DoorVisualLayers.BaseUnlit,
|
||||||
KeyFrames = { new AnimationTrackSpriteFlick.KeyFrame(comp.DenySpriteState, 0f) },
|
KeyFrames = { new AnimationTrackSpriteFlick.KeyFrame(comp.DenySpriteState, 0f) },
|
||||||
@@ -67,7 +69,7 @@ public sealed class AirlockSystem : SharedAirlockSystem
|
|||||||
if (!comp.AnimatePanel)
|
if (!comp.AnimatePanel)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
((Animation)door.OpeningAnimation).AnimationTracks.Add(new AnimationTrackSpriteFlick()
|
((Animation) door.OpeningAnimation).AnimationTracks.Add(new AnimationTrackSpriteFlick
|
||||||
{
|
{
|
||||||
LayerKey = WiresVisualLayers.MaintenancePanel,
|
LayerKey = WiresVisualLayers.MaintenancePanel,
|
||||||
KeyFrames = { new AnimationTrackSpriteFlick.KeyFrame(comp.OpeningPanelSpriteState, 0f) },
|
KeyFrames = { new AnimationTrackSpriteFlick.KeyFrame(comp.OpeningPanelSpriteState, 0f) },
|
||||||
@@ -94,18 +96,24 @@ public sealed class AirlockSystem : SharedAirlockSystem
|
|||||||
|
|
||||||
if (_appearanceSystem.TryGetData<bool>(uid, DoorVisuals.Powered, out var powered, args.Component) && powered)
|
if (_appearanceSystem.TryGetData<bool>(uid, DoorVisuals.Powered, out var powered, args.Component) && powered)
|
||||||
{
|
{
|
||||||
boltedVisible = _appearanceSystem.TryGetData<bool>(uid, DoorVisuals.BoltLights, out var lights, args.Component)
|
boltedVisible =
|
||||||
&& lights && (state == DoorState.Closed || state == DoorState.Welded);
|
_appearanceSystem.TryGetData<bool>(uid, DoorVisuals.BoltLights, out var lights, args.Component)
|
||||||
|
&& lights && state is DoorState.Closed or DoorState.Welded;
|
||||||
|
|
||||||
|
emergencyLightsVisible =
|
||||||
|
_appearanceSystem.TryGetData<bool>(uid, DoorVisuals.EmergencyLights, out var eaLights,
|
||||||
|
args.Component) && eaLights;
|
||||||
|
|
||||||
emergencyLightsVisible = _appearanceSystem.TryGetData<bool>(uid, DoorVisuals.EmergencyLights, out var eaLights, args.Component) && eaLights;
|
|
||||||
unlitVisible =
|
unlitVisible =
|
||||||
(state == DoorState.Closing
|
(state == DoorState.Closing
|
||||||
|| state == DoorState.Opening
|
|| state == DoorState.Opening
|
||||||
|| state == DoorState.Denying
|
|| state == DoorState.Denying
|
||||||
|| state == DoorState.Welded
|
|| state == DoorState.Welded
|
||||||
|| (state == DoorState.Open && comp.OpenUnlitVisible)
|
|| state == DoorState.Open && comp.OpenUnlitVisible
|
||||||
|| (_appearanceSystem.TryGetData<bool>(uid, DoorVisuals.ClosedLights, out var closedLights, args.Component) && closedLights))
|
|| state == DoorState.Closed && comp.OpenUnlitVisible
|
||||||
&& !boltedVisible && !emergencyLightsVisible; ;
|
|| _appearanceSystem.TryGetData<bool>(uid, DoorVisuals.ClosedLights, out var closedLights,
|
||||||
|
args.Component) && closedLights)
|
||||||
|
&& !boltedVisible && !emergencyLightsVisible;
|
||||||
}
|
}
|
||||||
|
|
||||||
args.Sprite.LayerSetVisible(DoorVisualLayers.BaseUnlit, unlitVisible);
|
args.Sprite.LayerSetVisible(DoorVisualLayers.BaseUnlit, unlitVisible);
|
||||||
|
|||||||
@@ -72,8 +72,8 @@ public sealed partial class AirlockComponent : Component
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Whether the door lights should be visible.
|
/// Whether the door lights should be visible.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DataField]
|
[DataField("openUnlitVisible")]
|
||||||
public bool OpenUnlitVisible = false;
|
public bool OpenUnlitVisible = true;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Whether the door should display emergency access lights.
|
/// Whether the door should display emergency access lights.
|
||||||
|
|||||||
@@ -64,6 +64,7 @@
|
|||||||
- type: Weldable
|
- type: Weldable
|
||||||
time: 3
|
time: 3
|
||||||
- type: Airlock
|
- type: Airlock
|
||||||
|
openUnlitVisible: true
|
||||||
- type: NavMapDoor
|
- type: NavMapDoor
|
||||||
- type: DoorBolt
|
- type: DoorBolt
|
||||||
- type: Appearance
|
- type: Appearance
|
||||||
|
|||||||
Reference in New Issue
Block a user