Import proper reinforced wall sprites.

This commit is contained in:
Pieter-Jan Briers
2020-04-25 12:10:28 +02:00
parent bc82159878
commit f636303b8e
32 changed files with 81 additions and 123 deletions

View File

@@ -101,7 +101,7 @@ namespace Content.Client.GameObjects.Components.IconSmoothing
switch (Mode)
{
case IconSmoothingMode.Corners:
CalculateNewSpriteCorers();
CalculateNewSpriteCorners();
break;
case IconSmoothingMode.CardinalFlags:
@@ -129,7 +129,17 @@ namespace Content.Client.GameObjects.Components.IconSmoothing
Sprite.LayerSetState(0, $"{StateBase}{(int) dirs}");
}
private void CalculateNewSpriteCorers()
private void CalculateNewSpriteCorners()
{
var (cornerNE, cornerNW, cornerSW, cornerSE) = CalculateCornerFill();
Sprite.LayerSetState(CornerLayers.NE, $"{StateBase}{(int) cornerNE}");
Sprite.LayerSetState(CornerLayers.SE, $"{StateBase}{(int) cornerSE}");
Sprite.LayerSetState(CornerLayers.SW, $"{StateBase}{(int) cornerSW}");
Sprite.LayerSetState(CornerLayers.NW, $"{StateBase}{(int) cornerNW}");
}
protected (CornerFill ne, CornerFill nw, CornerFill sw, CornerFill se) CalculateCornerFill()
{
var n = MatchingEntity(SnapGrid.GetInDir(Direction.North));
var ne = MatchingEntity(SnapGrid.GetInDir(Direction.NorthEast));
@@ -191,10 +201,7 @@ namespace Content.Client.GameObjects.Components.IconSmoothing
cornerNW |= CornerFill.Diagonal;
}
Sprite.LayerSetState(CornerLayers.NE, $"{StateBase}{(int) cornerNE}");
Sprite.LayerSetState(CornerLayers.SE, $"{StateBase}{(int) cornerSE}");
Sprite.LayerSetState(CornerLayers.SW, $"{StateBase}{(int) cornerSW}");
Sprite.LayerSetState(CornerLayers.NW, $"{StateBase}{(int) cornerNW}");
return (cornerNE, cornerNW, cornerSW, cornerSE);
}
/// <inheritdoc />
@@ -258,7 +265,6 @@ namespace Content.Client.GameObjects.Components.IconSmoothing
Clockwise = 4,
}
[SuppressMessage("ReSharper", "InconsistentNaming")]
public enum CornerLayers
{
SE,

View File

@@ -0,0 +1,60 @@
using Content.Client.GameObjects.Components.IconSmoothing;
using Robust.Shared.GameObjects;
using Robust.Shared.Serialization;
using Robust.Shared.ViewVariables;
using static Robust.Client.GameObjects.SpriteComponent;
namespace Content.Client.GameObjects.Components
{
[RegisterComponent]
[ComponentReference(typeof(IconSmoothComponent))]
public class ReinforcedWallComponent : IconSmoothComponent
{
public override string Name => "ReinforcedWall";
[ViewVariables(VVAccess.ReadWrite)]
private string _reinforcedStateBase;
public override void ExposeData(ObjectSerializer serializer)
{
base.ExposeData(serializer);
serializer.DataField(ref _reinforcedStateBase, "reinforcedBase", null);
}
protected override void Startup()
{
base.Startup();
var state0 = $"{_reinforcedStateBase}0";
Sprite.LayerMapSet(ReinforcedCornerLayers.SE, Sprite.AddLayerState(state0));
Sprite.LayerSetDirOffset(ReinforcedCornerLayers.SE, DirectionOffset.None);
Sprite.LayerMapSet(ReinforcedCornerLayers.NE, Sprite.AddLayerState(state0));
Sprite.LayerSetDirOffset(ReinforcedCornerLayers.NE, DirectionOffset.CounterClockwise);
Sprite.LayerMapSet(ReinforcedCornerLayers.NW, Sprite.AddLayerState(state0));
Sprite.LayerSetDirOffset(ReinforcedCornerLayers.NW, DirectionOffset.Flip);
Sprite.LayerMapSet(ReinforcedCornerLayers.SW, Sprite.AddLayerState(state0));
Sprite.LayerSetDirOffset(ReinforcedCornerLayers.SW, DirectionOffset.Clockwise);
}
internal override void CalculateNewSprite()
{
base.CalculateNewSprite();
var (cornerNE, cornerNW, cornerSW, cornerSE) = CalculateCornerFill();
Sprite.LayerSetState(ReinforcedCornerLayers.NE, $"{_reinforcedStateBase}{(int) cornerNE}");
Sprite.LayerSetState(ReinforcedCornerLayers.SE, $"{_reinforcedStateBase}{(int) cornerSE}");
Sprite.LayerSetState(ReinforcedCornerLayers.SW, $"{_reinforcedStateBase}{(int) cornerSW}");
Sprite.LayerSetState(ReinforcedCornerLayers.NW, $"{_reinforcedStateBase}{(int) cornerNW}");
}
public enum ReinforcedCornerLayers
{
SE,
NE,
NW,
SW,
}
}
}

View File

@@ -220,15 +220,18 @@
parent: base_wall
components:
- type: Sprite
sprite: Buildings/Walls/reinforced.rsi
color: "#889192"
sprite: Buildings/Walls/solid.rsi
- type: Icon
sprite: Buildings/Walls/reinforced.rsi
sprite: Buildings/Walls/solid.rsi
state: rgeneric
- type: Destructible
thresholdvalue: 300
spawnondestroy: Girder
- type: IconSmooth
- type: ReinforcedWall
key: walls
base: reinforced
base: solid
reinforcedBase: reinf_over
# Riveting
- type: entity

Binary file not shown.

Before

Width:  |  Height:  |  Size: 784 B

View File

@@ -1,47 +0,0 @@
{
"version": 1,
"size": {
"x": 32,
"y": 32
},
"license": "CC-BY-SA-3.0",
"copyright": "https://github.com/vgstation-coders/vgstation13/raw/99cc2ab62d65a3a7b554dc7b21ff5f57c835f973/icons/turf/walls.dmi",
"states": [
{
"name": "full",
"directions": 1
},
{
"name": "reinforced0",
"directions": 4
},
{
"name": "reinforced1",
"directions": 4
},
{
"name": "reinforced2",
"directions": 4
},
{
"name": "reinforced3",
"directions": 4
},
{
"name": "reinforced4",
"directions": 4
},
{
"name": "reinforced5",
"directions": 4
},
{
"name": "reinforced6",
"directions": 4
},
{
"name": "reinforced7",
"directions": 4
}
]
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 919 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 919 B

View File

@@ -1,65 +1 @@
{
"version": 1,
"license": "CC-BY-SA-3.0",
"copyright": "Taken from https://github.com/discordia-space/CEV-Eris/blob/c34c1b30abf18aa552e19294523924c39e5ea127/icons/turf/wall_masks.dmi and modified.",
"size": {
"x": 32,
"y": 32
},
"states": [
{
"name": "full",
"select": [],
"flags": {},
"directions": 1
},
{
"name": "solid0",
"select": [],
"flags": {},
"directions": 4
},
{
"name": "solid1",
"select": [],
"flags": {},
"directions": 4
},
{
"name": "solid2",
"select": [],
"flags": {},
"directions": 4
},
{
"name": "solid3",
"select": [],
"flags": {},
"directions": 4
},
{
"name": "solid4",
"select": [],
"flags": {},
"directions": 4
},
{
"name": "solid5",
"select": [],
"flags": {},
"directions": 4
},
{
"name": "solid6",
"select": [],
"flags": {},
"directions": 4
},
{
"name": "solid7",
"select": [],
"flags": {},
"directions": 4
}
]
}
{"version": 1, "license": "CC-BY-SA-3.0", "copyright": "Taken from https://github.com/discordia-space/CEV-Eris/blob/c34c1b30abf18aa552e19294523924c39e5ea127/icons/turf/wall_masks.dmi and modified.", "size": {"x": 32, "y": 32}, "states": [{"name": "full", "select": [], "flags": {}, "directions": 1}, {"name": "solid0", "select": [], "flags": {}, "directions": 4}, {"name": "solid1", "select": [], "flags": {}, "directions": 4}, {"name": "solid2", "select": [], "flags": {}, "directions": 4}, {"name": "solid3", "select": [], "flags": {}, "directions": 4}, {"name": "solid4", "select": [], "flags": {}, "directions": 4}, {"name": "solid5", "select": [], "flags": {}, "directions": 4}, {"name": "solid6", "select": [], "flags": {}, "directions": 4}, {"name": "solid7", "select": [], "flags": {}, "directions": 4}, {"name": "reinf_construct-0", "directions": 1, "delays": [[1.0]]}, {"name": "reinf_construct-1", "directions": 1, "delays": [[1.0]]}, {"name": "reinf_construct-2", "directions": 1, "delays": [[1.0]]}, {"name": "reinf_construct-3", "directions": 1, "delays": [[1.0]]}, {"name": "reinf_construct-4", "directions": 1, "delays": [[1.0]]}, {"name": "reinf_construct-5", "directions": 1, "delays": [[1.0]]}, {"name": "reinf_cult", "directions": 1, "delays": [[1.0]]}, {"name": "reinf_metal", "directions": 1, "delays": [[1.0]]}, {"name": "reinf_over", "directions": 1, "delays": [[1.0]]}, {"name": "reinf_over0", "directions": 4, "delays": [[1.0], [1.0], [1.0], [1.0]]}, {"name": "reinf_over1", "directions": 4, "delays": [[1.0], [1.0], [1.0], [1.0]]}, {"name": "reinf_over2", "directions": 4, "delays": [[1.0], [1.0], [1.0], [1.0]]}, {"name": "reinf_over3", "directions": 4, "delays": [[1.0], [1.0], [1.0], [1.0]]}, {"name": "reinf_over4", "directions": 4, "delays": [[1.0], [1.0], [1.0], [1.0]]}, {"name": "reinf_over5", "directions": 4, "delays": [[1.0], [1.0], [1.0], [1.0]]}, {"name": "reinf_over6", "directions": 4, "delays": [[1.0], [1.0], [1.0], [1.0]]}, {"name": "reinf_over7", "directions": 4, "delays": [[1.0], [1.0], [1.0], [1.0]]}, {"name": "rgeneric", "directions": 1, "delays": [[1.0]]}]}

Binary file not shown.

After

Width:  |  Height:  |  Size: 243 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 231 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 215 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 195 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 182 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 239 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 153 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 217 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 339 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 287 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 339 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 287 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 282 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 447 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 282 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 551 B