Improve autolathe & protolathe visuals.

Used correct Eris autolathe sprite.
Gave them an unlit layer.
This commit is contained in:
Pieter-Jan Briers
2019-10-14 09:57:57 +02:00
parent f3f05b0396
commit 9a38577a18
23 changed files with 612 additions and 12 deletions

View File

@@ -0,0 +1,25 @@
using Content.Shared.GameObjects.Components.Power;
using JetBrains.Annotations;
using Robust.Client.GameObjects;
using Robust.Client.Interfaces.GameObjects.Components;
namespace Content.Client.GameObjects.Components.Power
{
[UsedImplicitly]
public class PowerDeviceVisualizer2D : AppearanceVisualizer
{
public override void OnChangeData(AppearanceComponent component)
{
base.OnChangeData(component);
var sprite = component.Owner.GetComponent<ISpriteComponent>();
var powered = component.TryGetData(PowerDeviceVisuals.Powered, out bool poweredVar) && poweredVar;
sprite.LayerSetVisible(PowerDeviceVisualLayers.Powered, powered);
}
}
public enum PowerDeviceVisualLayers
{
Powered
}
}

View File

@@ -2,6 +2,8 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using Content.Server.GameObjects.EntitySystems; using Content.Server.GameObjects.EntitySystems;
using Content.Shared.GameObjects.Components.Power;
using Robust.Server.GameObjects;
using Robust.Shared.GameObjects; using Robust.Shared.GameObjects;
using Robust.Shared.Interfaces.GameObjects; using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.Interfaces.GameObjects.Components; using Robust.Shared.Interfaces.GameObjects.Components;
@@ -248,15 +250,14 @@ namespace Content.Server.GameObjects.Components.Power
{ {
var oldPowered = Powered; var oldPowered = Powered;
Powered = !IsPowerCut && (ExternalPowered || InternalPowered); Powered = !IsPowerCut && (ExternalPowered || InternalPowered);
if (oldPowered != Powered) if (oldPowered != Powered)
{ {
if (Powered) OnPowerStateChanged?.Invoke(this, new PowerStateEventArgs(Powered));
if (Owner.TryGetComponent(out AppearanceComponent appearance))
{ {
OnPowerStateChanged?.Invoke(this, new PowerStateEventArgs(true)); appearance.SetData(PowerDeviceVisuals.Powered, Powered);
}
else
{
OnPowerStateChanged?.Invoke(this, new PowerStateEventArgs(false));
} }
} }
} }

View File

@@ -0,0 +1,11 @@
using System;
using Robust.Shared.Serialization;
namespace Content.Shared.GameObjects.Components.Power
{
[Serializable, NetSerializable]
public enum PowerDeviceVisuals
{
Powered
}
}

View File

@@ -12,7 +12,7 @@
interfaces: interfaces:
- key: enum.LatheUiKey.Key - key: enum.LatheUiKey.Key
type: LatheBoundUserInterface type: LatheBoundUserInterface
- type: PowerDevice
- type: entity - type: entity
parent: BaseLathe parent: BaseLathe
@@ -21,10 +21,14 @@
components: components:
- type: Sprite - type: Sprite
sprite: Buildings/autolathe.rsi sprite: Buildings/autolathe.rsi
state: idle layers:
- state: autolathe
- state: autolathe_unlit
shader: unshaded
map: ["enum.PowerDeviceVisualLayers.Powered"]
- type: Icon - type: Icon
sprite: Buildings/autolathe.rsi sprite: Buildings/autolathe.rsi
state: idle state: autolathe
- type: Collidable - type: Collidable
shapes: shapes:
- !type:PhysShapeAabb - !type:PhysShapeAabb
@@ -49,6 +53,9 @@
- CableStack - CableStack
- Crowbar - Crowbar
- Multitool - Multitool
- type: Appearance
visuals:
- type: PowerDeviceVisualizer2D
- type: entity - type: entity
parent: BaseLathe parent: BaseLathe
@@ -57,7 +64,11 @@
components: components:
- type: Sprite - type: Sprite
sprite: Buildings/research.rsi sprite: Buildings/research.rsi
state: protolathe layers:
- state: protolathe
- state: protolathe_unlit
shader: unshaded
map: ["enum.PowerDeviceVisualLayers.Powered"]
- type: Icon - type: Icon
sprite: Buildings/research.rsi sprite: Buildings/research.rsi
state: protolathe state: protolathe
@@ -91,3 +102,6 @@
type: LatheBoundUserInterface type: LatheBoundUserInterface
- key: enum.ResearchClientUiKey.Key - key: enum.ResearchClientUiKey.Key
type: ResearchClientBoundUserInterface type: ResearchClientBoundUserInterface
- type: Appearance
visuals:
- type: PowerDeviceVisualizer2D

Binary file not shown.

After

Width:  |  Height:  |  Size: 733 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 685 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 656 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 298 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 276 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 627 B

View File

