Added fireaxe cabinets (#4221)

* Added fireaxe cabinets

* Now inserts and renamed ItemCabinetVisuals file

* Added netsync

* Cut out layers for future ItemCabinetVisualizer work and reorganized some RSIs

* Update Resources/Textures/Constructible/Storage/Cabinets/extinguisher_cabinet.rsi/meta.json

* Update Resources/Textures/Constructible/Storage/Cabinets/extinguisher_cabinet.rsi/meta.json

Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
This commit is contained in:
Swept
2021-06-25 03:27:22 +00:00
committed by GitHub
parent fcbe0baea4
commit d6805f47a3
32 changed files with 167 additions and 41 deletions

View File

@@ -1,4 +1,4 @@
using Content.Shared.Cabinet;
using Content.Shared.Cabinet;
using JetBrains.Annotations;
using Robust.Client.GameObjects;
using Robust.Shared.Serialization.Manager.Attributes;
@@ -18,32 +18,38 @@ namespace Content.Client.Cabinet
[DataField("closedState", required: true)]
private string _closedState = default!;
[DataField("closedEmptyState", required: true)]
private string _closedEmptyState = default!;
public override void OnChangeData(AppearanceComponent component)
{
base.OnChangeData(component);
if (component.Owner.TryGetComponent<SpriteComponent>(out var sprite)
&& component.TryGetData(ItemCabinetVisuals.IsOpen, out bool isOpen))
&& component.TryGetData(ItemCabinetVisuals.IsOpen, out bool isOpen)
&& component.TryGetData(ItemCabinetVisuals.ContainsItem, out bool contains))
{
if (isOpen)
{
if (component.TryGetData(ItemCabinetVisuals.ContainsItem, out bool contains))
if (contains)
{
if (contains)
{
sprite.LayerSetState(0, _fullState);
}
else
{
sprite.LayerSetState(0, _emptyState);
}
sprite.LayerSetState(0, _fullState);
}
else
{
sprite.LayerSetState(0, _emptyState);
}
}
else
if (contains)
{
sprite.LayerSetState(0, _closedState);
}
else
{
sprite.LayerSetState(0, _closedEmptyState);
}
}
}
}

View File

@@ -6,7 +6,8 @@
- type: Clickable
- type: InteractionOutline
- type: Sprite
sprite: Constructible/Misc/extinguisher_cabinet.rsi
sprite: Constructible/Storage/Cabinets/extinguisher_cabinet.rsi
netsync: false
state: extinguisher_closed
- type: ItemCabinet
doorSound: /Audio/Machines/machine_switch.ogg
@@ -19,6 +20,7 @@
emptyState: extinguisher_empty
fullState: extinguisher_full
closedState: extinguisher_closed
closedEmptyState: extinguisher_closed
placement:
mode: SnapgridCenter

View File

@@ -0,0 +1,49 @@
- type: entity
id: FireAxeCabinet
name: fire axe cabinet
description: There is a small label that reads \"For Emergency use only\" along with details for safe use of the axe. As if.
components:
- type: Clickable
- type: InteractionOutline
- type: Sprite
sprite: Constructible/Storage/Cabinets/fireaxe_cabinet.rsi
netsync: false
state: cabinet-filled-closed
- type: ItemCabinet
doorSound: /Audio/Machines/machine_switch.ogg
whitelist:
tags:
- FireAxe
- type: Appearance
visuals:
- type: ItemCabinetVisualizer
emptyState: cabinet-empty-open
fullState: cabinet-filled-open
closedState: cabinet-filled-closed
closedEmptyState: cabinet-empty-closed
placement:
mode: SnapgridCenter
- type: entity
id: FireAxeCabinetOpen
parent: FireAxeCabinet
suffix: Open
components:
- type: ItemCabinet
opened: true
- type: entity
id: FireAxeCabinetFilled
parent: FireAxeCabinet
suffix: Filled
components:
- type: ItemCabinet
spawnPrototype: FireAxe
- type: entity
id: FireAxeCabinetFilledOpen
parent: FireAxeCabinetFilled
suffix: Filled, Open
components:
- type: ItemCabinet
opened: true

View File

@@ -4,12 +4,14 @@
id: FireAxe
description: A large, robust axe. Can pry open doors and skulls alike.
components:
- type: Tag
tags:
- FireAxe
- type: Sprite
sprite: Objects/Weapons/Melee/fireaxe.rsi
state: icon
- type: MeleeWeapon
damage: 25
- type: Item
size: 24
sprite: Objects/Weapons/Melee/fireaxe.rsi
prefix: inhand

View File

@@ -10,6 +10,9 @@
- type: Tag
id: ExplosivePassable
- type: Tag
id: FireAxe
- type: Tag
id: FirelockElectronics

View File

@@ -1,27 +0,0 @@
{
"version": 1,
"size": {
"x": 32,
"y": 32
},
"license": "CC-BY-SA-3.0",
"copyright": "Taken from https://github.com/tgstation/tgstation at commit d0d81185f09ca30d3b0856d476544240dba0de53",
"states": [
{
"name": "extinguisher_closed",
},
{
"name": "extinguisher_empty",
},
{
"name": "extinguisher_full",
},
{
"name": "extinguisher_mini",
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 384 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 205 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 273 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 248 B

View File

@@ -0,0 +1,38 @@
{
"version": 1,
"license": "CC-BY-SA-3.0",
"copyright": "Taken from tgstation at https://github.com/tgstation/tgstation/commit/d0d81185f09ca30d3b0856d476544240dba0de53",
"size": {
"x": 32,
"y": 32
},
"states": [
{
"name": "extinguisher_closed"
},
{
"name": "extinguisher_empty"
},
{
"name": "extinguisher_full"
},
{
"name": "extinguisher_mini"
},
{
"name": "closed"
},
{
"name": "extinguisher"
},
{
"name": "extinguisher-mini"
},
{
"name": "frame"
},
{
"name": "open"
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 285 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 592 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 461 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 833 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 790 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 249 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 335 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 328 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 396 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 579 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 636 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 255 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 B

View File

@@ -0,0 +1,53 @@
{
"version": 1,
"license": "CC-BY-SA-3.0",
"copyright": "Taken from tgstation at https://github.com/tgstation/tgstation/commit/d0d81185f09ca30d3b0856d476544240dba0de53",
"size": {
"x": 32,
"y": 32
},
"states": [
{
"name": "cabinet-empty-closed"
},
{
"name": "cabinet-empty-open"
},
{
"name": "cabinet-filled-open"
},
{
"name": "cabinet-filled-closed"
},
{
"name": "cabinet"
},
{
"name": "fireaxe"
},
{
"name": "glass"
},
{
"name": "glass-1"
},
{
"name": "glass-2"
},
{
"name": "glass-3"
},
{
"name": "glass-4"
},
{
"name": "glass-up"
},
{
"name": "unlocked"
},
{
"name": "locked"
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 B