proper sprites + visualizes nicely

This commit is contained in:
Kara D
2021-08-05 19:43:58 -07:00
parent a651743235
commit e460285187
44 changed files with 91 additions and 215 deletions

View File

@@ -17,9 +17,26 @@ namespace Content.Client.Doors
{
private const string AnimationKey = "airlock_animation";
[DataField("animation_time")]
[DataField("animationTime")]
private float _delay = 0.8f;
[DataField("denyAnimationTime")]
private float _denyDelay = 0.3f;
/// <summary>
/// Whether the maintenance panel is animated or stays static.
/// False for windoors.
/// </summary>
[DataField("animatedPanel")]
private bool _animatedPanel = true;
/// <summary>
/// Whether the BaseUnlit layer should still be visible when the airlock
/// is opened.
/// </summary>
[DataField("openUnlitVisible")]
private bool _openUnlitVisible = false;
private Animation CloseAnimation = default!;
private Animation OpenAnimation = default!;
private Animation DenyAnimation = default!;
@@ -38,10 +55,13 @@ namespace Content.Client.Doors
flickUnlit.LayerKey = DoorVisualLayers.BaseUnlit;
flickUnlit.KeyFrames.Add(new AnimationTrackSpriteFlick.KeyFrame("closing_unlit", 0f));
var flickMaintenancePanel = new AnimationTrackSpriteFlick();
CloseAnimation.AnimationTracks.Add(flickMaintenancePanel);
flickMaintenancePanel.LayerKey = WiresVisualizer.WiresVisualLayers.MaintenancePanel;
flickMaintenancePanel.KeyFrames.Add(new AnimationTrackSpriteFlick.KeyFrame("panel_closing", 0f));
if (_animatedPanel)
{
var flickMaintenancePanel = new AnimationTrackSpriteFlick();
CloseAnimation.AnimationTracks.Add(flickMaintenancePanel);
flickMaintenancePanel.LayerKey = WiresVisualizer.WiresVisualLayers.MaintenancePanel;
flickMaintenancePanel.KeyFrames.Add(new AnimationTrackSpriteFlick.KeyFrame("panel_closing", 0f));
}
}
OpenAnimation = new Animation {Length = TimeSpan.FromSeconds(_delay)};
@@ -56,24 +76,21 @@ namespace Content.Client.Doors
flickUnlit.LayerKey = DoorVisualLayers.BaseUnlit;
flickUnlit.KeyFrames.Add(new AnimationTrackSpriteFlick.KeyFrame("opening_unlit", 0f));
var flickMaintenancePanel = new AnimationTrackSpriteFlick();
OpenAnimation.AnimationTracks.Add(flickMaintenancePanel);
flickMaintenancePanel.LayerKey = WiresVisualizer.WiresVisualLayers.MaintenancePanel;
flickMaintenancePanel.KeyFrames.Add(new AnimationTrackSpriteFlick.KeyFrame("panel_opening", 0f));
var sound = new AnimationTrackPlaySound();
OpenAnimation.AnimationTracks.Add(sound);
if (_animatedPanel)
{
var flickMaintenancePanel = new AnimationTrackSpriteFlick();
OpenAnimation.AnimationTracks.Add(flickMaintenancePanel);
flickMaintenancePanel.LayerKey = WiresVisualizer.WiresVisualLayers.MaintenancePanel;
flickMaintenancePanel.KeyFrames.Add(new AnimationTrackSpriteFlick.KeyFrame("panel_opening", 0f));
}
}
DenyAnimation = new Animation {Length = TimeSpan.FromSeconds(0.3f)};
DenyAnimation = new Animation {Length = TimeSpan.FromSeconds(_denyDelay)};
{
var flick = new AnimationTrackSpriteFlick();
DenyAnimation.AnimationTracks.Add(flick);
flick.LayerKey = DoorVisualLayers.BaseUnlit;
flick.KeyFrames.Add(new AnimationTrackSpriteFlick.KeyFrame("deny_unlit", 0f));
var sound = new AnimationTrackPlaySound();
DenyAnimation.AnimationTracks.Add(sound);
}
}
@@ -108,13 +125,16 @@ namespace Content.Client.Doors
{
case DoorVisualState.Open:
sprite.LayerSetState(DoorVisualLayers.Base, "open");
unlitVisible = false;
unlitVisible = _openUnlitVisible;
if (_openUnlitVisible)
{
sprite.LayerSetState(DoorVisualLayers.BaseUnlit, "open_unlit");
}
break;
case DoorVisualState.Closed:
sprite.LayerSetState(DoorVisualLayers.Base, "closed");
sprite.LayerSetState(DoorVisualLayers.BaseUnlit, "closed_unlit");
sprite.LayerSetState(DoorVisualLayers.BaseBolted, "bolted_unlit");
sprite.LayerSetState(WiresVisualizer.WiresVisualLayers.MaintenancePanel, "panel_open");
break;
case DoorVisualState.Opening:
animPlayer.Play(OpenAnimation, AnimationKey);

View File

@@ -59,6 +59,12 @@ namespace Content.Server.Doors.Components
[DataField("powerWiresTimeout")]
public float PowerWiresTimeout = 5.0f;
/// <summary>
/// Whether the maintenance panel should be visible even if the airlock is opened.
/// </summary>
[DataField("openPanelVisible")]
public bool OpenPanelVisible = false;
private CancellationTokenSource _powerWiresPulsedTimerCancel = new();
private bool _powerWiresPulsed;

View File

@@ -42,7 +42,9 @@ namespace Content.Server.Doors.Systems
// Only show the maintenance panel if the airlock is closed
if (component.WiresComponent != null)
{
component.WiresComponent.IsPanelVisible = args.State != SharedDoorComponent.DoorState.Open;
component.WiresComponent.IsPanelVisible =
args.State != SharedDoorComponent.DoorState.Open
|| component.OpenPanelVisible;
}
// If the door is closed, we should look if the bolt was locked while closing
component.UpdateBoltLightStatus();

View File

@@ -64,7 +64,7 @@
- type: Appearance
visuals:
- type: AirlockVisualizer
animation_time: 0.6
animationTime: 0.6
- type: WiresVisualizer
- type: Wires
BoardName: "Firelock Control"

View File

@@ -22,20 +22,20 @@
- type: Sprite
netsync: false
drawdepth: FloorObjects
sprite: Structures/Doors/Windoors/glass.rsi
sprite: Structures/Doors/Windoors/windoor.rsi
layers:
- state: closed
map: [ "enum.DoorVisualLayers.Base" ]
map: ["enum.DoorVisualLayers.Base"]
- state: closed_unlit
shader: unshaded
map: [ "enum.DoorVisualLayers.BaseUnlit" ]
map: ["enum.DoorVisualLayers.BaseUnlit"]
- state: welded
map: [ "enum.DoorVisualLayers.BaseWelded" ]
map: ["enum.DoorVisualLayers.BaseWelded"]
- state: bolted_unlit
shader: unshaded
map: [ "enum.DoorVisualLayers.BaseBolted" ]
map: ["enum.DoorVisualLayers.BaseBolted"]
- state: panel_open
map: [ "enum.WiresVisualLayers.MaintenancePanel" ]
map: ["enum.WiresVisualLayers.MaintenancePanel"]
- type: ApcPowerReceiver
- type: Damageable
resistances: glassResistances
@@ -54,10 +54,14 @@
acts: [ "Destruction" ]
- type: AccessReader
- type: Airlock
openPanelVisible: true
- type: Door
openSound: /Audio/Machines/windoor_open.ogg
closeSound: /Audio/Machines/windoor_open.ogg
denySound: /Audio/Machines/airlock_deny.ogg
openSound:
path: /Audio/Machines/windoor_open.ogg
closeSound:
path: /Audio/Machines/windoor_open.ogg
denySound:
path: /Audio/Machines/airlock_deny.ogg
- type: Wires
BoardName: "Windoor Control"
LayoutId: Airlock
@@ -68,9 +72,11 @@
- type: Appearance
visuals:
- type: AirlockVisualizer
hasMaintenancePanel: false
openCloseUnlit: false
delay: 0.7
animationTime: 0.9
denyAnimationTime: 0.4
animatedPanel: false
openUnlitVisible: true
- type: WiresVisualizer
- type: entity
id: BaseSecureWindoor
@@ -83,7 +89,24 @@
airBlockedDirection:
- South
- type: Sprite
sprite: Structures/Doors/Windoors/secure.rsi
netsync: false
drawdepth: FloorObjects
sprite: Structures/Doors/Windoors/windoor.rsi
layers:
- state: secure_underlay
- state: closed
map: [ "enum.DoorVisualLayers.Base" ]
- state: closed_unlit
shader: unshaded
map: [ "enum.DoorVisualLayers.BaseUnlit" ]
- state: welded
map: [ "enum.DoorVisualLayers.BaseWelded" ]
- state: bolted_unlit
shader: unshaded
map: [ "enum.DoorVisualLayers.BaseBolted" ]
- state: panel_open
map: [ "enum.WiresVisualLayers.MaintenancePanel" ]
visible: false
- type: Destructible
thresholds:
- trigger:

View File

@@ -10,6 +10,7 @@
name: secure windoor
description: It's a sturdy window and a sliding door. Wow!
# TODO remove these with parameterized prototypes/whatever we end up doing
# Bar windoor
- type: entity
parent: Windoor

View File

@@ -1,47 +0,0 @@
- type: entity
id: Windoor
parent: BaseWindoor
name: windoor
description: It's a window and a sliding door. Wow!
- type: entity
id: WindoorSecure
parent: BaseSecureWindoor
name: secure windoor
description: It's a sturdy window and a sliding door. Wow!
# Bar windoor
- type: entity
parent: Windoor
id: WindoorBarLocked
suffix: Bar, Locked
components:
- type: AccessReader
access: [["Bar"]]
# Chemistry windoor
- type: entity
parent: WindoorSecure
id: WindoorMedicalLocked
suffix: Medical, Locked
components:
- type: AccessReader
access: [["Medical"]]
# HOP's office windoor
- type: entity
parent: WindoorSecure
id: WindoorCommandLocked
suffix: Command, Locked
components:
- type: AccessReader
access: [["Command"]]
# Cargo windoor
- type: entity
parent: Windoor
id: WindoorCargoLocked
suffix: Cargo, Locked
components:
- type: AccessReader
access: [["Cargo"]]

View File

@@ -1,112 +0,0 @@
- type: entity
id: BaseWindoor
parent: BaseStructure
abstract: true
placement:
mode: SnapgridCenter
components:
- type: InteractionOutline
- type: Physics
fixtures:
- shape:
!type:PhysShapeAabb
bounds: "-0.2,-0.49,-0.49,0.49"
mass: 50
layer:
- Impassable
- MobImpassable
- VaultImpassable
- SmallImpassable
mask:
- VaultImpassable
- type: Sprite
netsync: false
drawdepth: FloorObjects
sprite: Structures/Doors/Windoors/glass.rsi
layers:
- state: closed
map: [ "enum.DoorVisualLayers.Base" ]
- state: closed_unlit
shader: unshaded
map: [ "enum.DoorVisualLayers.BaseUnlit" ]
- state: welded
map: [ "enum.DoorVisualLayers.BaseWelded" ]
- state: bolted_unlit
shader: unshaded
map: [ "enum.DoorVisualLayers.BaseBolted" ]
- state: panel_open
map: [ "enum.WiresVisualLayers.MaintenancePanel" ]
- type: ApcPowerReceiver
- type: Damageable
resistances: glassResistances
- type: Destructible
thresholds:
- trigger:
!type:DamageTrigger
damage: 200
behaviors:
- !type:SpawnEntitiesBehavior
spawn:
ShardGlass:
min: 1
max: 2
- !type:DoActsBehavior
acts: [ "Destruction" ]
- type: AccessReader
- type: Airlock
- type: Door
- type: Wires
BoardName: "Windoor Control"
LayoutId: Airlock
- type: UserInterface
interfaces:
- key: enum.WiresUiKey.Key
type: WiresBoundUserInterface
- type: Appearance
visuals:
- type: AirlockVisualizer
open_sound: /Audio/Machines/windoor_open.ogg
close_sound: /Audio/Machines/windoor_open.ogg
deny_sound: /Audio/Machines/airlock_deny.ogg
hasMaintenancePanel: false
openCloseUnlit: false
delay: 0.7
- type: entity
id: BaseSecureWindoor
parent: BaseWindoor
abstract: true
components:
- type: Airtight
fixVacuum: true
noAirWhenFullyAirBlocked: false
airBlockedDirection:
- South
- type: Sprite
sprite: Structures/Doors/Windoors/secure.rsi
- type: Destructible
thresholds:
- trigger:
!type:DamageTrigger
damage: 400
behaviors:
- !type:SpawnEntitiesBehavior
spawn:
ShardGlass:
min: 1
max: 2
- !type:SpawnEntitiesBehavior
spawn:
MetalRod:
min: 1
max: 3
- !type:DoActsBehavior
acts: [ "Destruction" ]
# "0.49,-0.49,-0.49,-0.2"
# to:
# (-0.2, -0.49), (-0.2, 0.49), (-0.49, 0.49), (-0.49, -0.49)
# what i want is:
# (0.49, -0.49), (0.49, -0.2), (-0.49, -0.2), (-0.49, -0.49)
# which is:
# "-0.2,-0.49,-0.49,0.49"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 146 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 146 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 146 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 146 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 146 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 146 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -1,21 +0,0 @@
{
"name":1,
"size": {"x":32,"y":32},
"states":
[
{"name":"assembly2","directions":4,"delays":[[0.3,0.3],[0.3,0.3],[0.3,0.3],[0.3,0.3]]},
{"name":"assembly1","directions":4},
{"name":"closed","directions":4},
{"name":"closing","directions":4,"delays":[[0.1,0.1,0.1,0.1,0.1,0.1,0.1],[0.1,0.1,0.1,0.1,0.1,0.1,0.1],[0.1,0.1,0.1,0.1,0.1,0.1,0.1],[0.1,0.1,0.1,0.1,0.1,0.1,0.1]]},
{"name":"open","directions":4},
{"name":"opening","directions":4,"delays":[[0.1,0.1,0.1,0.1,0.1,0.1,0.1],[0.1,0.1,0.1,0.1,0.1,0.1,0.1],[0.1,0.1,0.1,0.1,0.1,0.1,0.1],[0.1,0.1,0.1,0.1,0.1,0.1,0.1]]},
{"name":"deny_unlit","directions":4,"delays":[[0.1,0.2,0.1],[0.1,0.2,0.1],[0.1,0.2,0.1],[0.1,0.2,0.1]]},
{"name":"spark","directions":4,"delays":[[0.1,0.1,0.1,0.1,0.1,0.1],[0.1,0.1,0.1,0.1,0.1,0.1],[0.1,0.1,0.1,0.1,0.1,0.1],[0.1,0.1,0.1,0.1,0.1,0.1]]},
{"name":"closed_unlit","directions":4},
{"name":"panel_open","directions":4},
{"name":"welded","directions":4},
{"name":"bolted_unlit","directions":4}
],
"license":"CC-BY-SA-3.0",
"copyright":"https://github.com/tgstation/tgstation/blob/3681006d7102045e334e8eddb23a8685fcdb258a/icons/obj/doors/windoor.dmi"
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 146 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 146 B

View File

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 141 B

View File

Before

Width:  |  Height:  |  Size: 843 B

After

Width:  |  Height:  |  Size: 843 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 130 B

View File

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 302 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 176 B

View File

@@ -6,15 +6,19 @@
{"name":"assembly2","directions":4,"delays":[[0.3,0.3],[0.3,0.3],[0.3,0.3],[0.3,0.3]]},
{"name":"assembly1","directions":4},
{"name":"closed","directions":4},
{"name":"closed_unlit","directions":4},
{"name":"closing","directions":4,"delays":[[0.1,0.1,0.1,0.1,0.1,0.1,0.1],[0.1,0.1,0.1,0.1,0.1,0.1,0.1],[0.1,0.1,0.1,0.1,0.1,0.1,0.1],[0.1,0.1,0.1,0.1,0.1,0.1,0.1]]},
{"name":"closing_unlit","directions":4,"delays":[[0.1,0.1,0.1,0.1,0.1,0.1,0.1],[0.1,0.1,0.1,0.1,0.1,0.1,0.1],[0.1,0.1,0.1,0.1,0.1,0.1,0.1],[0.1,0.1,0.1,0.1,0.1,0.1,0.1]]},
{"name":"open","directions":4},
{"name":"open_unlit","directions":4},
{"name":"opening","directions":4,"delays":[[0.1,0.1,0.1,0.1,0.1,0.1,0.1],[0.1,0.1,0.1,0.1,0.1,0.1,0.1],[0.1,0.1,0.1,0.1,0.1,0.1,0.1],[0.1,0.1,0.1,0.1,0.1,0.1,0.1]]},
{"name":"opening_unlit","directions":4,"delays":[[0.1,0.1,0.1,0.1,0.1,0.1,0.1],[0.1,0.1,0.1,0.1,0.1,0.1,0.1],[0.1,0.1,0.1,0.1,0.1,0.1,0.1],[0.1,0.1,0.1,0.1,0.1,0.1,0.1]]},
{"name":"deny_unlit","directions":4,"delays":[[0.1,0.2,0.1],[0.1,0.2,0.1],[0.1,0.2,0.1],[0.1,0.2,0.1]]},
{"name":"spark","directions":4,"delays":[[0.1,0.1,0.1,0.1,0.1,0.1],[0.1,0.1,0.1,0.1,0.1,0.1],[0.1,0.1,0.1,0.1,0.1,0.1],[0.1,0.1,0.1,0.1,0.1,0.1]]},
{"name":"closed_unlit","directions":4},
{"name":"panel_open","directions":4},
{"name":"bolted_unlit","directions":4},
{"name":"welded","directions":4},
{"name":"bolted_unlit","directions":4}
{"name":"secure_underlay","directions":4}
],
"license":"CC-BY-SA-3.0",
"copyright":"https://github.com/tgstation/tgstation/blob/3681006d7102045e334e8eddb23a8685fcdb258a/icons/obj/doors/windoor.dmi"

View File

Before

Width:  |  Height:  |  Size: 728 B

After

Width:  |  Height:  |  Size: 728 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 132 B

View File

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 287 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 747 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 476 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 518 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 B