@@ -1 +1,121 @@
{"version": 1, "size": {"x": 32, "y": 32}, "license": "CC-BY-SA-3.0", "copyright": "Taken from https://github.com/discordia-space/CEV-Eris/blob/master/icons/obj/machines/excelsior/autolathe.dmi", "states": [{"name": "closing", "directions": 1, "delays": [[0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1]]}, {"name": "idle", "directions": 1, "delays": [[1.0]]}, {"name": "opening", "directions": 1, "delays": [[0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1]]}, {"name": "panel", "directions": 1, "delays": [[1.0]]}, {"name": "stanok", "directions": 1, "delays": [[1.0]]}, {"name": "workdone", "directions": 1, "delays": [[0.1, 0.1, 0.1, 0.1, 0.5, 0.1, 0.1, 0.5]]}, {"name": "working", "directions": 1, "delays": [[0.1, 0.1, 0.1, 0.1, 0.1]]}]} {
"version": 1,
"size": {
"x": 32,
"y": 32
},
"states": [
{
"name": "autolathe",
"directions": 1,
"delays": [
[
1.0
]
]
},
{
"name": "autolathe_unlit",
"directions": 1,
"delays": [
[
1.0
]
]
},
{
"name": "autolathe_building",
"directions": 1,
"delays": [
[
0.15,
0.15,
0.15,
0.15,
0.15,
0.15,
0.15,
0.15,
0.15
]
]
},
{
"name": "autolathe_building_unlit",
"directions": 1,
"delays": [
[
0.15,
0.15,
0.15,
0.15,
0.15,
0.15,
0.15,
0.15,
0.15
]
]
},
{
"name": "autolathe_inserting",
"directions": 1,
"delays": [
[
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1
]
]
},
{
"name": "autolathe_inserting_unlit",
"directions": 1,
"delays": [
[
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1
]
]
},
{
"name": "autolathe_panel",
"directions": 1,
"delays": [
[
1.0
]
]
},
{
"name": "autolathe_r",
"directions": 1,
"delays": [
[
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1
]
]
}
]
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 205 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 577 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 986 B

View File

@@ -1 +1,430 @@
{"version": 1, "size": {"x": 32, "y": 32}, "license": "CC-BY-SA-3.0", "copyright": "Taken from https://github.com/discordia-space/CEV-Eris/blob/master/icons/obj/machines/excelsior/autolathe.dmi at 40b254106b46981b8ad95ccd5589deb8fa56e765", "states": [{"name": "circuit_imprinter", "directions": 1, "delays": [[1.0]]}, {"name": "circuit_imprinter_ani", "directions": 1, "delays": [[0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08]]}, {"name": "circuit_imprinter_t", "directions": 1, "delays": [[1.0]]}, {"name": "d_analyzer", "directions": 1, "delays": [[1.0]]}, {"name": "d_analyzer_l", "directions": 1, "delays": [[1.0]]}, {"name": "d_analyzer_la", "directions": 1, "delays": [[0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1]]}, {"name": "d_analyzer_process", "directions": 1, "delays": [[0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09, 0.09]]}, {"name": "d_analyzer_t", "directions": 1, "delays": [[1.0]]}, {"name": "protolathe", "directions": 1, "delays": [[1.0]]}, {"name": "protolathe_adamantine", "directions": 1, "delays": [[0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088]]}, {"name": "protolathe_bananium", "directions": 1, "delays": [[0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088]]}, {"name": "protolathe_diamond", "directions": 1, "delays": [[0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088]]}, {"name": "protolathe_glass", "directions": 1, "delays": [[0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088]]}, {"name": "protolathe_gold", "directions": 1, "delays": [[0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088]]}, {"name": "protolathe_metal", "directions": 1, "delays": [[0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088]]}, {"name": "protolathe_n", "directions": 1, "delays": [[0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05]]}, {"name": "protolathe_silver", "directions": 1, "delays": [[0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088]]}, {"name": "protolathe_solid plasma", "directions": 1, "delays": [[0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088]]}, {"name": "protolathe_t", "directions": 1, "delays": [[1.0]]}, {"name": "protolathe_uranium", "directions": 1, "delays": [[0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088, 0.088]]}, {"name": "server", "directions": 1, "delays": [[1.0]]}, {"name": "server-nopower", "directions": 1, "delays": [[1.0]]}, {"name": "server-off", "directions": 1, "delays": [[1.0]]}, {"name": "server-on", "directions": 1, "delays": [[1.0]]}, {"name": "server_o", "directions": 1, "delays": [[1.0]]}, {"name": "tdoppler", "directions": 4, "delays": [[0.8, 0.2], [0.8, 0.2], [0.8, 0.2], [0.8, 0.2]]}, {"name": "tdoppler-broken", "directions": 1, "delays": [[0.1, 0.1, 0.1]]}, {"name": "tdoppler-off", "directions": 1, "delays": [[1.0]]}]} {
"version": 1,
"size": {
"x": 32,
"y": 32
},
"license": "CC-BY-SA-3.0",
"copyright": "Taken from https://github.com/discordia-space/CEV-Eris/blob/master/icons/obj/machines/excelsior/autolathe.dmi at 40b254106b46981b8ad95ccd5589deb8fa56e765",
"states": [
{
"name": "circuit_imprinter",
"directions": 1,
"delays": [
[
1.0
]
]
},
{
"name": "circuit_imprinter_ani",
"directions": 1,
"delays": [
[
0.08,
0.08,
0.08,
0.08,
0.08,
0.08,
0.08,
0.08,
0.08,
0.08,
0.08,
0.08,
0.08,
0.08,
0.08,
0.08,
0.08,
0.08,
0.08,
0.08,
0.08,
0.08,
0.08,
0.08,
0.08
]
]
},
{
"name": "circuit_imprinter_t",
"directions": 1,
"delays": [
[
1.0
]
]
},
{
"name": "d_analyzer",
"directions": 1,
"delays": [
[
1.0
]
]
},
{
"name": "d_analyzer_l",
"directions": 1,
"delays": [
[
1.0
]
]
},
{
"name": "d_analyzer_la",
"directions": 1,
"delays": [
[
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1
]
]
},
{
"name": "d_analyzer_process",
"directions": 1,
"delays": [
[
0.09,
0.09,
0.09,
0.09,
0.09,
0.09,
0.09,
0.09,
0.09,
0.09,
0.09,
0.09,
0.09,
0.09,
0.09,
0.09,
0.09,
0.09,
0.09,
0.09,
0.09,
0.09,
0.09,
0.09,
0.09,
0.09,
0.09
]
]
},
{
"name": "d_analyzer_t",
"directions": 1,
"delays": [
[
1.0
]
]
},
{
"name": "protolathe",
"directions": 1,
"delays": [
[
1.0
]
]
},
{
"name": "protolathe_unlit",
"directions": 1,
"delays": [
[
1.0
]
]
},
{
"name": "protolathe_adamantine",
"directions": 1,
"delays": [
[
0.088,
0.088,
0.088,
0.088,
0.088,
0.088,
0.088,
0.088,
0.088
]
]
},
{
"name": "protolathe_bananium",
"directions": 1,
"delays": [
[
0.088,
0.088,
0.088,
0.088,
0.088,
0.088,
0.088,
0.088,
0.088
]
]
},
{
"name": "protolathe_diamond",
"directions": 1,
"delays": [
[
0.088,
0.088,
0.088,
0.088,
0.088,
0.088,
0.088,
0.088,
0.088
]
]
},
{
"name": "protolathe_glass",
"directions": 1,
"delays": [
[
0.088,
0.088,
0.088,
0.088,
0.088,
0.088,
0.088,
0.088,
0.088
]
]
},
{
"name": "protolathe_gold",
"directions": 1,
"delays": [
[
0.088,
0.088,
0.088,
0.088,
0.088,
0.088,
0.088,
0.088,
0.088
]
]
},
{
"name": "protolathe_metal",
"directions": 1,
"delays": [
[
0.088,
0.088,
0.088,
0.088,
0.088,
0.088,
0.088,
0.088,
0.088
]
]
},
{
"name": "protolathe_n",
"directions": 1,
"delays": [
[
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05
]
]
},
{
"name": "protolathe_silver",
"directions": 1,
"delays": [
[
0.088,
0.088,
0.088,
0.088,
0.088,
0.088,
0.088,
0.088,
0.088
]
]
},
{
"name": "protolathe_solid plasma",
"directions": 1,
"delays": [
[
0.088,
0.088,
0.088,
0.088,
0.088,
0.088,
0.088,
0.088,
0.088
]
]
},
{
"name": "protolathe_t",
"directions": 1,
"delays": [
[
1.0
]
]
},
{
"name": "protolathe_uranium",
"directions": 1,
"delays": [
[
0.088,
0.088,
0.088,
0.088,
0.088,
0.088,
0.088,
0.088,
0.088
]
]
},
{
"name": "server",
"directions": 1,
"delays": [
[
1.0
]
]
},
{
"name": "server-nopower",
"directions": 1,
"delays": [
[
1.0
]
]
},
{
"name": "server-off",
"directions": 1,
"delays": [
[
1.0
]
]
},
{
"name": "server-on",
"directions": 1,
"delays": [
[
1.0
]
]
},
{
"name": "server_o",
"directions": 1,
"delays": [
[
1.0
]
]
},
{
"name": "tdoppler",
"directions": 4,
"delays": [
[
0.8,
0.2
],
[
0.8,
0.2
],
[
0.8,
0.2
],
[
0.8,
0.2
]
]
},
{
"name": "tdoppler-broken",
"directions": 1,
"delays": [
[
0.1,
0.1,
0.1
]
]
},
{
"name": "tdoppler-off",
"directions": 1,
"delays": [
[
1.0
]
]
}
]
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 879 B

After

Width:  |  Height:  |  Size: 807 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 310 B