Correctly implement opening animation for airlocks with open maintenance panel.

This commit is contained in:
Pieter-Jan Briers
2019-10-14 00:20:01 +02:00
parent fd109436e5
commit f3f05b0396
38 changed files with 27 additions and 15 deletions

View File

@@ -1,4 +1,5 @@
using System; using System;
using Content.Client.GameObjects.Components.Wires;
using Content.Shared.GameObjects.Components.Doors; using Content.Shared.GameObjects.Components.Doors;
using Robust.Client.Animations; using Robust.Client.Animations;
using Robust.Client.GameObjects; using Robust.Client.GameObjects;
@@ -38,6 +39,11 @@ namespace Content.Client.GameObjects.Components.Doors
flickUnlit.LayerKey = DoorVisualLayers.BaseUnlit; flickUnlit.LayerKey = DoorVisualLayers.BaseUnlit;
flickUnlit.KeyFrames.Add(new AnimationTrackSpriteFlick.KeyFrame("closing_unlit", 0f)); flickUnlit.KeyFrames.Add(new AnimationTrackSpriteFlick.KeyFrame("closing_unlit", 0f));
var flickMaintenancePanel = new AnimationTrackSpriteFlick();
CloseAnimation.AnimationTracks.Add(flickMaintenancePanel);
flickMaintenancePanel.LayerKey = WiresVisualizer2D.WiresVisualLayers.MaintenancePanel;
flickMaintenancePanel.KeyFrames.Add(new AnimationTrackSpriteFlick.KeyFrame("panel_closing", 0f));
var sound = new AnimationTrackPlaySound(); var sound = new AnimationTrackPlaySound();
CloseAnimation.AnimationTracks.Add(sound); CloseAnimation.AnimationTracks.Add(sound);
sound.KeyFrames.Add(new AnimationTrackPlaySound.KeyFrame(closeSound, 0)); sound.KeyFrames.Add(new AnimationTrackPlaySound.KeyFrame(closeSound, 0));
@@ -55,6 +61,11 @@ namespace Content.Client.GameObjects.Components.Doors
flickUnlit.LayerKey = DoorVisualLayers.BaseUnlit; flickUnlit.LayerKey = DoorVisualLayers.BaseUnlit;
flickUnlit.KeyFrames.Add(new AnimationTrackSpriteFlick.KeyFrame("opening_unlit", 0f)); flickUnlit.KeyFrames.Add(new AnimationTrackSpriteFlick.KeyFrame("opening_unlit", 0f));
var flickMaintenancePanel = new AnimationTrackSpriteFlick();
OpenAnimation.AnimationTracks.Add(flickMaintenancePanel);
flickMaintenancePanel.LayerKey = WiresVisualizer2D.WiresVisualLayers.MaintenancePanel;
flickMaintenancePanel.KeyFrames.Add(new AnimationTrackSpriteFlick.KeyFrame("panel_opening", 0f));
var sound = new AnimationTrackPlaySound(); var sound = new AnimationTrackPlaySound();
OpenAnimation.AnimationTracks.Add(sound); OpenAnimation.AnimationTracks.Add(sound);
sound.KeyFrames.Add(new AnimationTrackPlaySound.KeyFrame(openSound, 0)); sound.KeyFrames.Add(new AnimationTrackPlaySound.KeyFrame(openSound, 0));
@@ -96,6 +107,7 @@ namespace Content.Client.GameObjects.Components.Doors
case DoorVisualState.Closed: case DoorVisualState.Closed:
sprite.LayerSetState(DoorVisualLayers.Base, "closed"); sprite.LayerSetState(DoorVisualLayers.Base, "closed");
sprite.LayerSetState(DoorVisualLayers.BaseUnlit, "closed_unlit"); sprite.LayerSetState(DoorVisualLayers.BaseUnlit, "closed_unlit");
sprite.LayerSetState(WiresVisualizer2D.WiresVisualLayers.MaintenancePanel, "panel_open");
break; break;
case DoorVisualState.Closing: case DoorVisualState.Closing:
if (!animPlayer.HasRunningAnimation(AnimationKey)) if (!animPlayer.HasRunningAnimation(AnimationKey))

View File

@@ -79,7 +79,7 @@ namespace Content.Server.GameObjects.Components.Doors
{ {
base.State = value; base.State = value;
// Only show the maintenance panel if the airlock is closed // Only show the maintenance panel if the airlock is closed
_wires.IsPanelVisible = value == DoorState.Closed; _wires.IsPanelVisible = value != DoorState.Open;
} }
} }

View File

@@ -71,7 +71,7 @@
] ]
}, },
{ {
"name": "o_closing", "name": "panel_closing",
"directions": 1, "directions": 1,
"delays": [ "delays": [
[ [
@@ -87,7 +87,7 @@
] ]
}, },
{ {
"name": "o_opening", "name": "panel_opening",
"directions": 1, "directions": 1,
"delays": [ "delays": [
[ [

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 368 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 348 B

View File

@@ -71,7 +71,7 @@
] ]
}, },
{ {
"name": "o_closing", "name": "panel_closing",
"directions": 1, "directions": 1,
"delays": [ "delays": [
[ [
@@ -87,7 +87,7 @@
] ]
}, },
{ {
"name": "o_opening", "name": "panel_opening",
"directions": 1, "directions": 1,
"delays": [ "delays": [
[ [

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 368 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 348 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 992 B

After

Width:  |  Height:  |  Size: 915 B

View File

@@ -68,7 +68,7 @@
] ]
}, },
{ {
"name": "o_closing", "name": "panel_closing",
"directions": 1, "directions": 1,
"delays": [ "delays": [
[ [
@@ -83,7 +83,7 @@
] ]
}, },
{ {
"name": "o_opening", "name": "panel_opening",
"directions": 1, "directions": 1,
"delays": [ "delays": [
[ [

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 513 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 496 B

View File

@@ -71,7 +71,7 @@
] ]
}, },
{ {
"name": "o_closing", "name": "panel_closing",
"directions": 1, "directions": 1,
"delays": [ "delays": [
[ [
@@ -87,7 +87,7 @@
] ]
}, },
{ {
"name": "o_opening", "name": "panel_opening",
"directions": 1, "directions": 1,
"delays": [ "delays": [
[ [

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 368 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 348 B

View File

@@ -71,7 +71,7 @@
] ]
}, },
{ {
"name": "o_closing", "name": "panel_closing",
"directions": 1, "directions": 1,
"delays": [ "delays": [
[ [
@@ -87,7 +87,7 @@
] ]
}, },
{ {
"name": "o_opening", "name": "panel_opening",
"directions": 1, "directions": 1,
"delays": [ "delays": [
[ [

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 368 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 348 B

View File

@@ -71,7 +71,7 @@
] ]
}, },
{ {
"name": "o_closing", "name": "panel_closing",
"directions": 1, "directions": 1,
"delays": [ "delays": [
[ [
@@ -87,7 +87,7 @@
] ]
}, },
{ {
"name": "o_opening", "name": "panel_opening",
"directions": 1, "directions": 1,
"delays": [ "delays": [
[ [

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 368 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 348 B

View File

@@ -71,7 +71,7 @@
] ]
}, },
{ {
"name": "o_closing", "name": "panel_closing",
"directions": 1, "directions": 1,
"delays": [ "delays": [
[ [
@@ -87,7 +87,7 @@
] ]
}, },
{ {
"name": "o_opening", "name": "panel_opening",
"directions": 1, "directions": 1,
"delays": [ "delays": [
[ [

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 368 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 348 B