Airlocks rewritten to use appearances, use less ugly sprite from Eris.
@@ -74,6 +74,7 @@
|
|||||||
<Compile Include="EntryPoint.cs" />
|
<Compile Include="EntryPoint.cs" />
|
||||||
<Compile Include="GameObjects\Components\Actor\CharacterInterface.cs" />
|
<Compile Include="GameObjects\Components\Actor\CharacterInterface.cs" />
|
||||||
<Compile Include="GameObjects\Components\DamageableComponent.cs" />
|
<Compile Include="GameObjects\Components\DamageableComponent.cs" />
|
||||||
|
<Compile Include="GameObjects\Components\Doors\AirlockVisualizer2D.cs" />
|
||||||
<Compile Include="GameObjects\Components\HUD\Inventory\ClientInventoryComponent.cs" />
|
<Compile Include="GameObjects\Components\HUD\Inventory\ClientInventoryComponent.cs" />
|
||||||
<Compile Include="GameObjects\Components\Mobs\ICharacterUI.cs" />
|
<Compile Include="GameObjects\Components\Mobs\ICharacterUI.cs" />
|
||||||
<Compile Include="GameObjects\Components\Mobs\SpeciesUI.cs" />
|
<Compile Include="GameObjects\Components\Mobs\SpeciesUI.cs" />
|
||||||
|
|||||||
@@ -0,0 +1,40 @@
|
|||||||
|
using System;
|
||||||
|
using Content.Shared.GameObjects.Components.Doors;
|
||||||
|
using SS14.Client.GameObjects;
|
||||||
|
using SS14.Client.Interfaces.GameObjects.Components;
|
||||||
|
|
||||||
|
namespace Content.Client.GameObjects.Components.Doors
|
||||||
|
{
|
||||||
|
public class AirlockVisualizer2D : AppearanceVisualizer
|
||||||
|
{
|
||||||
|
public override void OnChangeData(AppearanceComponent component)
|
||||||
|
{
|
||||||
|
base.OnChangeData(component);
|
||||||
|
|
||||||
|
var sprite = component.Owner.GetComponent<ISpriteComponent>();
|
||||||
|
if (!component.TryGetData(DoorVisuals.VisualState, out DoorVisualState state))
|
||||||
|
{
|
||||||
|
state = DoorVisualState.Closed;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (state)
|
||||||
|
{
|
||||||
|
case DoorVisualState.Closed:
|
||||||
|
case DoorVisualState.Closing:
|
||||||
|
sprite.LayerSetState(DoorVisualLayers.Base, "closed");
|
||||||
|
break;
|
||||||
|
case DoorVisualState.Opening:
|
||||||
|
case DoorVisualState.Open:
|
||||||
|
sprite.LayerSetState(DoorVisualLayers.Base, "open");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
throw new ArgumentOutOfRangeException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum DoorVisualLayers
|
||||||
|
{
|
||||||
|
Base
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -9,6 +9,7 @@ using SS14.Shared.Log;
|
|||||||
using SS14.Shared.Maths;
|
using SS14.Shared.Maths;
|
||||||
using SS14.Shared.IoC;
|
using SS14.Shared.IoC;
|
||||||
using Content.Server.GameObjects.EntitySystems;
|
using Content.Server.GameObjects.EntitySystems;
|
||||||
|
using Content.Shared.GameObjects.Components.Doors;
|
||||||
using SS14.Shared.Serialization;
|
using SS14.Shared.Serialization;
|
||||||
using SS14.Shared.Interfaces.Network;
|
using SS14.Shared.Interfaces.Network;
|
||||||
using SS14.Shared.ViewVariables;
|
using SS14.Shared.ViewVariables;
|
||||||
@@ -24,31 +25,20 @@ namespace Content.Server.GameObjects
|
|||||||
private float OpenTimeCounter;
|
private float OpenTimeCounter;
|
||||||
|
|
||||||
private CollidableComponent collidableComponent;
|
private CollidableComponent collidableComponent;
|
||||||
private SpriteComponent spriteComponent;
|
private AppearanceComponent _appearance;
|
||||||
|
|
||||||
private string OpenSprite;
|
|
||||||
private string CloseSprite;
|
|
||||||
|
|
||||||
public override void ExposeData(ObjectSerializer serializer)
|
|
||||||
{
|
|
||||||
base.ExposeData(serializer);
|
|
||||||
|
|
||||||
serializer.DataField(ref OpenSprite, "openstate", "Objects/door_ewo.png");
|
|
||||||
serializer.DataField(ref CloseSprite, "closestate", "Objects/door_ew.png");
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
{
|
{
|
||||||
base.Initialize();
|
base.Initialize();
|
||||||
|
|
||||||
collidableComponent = Owner.GetComponent<CollidableComponent>();
|
collidableComponent = Owner.GetComponent<CollidableComponent>();
|
||||||
spriteComponent = Owner.GetComponent<SpriteComponent>();
|
_appearance = Owner.GetComponent<AppearanceComponent>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void OnRemove()
|
public override void OnRemove()
|
||||||
{
|
{
|
||||||
collidableComponent = null;
|
collidableComponent = null;
|
||||||
spriteComponent = null;
|
_appearance = null;
|
||||||
|
|
||||||
base.OnRemove();
|
base.OnRemove();
|
||||||
}
|
}
|
||||||
@@ -87,7 +77,7 @@ namespace Content.Server.GameObjects
|
|||||||
{
|
{
|
||||||
Opened = true;
|
Opened = true;
|
||||||
collidableComponent.IsHardCollidable = false;
|
collidableComponent.IsHardCollidable = false;
|
||||||
spriteComponent.LayerSetTexture(0, OpenSprite);
|
_appearance.SetData(DoorVisuals.VisualState, DoorVisualState.Open);
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Close()
|
public bool Close()
|
||||||
@@ -100,7 +90,7 @@ namespace Content.Server.GameObjects
|
|||||||
Opened = false;
|
Opened = false;
|
||||||
OpenTimeCounter = 0;
|
OpenTimeCounter = 0;
|
||||||
collidableComponent.IsHardCollidable = true;
|
collidableComponent.IsHardCollidable = true;
|
||||||
spriteComponent.LayerSetTexture(0, CloseSprite);
|
_appearance.SetData(DoorVisuals.VisualState, DoorVisualState.Closed);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -64,6 +64,7 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="EntryPoint.cs" />
|
<Compile Include="EntryPoint.cs" />
|
||||||
<Compile Include="GameObjects\Components\Damage\DamageableComponent.cs" />
|
<Compile Include="GameObjects\Components\Damage\DamageableComponent.cs" />
|
||||||
|
<Compile Include="GameObjects\Components\Doors\SharedDoorComponent.cs" />
|
||||||
<Compile Include="GameObjects\Components\Inventory\EquipmentSlotDefinitions.cs" />
|
<Compile Include="GameObjects\Components\Inventory\EquipmentSlotDefinitions.cs" />
|
||||||
<Compile Include="GameObjects\Components\Inventory\InventoryTemplates.cs" />
|
<Compile Include="GameObjects\Components\Inventory\InventoryTemplates.cs" />
|
||||||
<Compile Include="GameObjects\Components\Inventory\SharedInventoryComponent.cs" />
|
<Compile Include="GameObjects\Components\Inventory\SharedInventoryComponent.cs" />
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
using System;
|
||||||
|
using SS14.Shared.Serialization;
|
||||||
|
|
||||||
|
namespace Content.Shared.GameObjects.Components.Doors
|
||||||
|
{
|
||||||
|
[NetSerializable]
|
||||||
|
[Serializable]
|
||||||
|
public enum DoorVisuals
|
||||||
|
{
|
||||||
|
VisualState,
|
||||||
|
}
|
||||||
|
|
||||||
|
[NetSerializable]
|
||||||
|
[Serializable]
|
||||||
|
public enum DoorVisualState
|
||||||
|
{
|
||||||
|
Closed,
|
||||||
|
Opening,
|
||||||
|
Open,
|
||||||
|
Closing,
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -166,7 +166,7 @@ entities:
|
|||||||
pos: 6,-4
|
pos: 6,-4
|
||||||
rot: -1.570796 rad
|
rot: -1.570796 rad
|
||||||
type: Transform
|
type: Transform
|
||||||
- type: DoorContent
|
- type: airlock
|
||||||
components:
|
components:
|
||||||
- grid: 0
|
- grid: 0
|
||||||
pos: -5.5,-4.5
|
pos: -5.5,-4.5
|
||||||
@@ -238,7 +238,7 @@ entities:
|
|||||||
pos: -2.5,-4.5
|
pos: -2.5,-4.5
|
||||||
rot: -1.570796 rad
|
rot: -1.570796 rad
|
||||||
type: Transform
|
type: Transform
|
||||||
- type: DoorContent
|
- type: airlock
|
||||||
components:
|
components:
|
||||||
- grid: 0
|
- grid: 0
|
||||||
pos: 4.5,-4.5
|
pos: 4.5,-4.5
|
||||||
|
|||||||
@@ -1,23 +1,24 @@
|
|||||||
- type: entity
|
- type: entity
|
||||||
id: DoorContent
|
id: airlock
|
||||||
name: Actual door
|
name: Airlock
|
||||||
description: It opens, it closes!
|
description: It opens, it closes, and maybe crushes you.
|
||||||
components:
|
components:
|
||||||
- type: Clickable
|
- type: Clickable
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
|
|
||||||
drawdepth: Mobs # They're on the same layer as mobs, perspective.
|
drawdepth: Mobs # They're on the same layer as mobs, perspective.
|
||||||
texture: Objects/door_ew.png
|
sprite: Buildings/airlock_basic.rsi
|
||||||
|
layers:
|
||||||
|
- state: closed
|
||||||
|
map: ["enum.DoorVisualLayers.Base"]
|
||||||
|
|
||||||
- type: Icon
|
- type: Icon
|
||||||
texture: Objects/door_ew.png
|
sprite: Buildings/airlock_basic.rsi
|
||||||
|
state: closed
|
||||||
|
|
||||||
- type: BoundingBox
|
- type: BoundingBox
|
||||||
aabb: "-2,-0.75,-1,0.75"
|
|
||||||
sizeX: 1.9
|
|
||||||
offsetY: 1.5
|
|
||||||
- type: Collidable
|
- type: Collidable
|
||||||
- type: Door
|
- type: Door
|
||||||
|
- type: Appearance
|
||||||
placement:
|
visuals:
|
||||||
snap:
|
- type: AirlockVisualizer2D
|
||||||
- Wall
|
|
||||||
|
|||||||
BIN
Resources/Textures/Buildings/airlock_basic.rsi/closed.png
Normal file
|
After Width: | Height: | Size: 933 B |
BIN
Resources/Textures/Buildings/airlock_basic.rsi/closing.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
Resources/Textures/Buildings/airlock_basic.rsi/deny.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
Resources/Textures/Buildings/airlock_basic.rsi/locked.png
Normal file
|
After Width: | Height: | Size: 933 B |
1
Resources/Textures/Buildings/airlock_basic.rsi/meta.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{"version": 1, "size": {"x": 32, "y": 32}, "license": "CC-BY-SA-3.0", "copyright": "Taken from https://github.com/discordia-space/CEV-Eris/blob/2b969adc2dfd3e9621bf3597c5cbffeb3ac8c9f0/icons/obj/doors/doorint.dmi", "states": [{"name": "closed", "directions": 1, "delays": [[1.0]]}, {"name": "closing", "directions": 1, "delays": [[0.2, 0.2, 0.1, 0.1, 0.1, 0.1, 0.1, 0.3]]}, {"name": "deny", "directions": 1, "delays": [[0.1, 0.1, 0.1]]}, {"name": "locked", "directions": 1, "delays": [[1.0]]}, {"name": "o_closing", "directions": 1, "delays": [[0.2, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.4]]}, {"name": "o_opening", "directions": 1, "delays": [[0.2, 0.2, 0.1, 0.1, 0.1, 0.1, 0.1, 0.3]]}, {"name": "open", "directions": 1, "delays": [[1.0]]}, {"name": "opening", "directions": 1, "delays": [[0.2, 0.2, 0.1, 0.1, 0.1, 0.1, 0.1, 0.3]]}, {"name": "spark", "directions": 1, "delays": [[0.1, 0.1, 0.1, 0.1, 0.1, 0.1]]}]}
|
||||||
BIN
Resources/Textures/Buildings/airlock_basic.rsi/o_closing.png
Normal file
|
After Width: | Height: | Size: 2.5 KiB |
BIN
Resources/Textures/Buildings/airlock_basic.rsi/o_opening.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
Resources/Textures/Buildings/airlock_basic.rsi/open.png
Normal file
|
After Width: | Height: | Size: 278 B |
BIN
Resources/Textures/Buildings/airlock_basic.rsi/opening.png
Normal file
|
After Width: | Height: | Size: 2.3 KiB |
BIN
Resources/Textures/Buildings/airlock_basic.rsi/spark.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |