diff --git a/Content.Client/Content.Client.csproj b/Content.Client/Content.Client.csproj index f28bb9c85e..e84816fe8c 100644 --- a/Content.Client/Content.Client.csproj +++ b/Content.Client/Content.Client.csproj @@ -115,5 +115,6 @@ + \ No newline at end of file diff --git a/Content.Client/EntryPoint.cs b/Content.Client/EntryPoint.cs index 4b382d8f82..9e8ad7ff81 100644 --- a/Content.Client/EntryPoint.cs +++ b/Content.Client/EntryPoint.cs @@ -1,6 +1,7 @@ using Content.Client.GameObjects; using Content.Client.GameObjects.Components.Construction; using Content.Client.GameObjects.Components.Power; +using Content.Client.GameObjects.Components.SmoothWalling; using Content.Client.GameObjects.Components.Storage; using Content.Client.Interfaces.GameObjects; using SS14.Shared.ContentPack; @@ -53,6 +54,7 @@ namespace Content.Client factory.Register(); factory.Register(); factory.Register(); + factory.Register(); prototypes.RegisterIgnore("material"); } diff --git a/Content.Client/GameObjects/Components/IconSmoothing/IconSmoothComponent.cs b/Content.Client/GameObjects/Components/IconSmoothing/IconSmoothComponent.cs new file mode 100644 index 0000000000..5e6bf5ef34 --- /dev/null +++ b/Content.Client/GameObjects/Components/IconSmoothing/IconSmoothComponent.cs @@ -0,0 +1,236 @@ +using System; +using SS14.Client.Interfaces.GameObjects.Components; +using SS14.Shared.GameObjects; +using SS14.Shared.GameObjects.Components.Transform; +using SS14.Shared.Interfaces.GameObjects; +using SS14.Shared.Interfaces.Map; +using SS14.Shared.IoC; +using SS14.Shared.Map; +using SS14.Shared.Maths; +using SS14.Shared.Serialization; +using static SS14.Client.GameObjects.SpriteComponent; + +namespace Content.Client.GameObjects.Components.SmoothWalling +{ + // TODO: Potential improvements: + // Defer updating of these. + // Get told by somebody to use a loop. + /// + /// Makes sprites of other grid-aligned entities like us connect. + /// + /// + /// The system is based on Baystation12's smoothwalling, and thus will work with those. + /// To use, set base equal to the prefix of the corner states in the sprite base RSI. + /// Any objects with the same key will connect. + /// + public class IconSmoothComponent : Component, IComponentDebug + { + public override string Name => "IconSmooth"; + + ISpriteComponent Sprite; + SnapGridComponent SnapGrid; + + /// + /// Prepended to the RSI state. + /// + string StateBase; + + /// + /// We will smooth with other objects with the same key. + /// + string SmoothKey; + + IconSmoothComponent[] Neighbors = new IconSmoothComponent[8]; + // "Use an array". + // Nah. I'm too lazy. This is easy to understand compared to the enum value fuckery if I used an array. + // Deal with it. + CornerFill CornerSE; + CornerFill CornerNE; + CornerFill CornerNW; + CornerFill CornerSW; + + public override void Initialize() + { + base.Initialize(); + + var state0 = $"{StateBase}0"; + SnapGrid = Owner.GetComponent(); + Sprite = Owner.GetComponent(); + // BIG NOTE: Y axis is fucked. Double fucked. Triple super-mega-ultra-turbo-fucked. + // so, the DirectionOffsets here are incorrect (flipped). + Sprite.LayerMapSet(CornerLayers.SE, Sprite.AddLayerState(state0)); + Sprite.LayerSetDirOffset(CornerLayers.SE, DirectionOffset.Flip); + Sprite.LayerMapSet(CornerLayers.NE, Sprite.AddLayerState(state0)); + Sprite.LayerSetDirOffset(CornerLayers.NE, DirectionOffset.Clockwise); + Sprite.LayerMapSet(CornerLayers.NW, Sprite.AddLayerState(state0)); + Sprite.LayerSetDirOffset(CornerLayers.NW, DirectionOffset.None); + Sprite.LayerMapSet(CornerLayers.SW, Sprite.AddLayerState(state0)); + Sprite.LayerSetDirOffset(CornerLayers.SW, DirectionOffset.CounterClockwise); + } + + public override void ExposeData(ObjectSerializer serializer) + { + base.ExposeData(serializer); + serializer.DataFieldCached(ref StateBase, "base", ""); + serializer.DataFieldCached(ref SmoothKey, "key", null); + } + + public override void Startup() + { + base.Startup(); + + SnapGrid.OnPositionChanged += SnapGridPositionChanged; + + UpdateConnections(true); + UpdateIcon(); + } + + public override void Shutdown() + { + base.Shutdown(); + + SnapGrid.OnPositionChanged -= SnapGridPositionChanged; + SayGoodbyes(); + } + + void SayGoodbyes() + { + foreach (var neighbor in Neighbors) + { + // Goodbye neighbor. + neighbor?.UpdateConnections(false); + neighbor?.UpdateIcon(); + } + } + + void SnapGridPositionChanged() + { + SayGoodbyes(); + UpdateConnections(true); + UpdateIcon(); + } + + void UpdateIcon() + { + // Try to turn this into a loop without hard to understand bit fuckery or 20 lines of helper functions. + // Challenge: do it in less lines. + // I dare you. + // No cheating like putting everything on a single line. Proper code conventions. + // This comment does not count, btw. + + 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}"); + } + + void UpdateConnections(bool propagate) + { + for (int i = 0; i < Neighbors.Length; i++) + { + var found = false; + var dir = (Direction)i; + foreach (var entity in SnapGrid.GetInDir(dir)) + { + if (entity.TryGetComponent(out IconSmoothComponent smooth) && smooth.SmoothKey == SmoothKey) + { + Neighbors[i] = smooth; + if (propagate) + { + smooth.UpdateConnections(false); + smooth.UpdateIcon(); + } + // Temptation to use goto: 10. + found = true; + break; + } + } + + if (!found) + { + Neighbors[i] = null; + } + } + + CornerNE = CornerSE = CornerNW = CornerSW = CornerFill.None; + + // "Use a loop". + // Well screw that I did the exact same thing while writing lighting corner population code in BYOND. + // This is 10x easier to understand and write than a complex loop working with the internet mapping of direction flags. + if (Neighbors[(int)Direction.North] != null) + { + CornerNE |= CornerFill.CounterClockwise; + CornerNW |= CornerFill.Clockwise; + } + if (Neighbors[(int)Direction.NorthEast] != null) + { + CornerNE |= CornerFill.Diagonal; + } + if (Neighbors[(int)Direction.East] != null) + { + CornerNE |= CornerFill.Clockwise; + CornerSE |= CornerFill.CounterClockwise; + } + if (Neighbors[(int)Direction.SouthEast] != null) + { + CornerSE |= CornerFill.Diagonal; + } + if (Neighbors[(int)Direction.South] != null) + { + CornerSE |= CornerFill.Clockwise; + CornerSW |= CornerFill.CounterClockwise; + } + if (Neighbors[(int)Direction.SouthWest] != null) + { + CornerSW |= CornerFill.Diagonal; + } + if (Neighbors[(int)Direction.West] != null) + { + CornerSW |= CornerFill.Clockwise; + CornerNW |= CornerFill.CounterClockwise; + } + if (Neighbors[(int)Direction.NorthWest] != null) + { + CornerNW |= CornerFill.Diagonal; + } + } + + public string GetDebugString() + { + return string.Format( + "N/NE/E/SE/S/SW/W/NW: {0}/{1}/{2}/{3}/{4}/{5}/{6}/{7} cfill NE/SE/SW/NW: {8}/{9}/{10}/{11}", + Neighbors[(int)Direction.North]?.Owner?.Uid, + Neighbors[(int)Direction.NorthEast]?.Owner?.Uid, + Neighbors[(int)Direction.East]?.Owner?.Uid, + Neighbors[(int)Direction.SouthEast]?.Owner?.Uid, + Neighbors[(int)Direction.South]?.Owner?.Uid, + Neighbors[(int)Direction.SouthWest]?.Owner?.Uid, + Neighbors[(int)Direction.West]?.Owner?.Uid, + Neighbors[(int)Direction.NorthWest]?.Owner?.Uid, + CornerNE, CornerSE, CornerSW, CornerNW + ); + } + + enum CornerLayers + { + SE, + NE, + NW, + SW, + } + + [Flags] + enum CornerFill : sbyte + { + // These values are pulled from Baystation12. + // I'm too lazy to convert the state names. + None = 0, + // The cardinal tile counter-clockwise of this corner is filled. + CounterClockwise = 1, + // The diagonal tile in the direction of this corner. + Diagonal = 2, + // The cardinal tile clockwise of this corner is filled. + Clockwise = 4, + } + } +} diff --git a/Resources/Maps/stationstation.yml b/Resources/Maps/stationstation.yml index f2ad6bac8d..3a0e1273ff 100644 --- a/Resources/Maps/stationstation.yml +++ b/Resources/Maps/stationstation.yml @@ -22,735 +22,735 @@ entities: components: - grid: 0 pos: 4.5,3.5 - rot: 3.141593 + rot: -1.570796 type: Transform - type: Wire components: - grid: 0 pos: 4.5,0.5 - rot: 3.141593 + rot: -1.570796 type: Transform -- type: __engine_wall +- type: wall components: - grid: 0 pos: -7,-6 - rot: 3.141593 + rot: -1.570796 type: Transform -- type: __engine_wall +- type: wall components: - grid: 0 pos: -7,4 - rot: 3.141593 + rot: -1.570796 type: Transform -- type: __engine_wall +- type: wall components: - grid: 0 pos: -7,3 - rot: 3.141593 + rot: -1.570796 type: Transform -- type: __engine_wall +- type: wall components: - grid: 0 pos: -7,2 - rot: 3.141593 + rot: -1.570796 type: Transform -- type: __engine_wall +- type: wall components: - grid: 0 pos: -7,1 - rot: 3.141593 + rot: -1.570796 type: Transform -- type: __engine_wall +- type: wall components: - grid: 0 pos: -7,0 - rot: 3.141593 + rot: -1.570796 type: Transform -- type: __engine_wall +- type: wall components: - grid: 0 pos: -7,-1 - rot: 3.141593 + rot: -1.570796 type: Transform -- type: __engine_wall +- type: wall components: - grid: 0 pos: 6,7 - rot: 3.141593 + rot: -1.570796 type: Transform -- type: __engine_wall +- type: wall components: - grid: 0 pos: 6,8 - rot: 3.141593 + rot: -1.570796 type: Transform -- type: __engine_wall +- type: wall components: - grid: 0 pos: 6,9 - rot: 3.141593 + rot: -1.570796 type: Transform -- type: __engine_wall +- type: wall components: - grid: 0 pos: -7,-5 - rot: 3.141593 + rot: -1.570796 type: Transform -- type: __engine_wall +- type: wall components: - grid: 0 pos: 6,-6 - rot: 3.141593 + rot: -1.570796 type: Transform -- type: __engine_wall +- type: wall components: - grid: 0 pos: 6,-5 - rot: 3.141593 + rot: -1.570796 type: Transform -- type: __engine_wall +- type: wall components: - grid: 0 pos: 6,6 - rot: 3.141593 + rot: -1.570796 type: Transform -- type: __engine_wall +- type: wall components: - grid: 0 pos: 6,5 - rot: 3.141593 + rot: -1.570796 type: Transform -- type: __engine_wall +- type: wall components: - grid: 0 pos: -7,9 - rot: 3.141593 + rot: -1.570796 type: Transform -- type: __engine_wall +- type: wall components: - grid: 0 pos: 6,-1 - rot: 3.141593 + rot: -1.570796 type: Transform -- type: __engine_wall +- type: wall components: - grid: 0 pos: 6,0 - rot: 3.141593 + rot: -1.570796 type: Transform -- type: __engine_wall +- type: wall components: - grid: 0 pos: 6,1 - rot: 3.141593 + rot: -1.570796 type: Transform -- type: __engine_wall +- type: wall components: - grid: 0 pos: 6,2 - rot: 3.141593 + rot: -1.570796 type: Transform -- type: __engine_wall +- type: wall components: - grid: 0 pos: 6,3 - rot: 3.141593 + rot: -1.570796 type: Transform -- type: __engine_wall +- type: wall components: - grid: 0 pos: 6,4 - rot: 3.141593 + rot: -1.570796 type: Transform - type: DoorContent components: - grid: 0 pos: -5.5,4.5 - rot: 3.141593 + rot: -1.570796 type: Transform -- type: __engine_wall +- type: wall components: - grid: 0 pos: -7,5 - rot: 3.141593 + rot: -1.570796 type: Transform -- type: __engine_wall +- type: wall components: - grid: 0 pos: -7,6 - rot: 3.141593 + rot: -1.570796 type: Transform -- type: __engine_wall +- type: wall components: - grid: 0 pos: -4,6 - rot: 3.141593 + rot: -1.570796 type: Transform -- type: __engine_wall +- type: wall components: - grid: 0 pos: -4,5 - rot: 3.141593 + rot: -1.570796 type: Transform -- type: __engine_wall +- type: wall components: - grid: 0 pos: -4,4 - rot: 3.141593 + rot: -1.570796 type: Transform -- type: __engine_wall +- type: wall components: - grid: 0 pos: -3,6 - rot: 3.141593 + rot: -1.570796 type: Transform -- type: __engine_wall +- type: wall components: - grid: 0 pos: -2,6 - rot: 3.141593 + rot: -1.570796 type: Transform -- type: __engine_wall +- type: wall components: - grid: 0 pos: -1,6 - rot: 3.141593 + rot: -1.570796 type: Transform -- type: __engine_wall +- type: wall components: - grid: 0 pos: 0,6 - rot: 3.141593 + rot: -1.570796 type: Transform - type: Wire components: - grid: 0 pos: 4.5,-0.5 - rot: 3.141593 + rot: -1.570796 type: Transform - type: __engine_worktop components: - grid: 0 pos: -2.5,4.5 - rot: 3.141593 + rot: -1.570796 type: Transform - type: DoorContent components: - grid: 0 pos: 4.5,4.5 - rot: 3.141593 + rot: -1.570796 type: Transform -- type: __engine_wall +- type: wall components: - grid: 0 pos: 1,6 - rot: 3.141593 + rot: -1.570796 type: Transform -- type: __engine_wall +- type: wall components: - grid: 0 pos: 2,6 - rot: 3.141593 + rot: -1.570796 type: Transform -- type: __engine_wall +- type: wall components: - grid: 0 pos: 3,6 - rot: 3.141593 + rot: -1.570796 type: Transform -- type: __engine_wall +- type: wall components: - grid: 0 pos: 3,5 - rot: 3.141593 + rot: -1.570796 type: Transform -- type: __engine_wall +- type: wall components: - grid: 0 pos: 3,4 - rot: 3.141593 + rot: -1.570796 type: Transform - type: __engine_worktop components: - grid: 0 pos: -0.5,4.5 - rot: 3.141593 + rot: -1.570796 type: Transform - type: __engine_worktop components: - grid: 0 pos: 1.5,4.5 - rot: 3.141593 + rot: -1.570796 type: Transform - type: LaserItem components: - grid: 0 pos: -3.015625,3.890625 - rot: 3.141593 + rot: -1.570796 type: Transform - type: LaserItem components: - grid: 0 pos: -2.015625,3.859375 - rot: 3.141593 + rot: -1.570796 type: Transform - type: GUNITEM components: - grid: 0 pos: -2.890625,4.484375 - rot: 3.141593 + rot: -1.570796 type: Transform - type: GUNITEM components: - grid: 0 pos: -1.984375,4.484375 - rot: 3.141593 + rot: -1.570796 type: Transform - type: medkit_r components: - grid: 0 pos: -0.859375,3.921875 - rot: 3.141593 + rot: -1.570796 type: Transform - type: medkit_r components: - grid: 0 pos: -0.921875,4.640625 - rot: 3.141593 + rot: -1.570796 type: Transform - type: MopItem components: - grid: 0 pos: 0.015625,3.921875 - rot: 3.141593 + rot: -1.570796 type: Transform - type: FlashlightLantern components: - grid: 0 pos: 0.046875,4.609375 - rot: 3.141593 + rot: -1.570796 type: Transform - type: IDCardStandard components: - grid: 0 pos: 0.890625,3.921875 - rot: 3.141593 + rot: -1.570796 type: Transform - type: RadioHeadsetEars components: - grid: 0 pos: 0.984375,4.640625 - rot: 3.141593 + rot: -1.570796 type: Transform - type: BackpackClothing components: - grid: 0 pos: 1.890625,3.796875 - rot: 3.141593 + rot: -1.570796 type: Transform - type: JanitorUniform components: - grid: 0 pos: 2.109375,4.546875 - rot: 3.141593 + rot: -1.570796 type: Transform - type: ShoesItem components: - grid: 0 pos: 1.546875,4.484375 - rot: 3.141593 + rot: -1.570796 type: Transform - type: __engine_worktop components: - grid: 0 pos: 1.5,7.5 - rot: 3.141593 + rot: -1.570796 type: Transform - type: Wire components: - grid: 0 pos: 4.5,5.5 - rot: 3.141593 + rot: -1.570796 type: Transform - type: Wire components: - grid: 0 pos: 4.5,4.5 - rot: 3.141593 + rot: -1.570796 type: Transform -- type: __engine_wall +- type: wall components: - grid: 0 pos: -7,7 - rot: 3.141593 + rot: -1.570796 type: Transform -- type: __engine_wall +- type: wall components: - grid: 0 pos: -7,8 - rot: 3.141593 + rot: -1.570796 type: Transform - type: Wire components: - grid: 0 pos: 4.5,2.5 - rot: 3.141593 + rot: -1.570796 type: Transform - type: Wire components: - grid: 0 pos: 4.5,1.5 - rot: 3.141593 + rot: -1.570796 type: Transform - type: Wire components: - grid: 0 pos: 4.5,7.5 - rot: 3.141593 + rot: -1.570796 type: Transform - type: Wire components: - grid: 0 pos: 4.5,6.5 - rot: 3.141593 + rot: -1.570796 type: Transform - type: WirelessMachine components: - grid: 0 pos: 3,3 - rot: 3.141593 + rot: -1.570796 type: Transform -- type: __engine_wall +- type: wall components: - grid: 0 pos: -7,-7 - rot: 3.141593 + rot: -1.570796 type: Transform -- type: __engine_wall +- type: wall components: - grid: 0 pos: -7,-8 - rot: 3.141593 + rot: -1.570796 type: Transform -- type: __engine_wall +- type: wall components: - grid: 0 pos: -6,-8 - rot: 3.141593 + rot: -1.570796 type: Transform -- type: __engine_wall +- type: wall components: - grid: 0 pos: -5,-8 - rot: 3.141593 + rot: -1.570796 type: Transform -- type: __engine_wall +- type: wall components: - grid: 0 pos: -4,-8 - rot: 3.141593 + rot: -1.570796 type: Transform -- type: __engine_wall +- type: wall components: - grid: 0 pos: -3,-8 - rot: 3.141593 + rot: -1.570796 type: Transform -- type: __engine_wall +- type: wall components: - grid: 0 pos: -2,-8 - rot: 3.141593 + rot: -1.570796 type: Transform -- type: __engine_wall +- type: wall components: - grid: 0 pos: -1,-8 - rot: 3.141593 + rot: -1.570796 type: Transform -- type: __engine_wall +- type: wall components: - grid: 0 pos: 0,-8 - rot: 3.141593 + rot: -1.570796 type: Transform -- type: __engine_wall +- type: wall components: - grid: 0 pos: 1,-8 - rot: 3.141593 + rot: -1.570796 type: Transform -- type: __engine_wall +- type: wall components: - grid: 0 pos: 2,-8 - rot: 3.141593 + rot: -1.570796 type: Transform -- type: __engine_wall +- type: wall components: - grid: 0 pos: 3,-8 - rot: 3.141593 + rot: -1.570796 type: Transform -- type: __engine_wall +- type: wall components: - grid: 0 pos: 4,-8 - rot: 3.141593 + rot: -1.570796 type: Transform -- type: __engine_wall +- type: wall components: - grid: 0 pos: 5,-8 - rot: 3.141593 + rot: -1.570796 type: Transform -- type: __engine_wall +- type: wall components: - grid: 0 pos: 6,-8 - rot: 3.141593 + rot: -1.570796 type: Transform -- type: __engine_wall +- type: wall components: - grid: 0 pos: 6,-7 - rot: 3.141593 + rot: -1.570796 type: Transform - type: __engine_worktop components: - grid: 0 pos: -2.5,7.5 - rot: 3.141593 + rot: -1.570796 type: Transform - type: __engine_worktop components: - grid: 0 pos: -0.5,7.5 - rot: 3.141593 + rot: -1.570796 type: Transform - type: Wire components: - grid: 0 pos: 4.5,8.5 - rot: 3.141593 + rot: -1.570796 type: Transform - type: YellowGloves components: - grid: 0 pos: -3.015625,6.796875 - rot: 3.141593 + rot: -1.570796 type: Transform - type: MesonGlasses components: - grid: 0 pos: -3.046875,7.484375 - rot: 3.141593 + rot: -1.570796 type: Transform - type: UtilityBeltClothing components: - grid: 0 pos: -2.109375,6.765625 - rot: 3.141593 + rot: -1.570796 type: Transform - type: GasMaskClothing components: - grid: 0 pos: -2.234375,7.390625 - rot: 3.141593 + rot: -1.570796 type: Transform - type: BlueToolboxItem components: - grid: 0 pos: -1.109375,6.796875 - rot: 3.141593 + rot: -1.570796 type: Transform - type: YellowToolboxItem components: - grid: 0 pos: -1.078125,7.578125 - rot: 3.141593 + rot: -1.570796 type: Transform - type: Wirecutter components: - grid: 0 pos: -0.234375,6.640625 - rot: 3.141593 + rot: -1.570796 type: Transform - type: Welder components: - grid: 0 pos: -0.234375,7.515625 - rot: 3.141593 + rot: -1.570796 type: Transform - type: Screwdriver components: - grid: 0 pos: 0.703125,6.609375 - rot: 3.141593 + rot: -1.570796 type: Transform - type: Crowbar components: - grid: 0 pos: 0.578125,7.484375 - rot: 3.141593 + rot: -1.570796 type: Transform - type: Multitool components: - grid: 0 pos: 1.515625,6.921875 - rot: 3.141593 + rot: -1.570796 type: Transform - type: Wrench components: - grid: 0 pos: 1.421875,7.484375 - rot: 3.141593 + rot: -1.570796 type: Transform -- type: __engine_wall +- type: wall components: - grid: 0 pos: -7,10 - rot: 3.141593 + rot: -1.570796 type: Transform -- type: __engine_wall +- type: wall components: - grid: 0 pos: -7,11 - rot: 3.141593 + rot: -1.570796 type: Transform -- type: __engine_wall +- type: wall components: - grid: 0 pos: -7,12 - rot: 3.141593 + rot: -1.570796 type: Transform -- type: __engine_wall +- type: wall components: - grid: 0 pos: -7,13 - rot: 3.141593 + rot: -1.570796 type: Transform -- type: __engine_wall +- type: wall components: - grid: 0 pos: 6,10 - rot: 3.141593 + rot: -1.570796 type: Transform -- type: __engine_wall +- type: wall components: - grid: 0 pos: 6,11 - rot: 3.141593 + rot: -1.570796 type: Transform -- type: __engine_wall +- type: wall components: - grid: 0 pos: 6,12 - rot: 3.141593 + rot: -1.570796 type: Transform -- type: __engine_wall +- type: wall components: - grid: 0 pos: 6,13 - rot: 3.141593 + rot: -1.570796 type: Transform -- type: __engine_wall +- type: wall components: - grid: 0 pos: -7,14 - rot: 3.141593 + rot: -1.570796 type: Transform -- type: __engine_wall +- type: wall components: - grid: 0 pos: -6,14 - rot: 3.141593 + rot: -1.570796 type: Transform -- type: __engine_wall +- type: wall components: - grid: 0 pos: -5,14 - rot: 3.141593 + rot: -1.570796 type: Transform -- type: __engine_wall +- type: wall components: - grid: 0 pos: -4,14 - rot: 3.141593 + rot: -1.570796 type: Transform -- type: __engine_wall +- type: wall components: - grid: 0 pos: -3,14 - rot: 3.141593 + rot: -1.570796 type: Transform -- type: __engine_wall +- type: wall components: - grid: 0 pos: -2,14 - rot: 3.141593 + rot: -1.570796 type: Transform -- type: __engine_wall +- type: wall components: - grid: 0 pos: -1,14 - rot: 3.141593 + rot: -1.570796 type: Transform -- type: __engine_wall +- type: wall components: - grid: 0 pos: 0,14 - rot: 3.141593 + rot: -1.570796 type: Transform -- type: __engine_wall +- type: wall components: - grid: 0 pos: 1,14 - rot: 3.141593 + rot: -1.570796 type: Transform -- type: __engine_wall +- type: wall components: - grid: 0 pos: 2,14 - rot: 3.141593 + rot: -1.570796 type: Transform -- type: __engine_wall +- type: wall components: - grid: 0 pos: 3,14 - rot: 3.141593 + rot: -1.570796 type: Transform -- type: __engine_wall +- type: wall components: - grid: 0 pos: 4,14 - rot: 3.141593 + rot: -1.570796 type: Transform -- type: __engine_wall +- type: wall components: - grid: 0 pos: 5,14 - rot: 3.141593 + rot: -1.570796 type: Transform -- type: __engine_wall +- type: wall components: - grid: 0 pos: 6,14 - rot: 3.141593 + rot: -1.570796 type: Transform - type: SMES name: Smes components: - grid: 0 pos: -2.5,12.5 - rot: 3.141593 + rot: -1.570796 type: Transform - type: SMES name: Smes components: - grid: 0 pos: 1.5,12.5 - rot: 3.141593 + rot: -1.570796 type: Transform - charge: 438.3279 type: PowerStorage @@ -758,169 +758,169 @@ entities: components: - grid: 0 pos: -2.5,12.5 - rot: 3.141593 + rot: -1.570796 type: Transform - type: BlueWire components: - grid: 0 pos: -1.5,12.5 - rot: 3.141593 + rot: -1.570796 type: Transform - type: BlueWire components: - grid: 0 pos: -0.5,12.5 - rot: 3.141593 + rot: -1.570796 type: Transform - type: BlueWire components: - grid: 0 pos: 0.5,12.5 - rot: 3.141593 + rot: -1.570796 type: Transform - type: BlueWire components: - grid: 0 pos: 1.5,12.5 - rot: 3.141593 + rot: -1.570796 type: Transform - type: Generator components: - grid: 0 pos: -0.5,12.5 - rot: 3.141593 + rot: -1.570796 type: Transform - type: Wire components: - grid: 0 pos: -3.5,12.5 - rot: 3.141593 + rot: -1.570796 type: Transform - type: Wire components: - grid: 0 pos: -4.5,12.5 - rot: 3.141593 + rot: -1.570796 type: Transform - type: Wire components: - grid: 0 pos: -5.5,12.5 - rot: 3.141593 + rot: -1.570796 type: Transform - type: Wire components: - grid: 0 pos: -5.5,11.5 - rot: 3.141593 + rot: -1.570796 type: Transform - type: Wire components: - grid: 0 pos: -5.5,10.5 - rot: 3.141593 + rot: -1.570796 type: Transform - type: Wire components: - grid: 0 pos: -5.5,9.5 - rot: 3.141593 + rot: -1.570796 type: Transform - type: Wire components: - grid: 0 pos: -5.5,8.5 - rot: 3.141593 + rot: -1.570796 type: Transform - type: Wire components: - grid: 0 pos: -5.5,7.5 - rot: 3.141593 + rot: -1.570796 type: Transform - type: Wire components: - grid: 0 pos: -5.5,6.5 - rot: 3.141593 + rot: -1.570796 type: Transform - type: Wire components: - grid: 0 pos: -5.5,5.5 - rot: 3.141593 + rot: -1.570796 type: Transform - type: Wire components: - grid: 0 pos: -5.5,4.5 - rot: 3.141593 + rot: -1.570796 type: Transform - type: Wire components: - grid: 0 pos: -5.5,3.5 - rot: 3.141593 + rot: -1.570796 type: Transform - type: Wire components: - grid: 0 pos: -5.5,2.5 - rot: 3.141593 + rot: -1.570796 type: Transform - type: Wire components: - grid: 0 pos: -5.5,1.5 - rot: 3.141593 + rot: -1.570796 type: Transform - type: Wire components: - grid: 0 pos: -5.5,0.5 - rot: 3.141593 + rot: -1.570796 type: Transform - type: Wire components: - grid: 0 pos: -5.5,-0.5 - rot: 3.141593 + rot: -1.570796 type: Transform - type: Wire components: - grid: 0 pos: 2.5,12.5 - rot: 3.141593 + rot: -1.570796 type: Transform - type: Wire components: - grid: 0 pos: 3.5,12.5 - rot: 3.141593 + rot: -1.570796 type: Transform - type: Wire components: - grid: 0 pos: 4.5,12.5 - rot: 3.141593 + rot: -1.570796 type: Transform - type: Wire components: - grid: 0 pos: 4.5,11.5 - rot: 3.141593 + rot: -1.570796 type: Transform - type: Wire components: - grid: 0 pos: 4.5,10.5 - rot: 3.141593 + rot: -1.570796 type: Transform - type: Wire components: - grid: 0 pos: 4.5,9.5 - rot: 3.141593 + rot: -1.570796 type: Transform - type: poweredlight components: @@ -979,13 +979,13 @@ entities: components: - grid: 0 pos: 5,2 - rot: 3.141593 + rot: -1.570796 type: Transform - type: poweredlight components: - grid: 0 pos: 2,4 - rot: 3.141593 + rot: -1.570796 type: Transform - type: poweredlight components: @@ -1045,61 +1045,61 @@ entities: components: - grid: 0 pos: 5,-6 - rot: 3.141593 + rot: -1.570796 type: Transform - type: Wire components: - grid: 0 pos: -5.5,-1.5 - rot: 3.141593 + rot: -1.570796 type: Transform - type: Wire components: - grid: 0 pos: -5.5,-5.5 - rot: 3.141593 + rot: -1.570796 type: Transform - type: Wire components: - grid: 0 pos: -5.5,-4.5 - rot: 3.141593 + rot: -1.570796 type: Transform - type: Wire components: - grid: 0 pos: -5.5,-3.5 - rot: 3.141593 + rot: -1.570796 type: Transform - type: Wire components: - grid: 0 pos: -5.5,-2.5 - rot: 3.141593 + rot: -1.570796 type: Transform - type: Wire components: - grid: 0 pos: 4.5,-5.5 - rot: 3.141593 + rot: -1.570796 type: Transform - type: Wire components: - grid: 0 pos: 4.5,-3.5 - rot: 3.141593 + rot: -1.570796 type: Transform - type: Wire components: - grid: 0 pos: 4.5,-4.5 - rot: 3.141593 + rot: -1.570796 type: Transform - type: APC components: - grid: 0 pos: -6,-6 - rot: 3.141593 + rot: -1.570796 type: Transform - load: 150 type: PowerProvider @@ -1107,7 +1107,7 @@ entities: components: - grid: 0 pos: 5,-6 - rot: 3.141593 + rot: -1.570796 type: Transform - load: 150 type: PowerProvider @@ -1115,24 +1115,24 @@ entities: components: - grid: 0 pos: 4.5,-1.5 - rot: 3.141593 + rot: -1.570796 type: Transform - type: Wire components: - grid: 0 pos: 4.5,-2.5 - rot: 3.141593 + rot: -1.570796 type: Transform - type: WiredMachine components: - grid: 0 pos: -5.5,12.5 - rot: 3.141593 + rot: -1.570796 type: Transform - type: WiredMachine components: - grid: 0 pos: 4.5,12.5 - rot: 3.141593 + rot: -1.570796 type: Transform ... diff --git a/Resources/Prototypes/Entities/walls.yml b/Resources/Prototypes/Entities/walls.yml new file mode 100644 index 0000000000..a03248a390 --- /dev/null +++ b/Resources/Prototypes/Entities/walls.yml @@ -0,0 +1,29 @@ +- type: entity + id: wall + name: Wall + components: + - type: Clickable + - type: Sprite + netsync: false + color: "#636769" + drawdepth: Walls + sprite: Buildings/wall.rsi + + - type: Icon + texture: Tiles/wall_texture.png + + - type: BoundingBox + - type: Collidable + - type: Occluder + sizeX: 32 + sizeY: 32 + - type: SnapGrid + offset: Edge + + - type: IconSmooth + key: walls. Seriously, just a wall. Nothing extraordinary here. + base: solid + + placement: + snap: + - Wall diff --git a/Resources/Textures/Buildings/wall.rsi/meta.json b/Resources/Textures/Buildings/wall.rsi/meta.json new file mode 100644 index 0000000000..c6a0575630 --- /dev/null +++ b/Resources/Textures/Buildings/wall.rsi/meta.json @@ -0,0 +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":"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}]} \ No newline at end of file diff --git a/Resources/Textures/Buildings/wall.rsi/solid0.png b/Resources/Textures/Buildings/wall.rsi/solid0.png new file mode 100644 index 0000000000..3a809c3b5f Binary files /dev/null and b/Resources/Textures/Buildings/wall.rsi/solid0.png differ diff --git a/Resources/Textures/Buildings/wall.rsi/solid1.png b/Resources/Textures/Buildings/wall.rsi/solid1.png new file mode 100644 index 0000000000..b7dcaf9459 Binary files /dev/null and b/Resources/Textures/Buildings/wall.rsi/solid1.png differ diff --git a/Resources/Textures/Buildings/wall.rsi/solid2.png b/Resources/Textures/Buildings/wall.rsi/solid2.png new file mode 100644 index 0000000000..3a809c3b5f Binary files /dev/null and b/Resources/Textures/Buildings/wall.rsi/solid2.png differ diff --git a/Resources/Textures/Buildings/wall.rsi/solid3.png b/Resources/Textures/Buildings/wall.rsi/solid3.png new file mode 100644 index 0000000000..b7dcaf9459 Binary files /dev/null and b/Resources/Textures/Buildings/wall.rsi/solid3.png differ diff --git a/Resources/Textures/Buildings/wall.rsi/solid4.png b/Resources/Textures/Buildings/wall.rsi/solid4.png new file mode 100644 index 0000000000..940e571456 Binary files /dev/null and b/Resources/Textures/Buildings/wall.rsi/solid4.png differ diff --git a/Resources/Textures/Buildings/wall.rsi/solid5.png b/Resources/Textures/Buildings/wall.rsi/solid5.png new file mode 100644 index 0000000000..5c69be5b41 Binary files /dev/null and b/Resources/Textures/Buildings/wall.rsi/solid5.png differ diff --git a/Resources/Textures/Buildings/wall.rsi/solid6.png b/Resources/Textures/Buildings/wall.rsi/solid6.png new file mode 100644 index 0000000000..940e571456 Binary files /dev/null and b/Resources/Textures/Buildings/wall.rsi/solid6.png differ diff --git a/Resources/Textures/Buildings/wall.rsi/solid7.png b/Resources/Textures/Buildings/wall.rsi/solid7.png new file mode 100644 index 0000000000..5ee21983bc Binary files /dev/null and b/Resources/Textures/Buildings/wall.rsi/solid7.png differ diff --git a/engine b/engine index 21b00df2b1..be10df217e 160000 --- a/engine +++ b/engine @@ -1 +1 @@ -Subproject commit 21b00df2b1e8292045ae630b7adda964661dbe24 +Subproject commit be10df217e9114a28a47b49b4aedee11d107df79