diff --git a/Content.Client/EntryPoint.cs b/Content.Client/EntryPoint.cs index 0a04e76ce2..a9a4663f29 100644 --- a/Content.Client/EntryPoint.cs +++ b/Content.Client/EntryPoint.cs @@ -109,6 +109,8 @@ namespace Content.Client factory.Register(); factory.Register(); factory.Register(); + factory.Register(); + factory.RegisterReference(); factory.Register(); factory.Register(); factory.Register(); @@ -159,6 +161,8 @@ namespace Content.Client factory.Register(); factory.Register(); + factory.Register(); + IoCManager.Register(); IoCManager.Register(); IoCManager.Register(); diff --git a/Content.Client/GameObjects/Components/IconSmoothing/IconSmoothComponent.cs b/Content.Client/GameObjects/Components/IconSmoothing/IconSmoothComponent.cs index 6b510ff8bd..74352642b8 100644 --- a/Content.Client/GameObjects/Components/IconSmoothing/IconSmoothComponent.cs +++ b/Content.Client/GameObjects/Components/IconSmoothing/IconSmoothComponent.cs @@ -1,10 +1,14 @@ -using System.Diagnostics.CodeAnalysis; +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using Content.Client.GameObjects.EntitySystems; using JetBrains.Annotations; using Robust.Client.Interfaces.GameObjects.Components; using Robust.Shared.GameObjects; using Robust.Shared.GameObjects.Components.Transform; +using Robust.Shared.Interfaces.GameObjects; using Robust.Shared.Map; +using Robust.Shared.Maths; using Robust.Shared.Serialization; using static Robust.Client.GameObjects.SpriteComponent; @@ -21,7 +25,7 @@ namespace Content.Client.GameObjects.Components.IconSmoothing /// 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 sealed class IconSmoothComponent : Component + public class IconSmoothComponent : Component { private string _smoothKey; private string _stateBase; @@ -76,9 +80,9 @@ namespace Content.Client.GameObjects.Components.IconSmoothing SnapGrid.OnPositionChanged += SnapGridOnPositionChanged; Owner.EntityManager.RaiseEvent(Owner, new IconSmoothDirtyEvent(null, SnapGrid.Offset, Mode)); - var state0 = $"{StateBase}0"; if (Mode == IconSmoothingMode.Corners) { + var state0 = $"{StateBase}0"; Sprite.LayerMapSet(CornerLayers.SE, Sprite.AddLayerState(state0)); Sprite.LayerSetDirOffset(CornerLayers.SE, DirectionOffset.None); Sprite.LayerMapSet(CornerLayers.NE, Sprite.AddLayerState(state0)); @@ -90,6 +94,107 @@ namespace Content.Client.GameObjects.Components.IconSmoothing } } + internal virtual void CalculateNewSprite() + { + switch (Mode) + { + case IconSmoothingMode.Corners: + CalculateNewSpriteCorers(); + break; + + case IconSmoothingMode.CardinalFlags: + CalculateNewSpriteCardinal(); + break; + + default: + throw new ArgumentOutOfRangeException(); + } + } + + private void CalculateNewSpriteCardinal() + { + var dirs = CardinalConnectDirs.None; + + if (MatchingEntity(SnapGrid.GetInDir(Direction.North))) + dirs |= CardinalConnectDirs.North; + if (MatchingEntity(SnapGrid.GetInDir(Direction.South))) + dirs |= CardinalConnectDirs.South; + if (MatchingEntity(SnapGrid.GetInDir(Direction.East))) + dirs |= CardinalConnectDirs.East; + if (MatchingEntity(SnapGrid.GetInDir(Direction.West))) + dirs |= CardinalConnectDirs.West; + + Sprite.LayerSetState(0, $"{StateBase}{(int) dirs}"); + } + + private void CalculateNewSpriteCorers() + { + var n = MatchingEntity(SnapGrid.GetInDir(Direction.North)); + var ne = MatchingEntity(SnapGrid.GetInDir(Direction.NorthEast)); + var e = MatchingEntity(SnapGrid.GetInDir(Direction.East)); + var se = MatchingEntity(SnapGrid.GetInDir(Direction.SouthEast)); + var s = MatchingEntity(SnapGrid.GetInDir(Direction.South)); + var sw = MatchingEntity(SnapGrid.GetInDir(Direction.SouthWest)); + var w = MatchingEntity(SnapGrid.GetInDir(Direction.West)); + var nw = MatchingEntity(SnapGrid.GetInDir(Direction.NorthWest)); + + // ReSharper disable InconsistentNaming + var cornerNE = CornerFill.None; + var cornerSE = CornerFill.None; + var cornerSW = CornerFill.None; + var cornerNW = CornerFill.None; + // ReSharper restore InconsistentNaming + + if (n) + { + cornerNE |= CornerFill.CounterClockwise; + cornerNW |= CornerFill.Clockwise; + } + + if (ne) + { + cornerNE |= CornerFill.Diagonal; + } + + if (e) + { + cornerNE |= CornerFill.Clockwise; + cornerSE |= CornerFill.CounterClockwise; + } + + if (se) + { + cornerSE |= CornerFill.Diagonal; + } + + if (s) + { + cornerSE |= CornerFill.Clockwise; + cornerSW |= CornerFill.CounterClockwise; + } + + if (sw) + { + cornerSW |= CornerFill.Diagonal; + } + + if (w) + { + cornerSW |= CornerFill.Clockwise; + cornerNW |= CornerFill.CounterClockwise; + } + + if (nw) + { + 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}"); + } + public override void Shutdown() { SnapGrid.OnPositionChanged -= SnapGridOnPositionChanged; @@ -104,6 +209,52 @@ namespace Content.Client.GameObjects.Components.IconSmoothing _lastPosition = (Owner.Transform.GridID, SnapGrid.Position); } + [System.Diagnostics.Contracts.Pure] + protected bool MatchingEntity(IEnumerable candidates) + { + foreach (var entity in candidates) + { + if (!entity.TryGetComponent(out IconSmoothComponent other)) + { + continue; + } + + if (other.SmoothKey == SmoothKey) + { + return true; + } + } + + return false; + } + + [Flags] + private enum CardinalConnectDirs : byte + { + None = 0, + North = 1, + South = 2, + East = 4, + West = 8 + } + + [Flags] + public enum CornerFill : byte + { + // 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, + } + [SuppressMessage("ReSharper", "InconsistentNaming")] public enum CornerLayers { diff --git a/Content.Client/GameObjects/Components/LowWallComponent.cs b/Content.Client/GameObjects/Components/LowWallComponent.cs new file mode 100644 index 0000000000..2f1b6e3868 --- /dev/null +++ b/Content.Client/GameObjects/Components/LowWallComponent.cs @@ -0,0 +1,206 @@ +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using Content.Client.GameObjects.Components.IconSmoothing; +using Robust.Shared.Interfaces.GameObjects; +using Robust.Shared.Maths; +using static Robust.Client.GameObjects.SpriteComponent; + +namespace Content.Client.GameObjects.Components +{ + // TODO: Over layers should be placed ABOVE the window itself too. + // This is gonna require a client entity & parenting, + // so IsMapTransform being naive is gonna be a problem. + + /// + /// Override of icon smoothing to handle the specific complexities of low walls. + /// + public class LowWallComponent : IconSmoothComponent + { + public override string Name => "LowWall"; + + public CornerFill LastCornerNE { get; private set; } + public CornerFill LastCornerSE { get; private set; } + public CornerFill LastCornerSW { get; private set; } + public CornerFill LastCornerNW { get; private set; } + + public override void Startup() + { + base.Startup(); + + var overState0 = $"{StateBase}over_0"; + Sprite.LayerMapSet(OverCornerLayers.SE, Sprite.AddLayerState(overState0)); + Sprite.LayerSetDirOffset(OverCornerLayers.SE, DirectionOffset.None); + Sprite.LayerMapSet(OverCornerLayers.NE, Sprite.AddLayerState(overState0)); + Sprite.LayerSetDirOffset(OverCornerLayers.NE, DirectionOffset.CounterClockwise); + Sprite.LayerMapSet(OverCornerLayers.NW, Sprite.AddLayerState(overState0)); + Sprite.LayerSetDirOffset(OverCornerLayers.NW, DirectionOffset.Flip); + Sprite.LayerMapSet(OverCornerLayers.SW, Sprite.AddLayerState(overState0)); + Sprite.LayerSetDirOffset(OverCornerLayers.SW, DirectionOffset.Clockwise); + } + + internal override void CalculateNewSprite() + { + base.CalculateNewSprite(); + + var (n, nl) = MatchingWall(SnapGrid.GetInDir(Direction.North)); + var (ne, nel) = MatchingWall(SnapGrid.GetInDir(Direction.NorthEast)); + var (e, el) = MatchingWall(SnapGrid.GetInDir(Direction.East)); + var (se, sel) = MatchingWall(SnapGrid.GetInDir(Direction.SouthEast)); + var (s, sl) = MatchingWall(SnapGrid.GetInDir(Direction.South)); + var (sw, swl) = MatchingWall(SnapGrid.GetInDir(Direction.SouthWest)); + var (w, wl) = MatchingWall(SnapGrid.GetInDir(Direction.West)); + var (nw, nwl) = MatchingWall(SnapGrid.GetInDir(Direction.NorthWest)); + + // ReSharper disable InconsistentNaming + var cornerNE = CornerFill.None; + var cornerSE = CornerFill.None; + var cornerSW = CornerFill.None; + var cornerNW = CornerFill.None; + + var lowCornerNE = CornerFill.None; + var lowCornerSE = CornerFill.None; + var lowCornerSW = CornerFill.None; + var lowCornerNW = CornerFill.None; + // ReSharper restore InconsistentNaming + + if (n) + { + cornerNE |= CornerFill.CounterClockwise; + cornerNW |= CornerFill.Clockwise; + + if (!nl) + { + lowCornerNE |= CornerFill.CounterClockwise; + lowCornerNW |= CornerFill.Clockwise; + } + } + + if (ne) + { + cornerNE |= CornerFill.Diagonal; + + if (!nel && (nl || el || n && e)) + { + lowCornerNE |= CornerFill.Diagonal; + } + } + + if (e) + { + cornerNE |= CornerFill.Clockwise; + cornerSE |= CornerFill.CounterClockwise; + + if (!el) + { + lowCornerNE |= CornerFill.Clockwise; + lowCornerSE |= CornerFill.CounterClockwise; + } + } + + if (se) + { + cornerSE |= CornerFill.Diagonal; + + if (!sel && (sl || el || s && e)) + { + lowCornerSE |= CornerFill.Diagonal; + } + } + + if (s) + { + cornerSE |= CornerFill.Clockwise; + cornerSW |= CornerFill.CounterClockwise; + + if (!sl) + { + lowCornerSE |= CornerFill.Clockwise; + lowCornerSW |= CornerFill.CounterClockwise; + } + } + + if (sw) + { + cornerSW |= CornerFill.Diagonal; + + if (!swl && (sl || wl || s && w)) + { + lowCornerSW |= CornerFill.Diagonal; + } + } + + if (w) + { + cornerSW |= CornerFill.Clockwise; + cornerNW |= CornerFill.CounterClockwise; + + if (!wl) + { + lowCornerSW |= CornerFill.Clockwise; + lowCornerNW |= CornerFill.CounterClockwise; + } + } + + if (nw) + { + cornerNW |= CornerFill.Diagonal; + + if (!nwl && (nl || wl || n && w)) + { + lowCornerNW |= 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}"); + + Sprite.LayerSetState(OverCornerLayers.NE, $"{StateBase}over_{(int) lowCornerNE}"); + Sprite.LayerSetState(OverCornerLayers.SE, $"{StateBase}over_{(int) lowCornerSE}"); + Sprite.LayerSetState(OverCornerLayers.SW, $"{StateBase}over_{(int) lowCornerSW}"); + Sprite.LayerSetState(OverCornerLayers.NW, $"{StateBase}over_{(int) lowCornerNW}"); + + LastCornerNE = cornerNE; + LastCornerSE = cornerSE; + LastCornerSW = cornerSW; + LastCornerNW = cornerNW; + + foreach (var entity in SnapGrid.GetLocal()) + { + if (entity.TryGetComponent(out WindowComponent window)) + { + window.UpdateSprite(); + } + } + } + + [System.Diagnostics.Contracts.Pure] + private (bool connected, bool lowWall) MatchingWall(IEnumerable candidates) + { + foreach (var entity in candidates) + { + if (!entity.TryGetComponent(out IconSmoothComponent other)) + { + continue; + } + + if (other.SmoothKey == SmoothKey) + { + return (true, other is LowWallComponent); + } + } + + return (false, false); + } + + [SuppressMessage("ReSharper", "InconsistentNaming")] + private enum OverCornerLayers + { + SE, + NE, + NW, + SW, + } + } +} diff --git a/Content.Client/GameObjects/Components/WindowComponent.cs b/Content.Client/GameObjects/Components/WindowComponent.cs new file mode 100644 index 0000000000..f92c7b4f20 --- /dev/null +++ b/Content.Client/GameObjects/Components/WindowComponent.cs @@ -0,0 +1,91 @@ +using Content.Client.GameObjects.EntitySystems; +using Robust.Client.GameObjects; +using Robust.Client.Interfaces.GameObjects.Components; +using Robust.Shared.GameObjects; +using Robust.Shared.GameObjects.Components.Transform; +using Robust.Shared.Serialization; +using static Content.Client.GameObjects.Components.IconSmoothing.IconSmoothComponent; + +namespace Content.Client.GameObjects.Components +{ + public sealed class WindowComponent : Component + { + public override string Name => "Window"; + + private string _stateBase; + private ISpriteComponent _sprite; + private SnapGridComponent _snapGrid; + + public override void Initialize() + { + base.Initialize(); + + _sprite = Owner.GetComponent(); + _snapGrid = Owner.GetComponent(); + } + + public override void Startup() + { + base.Startup(); + + _snapGrid.OnPositionChanged += SnapGridOnPositionChanged; + Owner.EntityManager.RaiseEvent(Owner, new WindowSmoothDirtyEvent()); + + var state0 = $"{_stateBase}0"; + _sprite.LayerMapSet(CornerLayers.SE, _sprite.AddLayerState(state0)); + _sprite.LayerSetDirOffset(CornerLayers.SE, SpriteComponent.DirectionOffset.None); + _sprite.LayerMapSet(CornerLayers.NE, _sprite.AddLayerState(state0)); + _sprite.LayerSetDirOffset(CornerLayers.NE, SpriteComponent.DirectionOffset.CounterClockwise); + _sprite.LayerMapSet(CornerLayers.NW, _sprite.AddLayerState(state0)); + _sprite.LayerSetDirOffset(CornerLayers.NW, SpriteComponent.DirectionOffset.Flip); + _sprite.LayerMapSet(CornerLayers.SW, _sprite.AddLayerState(state0)); + _sprite.LayerSetDirOffset(CornerLayers.SW, SpriteComponent.DirectionOffset.Clockwise); + } + + public override void Shutdown() + { + _snapGrid.OnPositionChanged -= SnapGridOnPositionChanged; + + base.Shutdown(); + } + + private void SnapGridOnPositionChanged() + { + Owner.EntityManager.RaiseEvent(Owner, new WindowSmoothDirtyEvent()); + } + + public void UpdateSprite() + { + var lowWall = FindLowWall(); + if (lowWall == null) + { + return; + } + + _sprite.LayerSetState(CornerLayers.NE, $"{_stateBase}{(int) lowWall.LastCornerNE}"); + _sprite.LayerSetState(CornerLayers.SE, $"{_stateBase}{(int) lowWall.LastCornerSE}"); + _sprite.LayerSetState(CornerLayers.SW, $"{_stateBase}{(int) lowWall.LastCornerSW}"); + _sprite.LayerSetState(CornerLayers.NW, $"{_stateBase}{(int) lowWall.LastCornerNW}"); + } + + private LowWallComponent FindLowWall() + { + foreach (var entity in _snapGrid.GetLocal()) + { + if (entity.TryGetComponent(out LowWallComponent lowWall)) + { + return lowWall; + } + } + + return null; + } + + public override void ExposeData(ObjectSerializer serializer) + { + base.ExposeData(serializer); + + serializer.DataField(ref _stateBase, "base", null); + } + } +} diff --git a/Content.Client/GameObjects/EntitySystems/IconSmoothSystem.cs b/Content.Client/GameObjects/EntitySystems/IconSmoothSystem.cs index b210804f00..9b7851360a 100644 --- a/Content.Client/GameObjects/EntitySystems/IconSmoothSystem.cs +++ b/Content.Client/GameObjects/EntitySystems/IconSmoothSystem.cs @@ -1,9 +1,7 @@ -using System; using System.Collections.Generic; using System.Linq; using Content.Client.GameObjects.Components.IconSmoothing; using JetBrains.Annotations; -using Robust.Client.Interfaces.GameObjects.Components; using Robust.Shared.GameObjects; using Robust.Shared.GameObjects.Components.Transform; using Robust.Shared.GameObjects.Systems; @@ -132,157 +130,10 @@ namespace Content.Client.GameObjects.EntitySystems return; } - var sprite = smoothing.Sprite; - var snapGrid = smoothing.SnapGrid; - - switch (smoothing.Mode) - { - case IconSmoothingMode.Corners: - _calculateNewSpriteCorers(smoothing, snapGrid, sprite); - break; - - case IconSmoothingMode.CardinalFlags: - _calculateNewSpriteCardinal(smoothing, snapGrid, sprite); - break; - - default: - throw new ArgumentOutOfRangeException(); - } + smoothing.CalculateNewSprite(); smoothing.UpdateGeneration = _generation; } - - private static void _calculateNewSpriteCardinal(IconSmoothComponent smoothing, SnapGridComponent snapGrid, - ISpriteComponent sprite) - { - var dirs = CardinalConnectDirs.None; - - if (MatchingEntity(smoothing, snapGrid.GetInDir(Direction.North))) - dirs |= CardinalConnectDirs.North; - if (MatchingEntity(smoothing, snapGrid.GetInDir(Direction.South))) - dirs |= CardinalConnectDirs.South; - if (MatchingEntity(smoothing, snapGrid.GetInDir(Direction.East))) - dirs |= CardinalConnectDirs.East; - if (MatchingEntity(smoothing, snapGrid.GetInDir(Direction.West))) - dirs |= CardinalConnectDirs.West; - - sprite.LayerSetState(0, $"{smoothing.StateBase}{(int) dirs}"); - } - - private static void _calculateNewSpriteCorers(IconSmoothComponent smoothing, SnapGridComponent snapGrid, - ISpriteComponent sprite) - { - var n = MatchingEntity(smoothing, snapGrid.GetInDir(Direction.North)); - var ne = MatchingEntity(smoothing, snapGrid.GetInDir(Direction.NorthEast)); - var e = MatchingEntity(smoothing, snapGrid.GetInDir(Direction.East)); - var se = MatchingEntity(smoothing, snapGrid.GetInDir(Direction.SouthEast)); - var s = MatchingEntity(smoothing, snapGrid.GetInDir(Direction.South)); - var sw = MatchingEntity(smoothing, snapGrid.GetInDir(Direction.SouthWest)); - var w = MatchingEntity(smoothing, snapGrid.GetInDir(Direction.West)); - var nw = MatchingEntity(smoothing, snapGrid.GetInDir(Direction.NorthWest)); - - // ReSharper disable InconsistentNaming - var cornerNE = CornerFill.None; - var cornerSE = CornerFill.None; - var cornerSW = CornerFill.None; - var cornerNW = CornerFill.None; - // ReSharper restore InconsistentNaming - - if (n) - { - cornerNE |= CornerFill.CounterClockwise; - cornerNW |= CornerFill.Clockwise; - } - - if (ne) - { - cornerNE |= CornerFill.Diagonal; - } - - if (e) - { - cornerNE |= CornerFill.Clockwise; - cornerSE |= CornerFill.CounterClockwise; - } - - if (se) - { - cornerSE |= CornerFill.Diagonal; - } - - if (s) - { - cornerSE |= CornerFill.Clockwise; - cornerSW |= CornerFill.CounterClockwise; - } - - if (sw) - { - cornerSW |= CornerFill.Diagonal; - } - - if (w) - { - cornerSW |= CornerFill.Clockwise; - cornerNW |= CornerFill.CounterClockwise; - } - - if (nw) - { - cornerNW |= CornerFill.Diagonal; - } - - sprite.LayerSetState(IconSmoothComponent.CornerLayers.NE, $"{smoothing.StateBase}{(int) cornerNE}"); - sprite.LayerSetState(IconSmoothComponent.CornerLayers.SE, $"{smoothing.StateBase}{(int) cornerSE}"); - sprite.LayerSetState(IconSmoothComponent.CornerLayers.SW, $"{smoothing.StateBase}{(int) cornerSW}"); - sprite.LayerSetState(IconSmoothComponent.CornerLayers.NW, $"{smoothing.StateBase}{(int) cornerNW}"); - } - - [System.Diagnostics.Contracts.Pure] - private static bool MatchingEntity(IconSmoothComponent source, IEnumerable candidates) - { - foreach (var entity in candidates) - { - if (!entity.TryGetComponent(out IconSmoothComponent other)) - { - return false; - } - - if (other.SmoothKey == source.SmoothKey) - { - return true; - } - } - - return false; - } - - [Flags] - private enum CardinalConnectDirs : byte - { - None = 0, - North = 1, - South = 2, - East = 4, - West = 8 - } - - [Flags] - private enum CornerFill : byte - { - // 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/Content.Client/GameObjects/EntitySystems/WindowSystem.cs b/Content.Client/GameObjects/EntitySystems/WindowSystem.cs new file mode 100644 index 0000000000..73b33afb10 --- /dev/null +++ b/Content.Client/GameObjects/EntitySystems/WindowSystem.cs @@ -0,0 +1,51 @@ +using System.Collections.Generic; +using Content.Client.GameObjects.Components; +using Content.Client.GameObjects.Components.IconSmoothing; +using JetBrains.Annotations; +using Robust.Shared.GameObjects; +using Robust.Shared.GameObjects.Components.Transform; +using Robust.Shared.GameObjects.Systems; +using Robust.Shared.Interfaces.GameObjects; +using Robust.Shared.Map; + +namespace Content.Client.GameObjects.EntitySystems +{ + [UsedImplicitly] + public sealed class WindowSystem : EntitySystem + { + private readonly Queue _dirtyEntities = new Queue(); + + public override void Initialize() + { + base.Initialize(); + + SubscribeEvent(HandleDirtyEvent); + } + + private void HandleDirtyEvent(object sender, WindowSmoothDirtyEvent ev) + { + if (sender is IEntity senderEnt && senderEnt.HasComponent()) + { + _dirtyEntities.Enqueue(senderEnt); + } + } + + public override void FrameUpdate(float frameTime) + { + base.FrameUpdate(frameTime); + + // Performance: This could be spread over multiple updates, or made parallel. + while (_dirtyEntities.Count > 0) + { + _dirtyEntities.Dequeue().GetComponent().UpdateSprite(); + } + } + } + + /// + /// Event raised by a when it needs to be recalculated. + /// + public sealed class WindowSmoothDirtyEvent : EntitySystemMessage + { + } +} diff --git a/Resources/Prototypes/Entities/walls.yml b/Resources/Prototypes/Entities/walls.yml index 3f571b595c..1d76d42830 100644 --- a/Resources/Prototypes/Entities/walls.yml +++ b/Resources/Prototypes/Entities/walls.yml @@ -5,7 +5,7 @@ - type: Clickable - type: Sprite netsync: false - color: "#636769" + color: "#71797a" drawdepth: Walls sprite: Buildings/wall.rsi @@ -23,10 +23,10 @@ sizeX: 32 sizeY: 32 - type: SnapGrid - offset: Edge + offset: Center - type: IconSmooth - key: walls. Seriously, just a wall. Nothing extraordinary here. + key: walls base: solid placement: diff --git a/Resources/Prototypes/Entities/walls/structures/low_wall.yml b/Resources/Prototypes/Entities/walls/structures/low_wall.yml new file mode 100644 index 0000000000..7394d08de8 --- /dev/null +++ b/Resources/Prototypes/Entities/walls/structures/low_wall.yml @@ -0,0 +1,32 @@ +- type: entity + id: low_wall + name: Low Wall + description: Goes up to about your waist. + components: + - type: Clickable + - type: Sprite + netsync: false + color: "#71797a" + drawdepth: Walls + sprite: Buildings/low_wall.rsi + + - type: Icon + sprite: Buildings/low_wall.rsi + state: metal + + - type: BoundingBox + - type: Collidable + - type: Damageable + - type: Destructible + thresholdvalue: 100 + + - type: SnapGrid + offset: Center + + - type: LowWall + key: walls + base: metal_ + + placement: + snap: + - Wall diff --git a/Resources/Prototypes/Entities/walls/structures/windows.yml b/Resources/Prototypes/Entities/walls/structures/windows.yml new file mode 100644 index 0000000000..550b606c84 --- /dev/null +++ b/Resources/Prototypes/Entities/walls/structures/windows.yml @@ -0,0 +1,30 @@ +- type: entity + id: window + name: Window + description: Don't smudge up the glass down there. + components: + - type: Clickable + - type: Sprite + netsync: false + drawdepth: WallTops + sprite: Buildings/window.rsi + + - type: Icon + sprite: Buildings/window.rsi + state: window0 + + - type: BoundingBox + - type: Collidable + - type: Damageable + - type: Destructible + thresholdvalue: 100 + + - type: SnapGrid + offset: Center + + - type: Window + base: window + + placement: + snap: + - Wall diff --git a/Resources/Textures/Buildings/low_wall.rsi/meta.json b/Resources/Textures/Buildings/low_wall.rsi/meta.json new file mode 100644 index 0000000000..13c05547ff --- /dev/null +++ b/Resources/Textures/Buildings/low_wall.rsi/meta.json @@ -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/b503939d31b23c025ddb936b75e0a265d85154c5/icons/obj/structures/low_wall.dmi", "states": [{"name": "metal", "directions": 1, "delays": [[1.0]]}, {"name": "metal_0", "directions": 4, "delays": [[1.0], [1.0], [1.0], [1.0]]}, {"name": "metal_1", "directions": 4, "delays": [[1.0], [1.0], [1.0], [1.0]]}, {"name": "metal_2", "directions": 4, "delays": [[1.0], [1.0], [1.0], [1.0]]}, {"name": "metal_3", "directions": 4, "delays": [[1.0], [1.0], [1.0], [1.0]]}, {"name": "metal_4", "directions": 4, "delays": [[1.0], [1.0], [1.0], [1.0]]}, {"name": "metal_5", "directions": 4, "delays": [[1.0], [1.0], [1.0], [1.0]]}, {"name": "metal_6", "directions": 4, "delays": [[1.0], [1.0], [1.0], [1.0]]}, {"name": "metal_7", "directions": 4, "delays": [[1.0], [1.0], [1.0], [1.0]]}, {"name": "metal_over_0", "directions": 4, "delays": [[1.0], [1.0], [1.0], [1.0]]}, {"name": "metal_over_1", "directions": 4, "delays": [[1.0], [1.0], [1.0], [1.0]]}, {"name": "metal_over_2", "directions": 4, "delays": [[1.0], [1.0], [1.0], [1.0]]}, {"name": "metal_over_3", "directions": 4, "delays": [[1.0], [1.0], [1.0], [1.0]]}, {"name": "metal_over_4", "directions": 4, "delays": [[1.0], [1.0], [1.0], [1.0]]}, {"name": "metal_over_5", "directions": 4, "delays": [[1.0], [1.0], [1.0], [1.0]]}, {"name": "metal_over_6", "directions": 4, "delays": [[1.0], [1.0], [1.0], [1.0]]}, {"name": "metal_over_7", "directions": 4, "delays": [[1.0], [1.0], [1.0], [1.0]]}]} \ No newline at end of file diff --git a/Resources/Textures/Buildings/low_wall.rsi/metal.png b/Resources/Textures/Buildings/low_wall.rsi/metal.png new file mode 100644 index 0000000000..21a1e3e059 Binary files /dev/null and b/Resources/Textures/Buildings/low_wall.rsi/metal.png differ diff --git a/Resources/Textures/Buildings/low_wall.rsi/metal_0.png b/Resources/Textures/Buildings/low_wall.rsi/metal_0.png new file mode 100644 index 0000000000..e1498c7536 Binary files /dev/null and b/Resources/Textures/Buildings/low_wall.rsi/metal_0.png differ diff --git a/Resources/Textures/Buildings/low_wall.rsi/metal_1.png b/Resources/Textures/Buildings/low_wall.rsi/metal_1.png new file mode 100644 index 0000000000..8ed2f0b192 Binary files /dev/null and b/Resources/Textures/Buildings/low_wall.rsi/metal_1.png differ diff --git a/Resources/Textures/Buildings/low_wall.rsi/metal_2.png b/Resources/Textures/Buildings/low_wall.rsi/metal_2.png new file mode 100644 index 0000000000..e1498c7536 Binary files /dev/null and b/Resources/Textures/Buildings/low_wall.rsi/metal_2.png differ diff --git a/Resources/Textures/Buildings/low_wall.rsi/metal_3.png b/Resources/Textures/Buildings/low_wall.rsi/metal_3.png new file mode 100644 index 0000000000..8ed2f0b192 Binary files /dev/null and b/Resources/Textures/Buildings/low_wall.rsi/metal_3.png differ diff --git a/Resources/Textures/Buildings/low_wall.rsi/metal_4.png b/Resources/Textures/Buildings/low_wall.rsi/metal_4.png new file mode 100644 index 0000000000..bb544bf0cb Binary files /dev/null and b/Resources/Textures/Buildings/low_wall.rsi/metal_4.png differ diff --git a/Resources/Textures/Buildings/low_wall.rsi/metal_5.png b/Resources/Textures/Buildings/low_wall.rsi/metal_5.png new file mode 100644 index 0000000000..c59b2bab9d Binary files /dev/null and b/Resources/Textures/Buildings/low_wall.rsi/metal_5.png differ diff --git a/Resources/Textures/Buildings/low_wall.rsi/metal_6.png b/Resources/Textures/Buildings/low_wall.rsi/metal_6.png new file mode 100644 index 0000000000..bb544bf0cb Binary files /dev/null and b/Resources/Textures/Buildings/low_wall.rsi/metal_6.png differ diff --git a/Resources/Textures/Buildings/low_wall.rsi/metal_7.png b/Resources/Textures/Buildings/low_wall.rsi/metal_7.png new file mode 100644 index 0000000000..4acb40b3b2 Binary files /dev/null and b/Resources/Textures/Buildings/low_wall.rsi/metal_7.png differ diff --git a/Resources/Textures/Buildings/low_wall.rsi/metal_over_0.png b/Resources/Textures/Buildings/low_wall.rsi/metal_over_0.png new file mode 100644 index 0000000000..0858c19f05 Binary files /dev/null and b/Resources/Textures/Buildings/low_wall.rsi/metal_over_0.png differ diff --git a/Resources/Textures/Buildings/low_wall.rsi/metal_over_1.png b/Resources/Textures/Buildings/low_wall.rsi/metal_over_1.png new file mode 100644 index 0000000000..6390841edd Binary files /dev/null and b/Resources/Textures/Buildings/low_wall.rsi/metal_over_1.png differ diff --git a/Resources/Textures/Buildings/low_wall.rsi/metal_over_2.png b/Resources/Textures/Buildings/low_wall.rsi/metal_over_2.png new file mode 100644 index 0000000000..0858c19f05 Binary files /dev/null and b/Resources/Textures/Buildings/low_wall.rsi/metal_over_2.png differ diff --git a/Resources/Textures/Buildings/low_wall.rsi/metal_over_3.png b/Resources/Textures/Buildings/low_wall.rsi/metal_over_3.png new file mode 100644 index 0000000000..b487006f41 Binary files /dev/null and b/Resources/Textures/Buildings/low_wall.rsi/metal_over_3.png differ diff --git a/Resources/Textures/Buildings/low_wall.rsi/metal_over_4.png b/Resources/Textures/Buildings/low_wall.rsi/metal_over_4.png new file mode 100644 index 0000000000..fdf7f77302 Binary files /dev/null and b/Resources/Textures/Buildings/low_wall.rsi/metal_over_4.png differ diff --git a/Resources/Textures/Buildings/low_wall.rsi/metal_over_5.png b/Resources/Textures/Buildings/low_wall.rsi/metal_over_5.png new file mode 100644 index 0000000000..8527bd051a Binary files /dev/null and b/Resources/Textures/Buildings/low_wall.rsi/metal_over_5.png differ diff --git a/Resources/Textures/Buildings/low_wall.rsi/metal_over_6.png b/Resources/Textures/Buildings/low_wall.rsi/metal_over_6.png new file mode 100644 index 0000000000..ff8e3ed9ff Binary files /dev/null and b/Resources/Textures/Buildings/low_wall.rsi/metal_over_6.png differ diff --git a/Resources/Textures/Buildings/low_wall.rsi/metal_over_7.png b/Resources/Textures/Buildings/low_wall.rsi/metal_over_7.png new file mode 100644 index 0000000000..3ca5afe7ba Binary files /dev/null and b/Resources/Textures/Buildings/low_wall.rsi/metal_over_7.png differ diff --git a/Resources/Textures/Buildings/rwindow.rsi/meta.json b/Resources/Textures/Buildings/rwindow.rsi/meta.json new file mode 100644 index 0000000000..e45955bc22 --- /dev/null +++ b/Resources/Textures/Buildings/rwindow.rsi/meta.json @@ -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/c0293684320e7b70cbcac932b8dddeee35f3a51f/icons/obj/structures/windows.dmi", "states": [{"name": "rwindow0", "directions": 4, "delays": [[1.0], [1.0], [1.0], [1.0]]}, {"name": "rwindow1", "directions": 4, "delays": [[1.0], [1.0], [1.0], [1.0]]}, {"name": "rwindow2", "directions": 4, "delays": [[1.0], [1.0], [1.0], [1.0]]}, {"name": "rwindow3", "directions": 4, "delays": [[1.0], [1.0], [1.0], [1.0]]}, {"name": "rwindow4", "directions": 4, "delays": [[1.0], [1.0], [1.0], [1.0]]}, {"name": "rwindow5", "directions": 4, "delays": [[1.0], [1.0], [1.0], [1.0]]}, {"name": "rwindow6", "directions": 4, "delays": [[1.0], [1.0], [1.0], [1.0]]}, {"name": "rwindow7", "directions": 4, "delays": [[1.0], [1.0], [1.0], [1.0]]}]} \ No newline at end of file diff --git a/Resources/Textures/Buildings/rwindow.rsi/rwindow0.png b/Resources/Textures/Buildings/rwindow.rsi/rwindow0.png new file mode 100644 index 0000000000..e0c71ee394 Binary files /dev/null and b/Resources/Textures/Buildings/rwindow.rsi/rwindow0.png differ diff --git a/Resources/Textures/Buildings/rwindow.rsi/rwindow1.png b/Resources/Textures/Buildings/rwindow.rsi/rwindow1.png new file mode 100644 index 0000000000..8789d79385 Binary files /dev/null and b/Resources/Textures/Buildings/rwindow.rsi/rwindow1.png differ diff --git a/Resources/Textures/Buildings/rwindow.rsi/rwindow2.png b/Resources/Textures/Buildings/rwindow.rsi/rwindow2.png new file mode 100644 index 0000000000..e0c71ee394 Binary files /dev/null and b/Resources/Textures/Buildings/rwindow.rsi/rwindow2.png differ diff --git a/Resources/Textures/Buildings/rwindow.rsi/rwindow3.png b/Resources/Textures/Buildings/rwindow.rsi/rwindow3.png new file mode 100644 index 0000000000..8789d79385 Binary files /dev/null and b/Resources/Textures/Buildings/rwindow.rsi/rwindow3.png differ diff --git a/Resources/Textures/Buildings/rwindow.rsi/rwindow4.png b/Resources/Textures/Buildings/rwindow.rsi/rwindow4.png new file mode 100644 index 0000000000..5545fa5d9e Binary files /dev/null and b/Resources/Textures/Buildings/rwindow.rsi/rwindow4.png differ diff --git a/Resources/Textures/Buildings/rwindow.rsi/rwindow5.png b/Resources/Textures/Buildings/rwindow.rsi/rwindow5.png new file mode 100644 index 0000000000..155e2d2a94 Binary files /dev/null and b/Resources/Textures/Buildings/rwindow.rsi/rwindow5.png differ diff --git a/Resources/Textures/Buildings/rwindow.rsi/rwindow6.png b/Resources/Textures/Buildings/rwindow.rsi/rwindow6.png new file mode 100644 index 0000000000..5545fa5d9e Binary files /dev/null and b/Resources/Textures/Buildings/rwindow.rsi/rwindow6.png differ diff --git a/Resources/Textures/Buildings/rwindow.rsi/rwindow7.png b/Resources/Textures/Buildings/rwindow.rsi/rwindow7.png new file mode 100644 index 0000000000..ce4a98b3b5 Binary files /dev/null and b/Resources/Textures/Buildings/rwindow.rsi/rwindow7.png differ diff --git a/Resources/Textures/Buildings/wall.rsi/full.png b/Resources/Textures/Buildings/wall.rsi/full.png index 21a102bb3a..ff0bdc22d7 100644 Binary files a/Resources/Textures/Buildings/wall.rsi/full.png and b/Resources/Textures/Buildings/wall.rsi/full.png differ diff --git a/Resources/Textures/Buildings/wall.rsi/solid0.png b/Resources/Textures/Buildings/wall.rsi/solid0.png index 3a809c3b5f..48d8a534c7 100644 Binary files a/Resources/Textures/Buildings/wall.rsi/solid0.png 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 index b7dcaf9459..a04f2ea6b4 100644 Binary files a/Resources/Textures/Buildings/wall.rsi/solid1.png 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 index 3a809c3b5f..48d8a534c7 100644 Binary files a/Resources/Textures/Buildings/wall.rsi/solid2.png 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 index b7dcaf9459..a04f2ea6b4 100644 Binary files a/Resources/Textures/Buildings/wall.rsi/solid3.png 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 index 940e571456..6fc90a4154 100644 Binary files a/Resources/Textures/Buildings/wall.rsi/solid4.png 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 index 5c69be5b41..bb0d903bab 100644 Binary files a/Resources/Textures/Buildings/wall.rsi/solid5.png 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 index 940e571456..6fc90a4154 100644 Binary files a/Resources/Textures/Buildings/wall.rsi/solid6.png 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 index 5ee21983bc..5ad40cae4c 100644 Binary files a/Resources/Textures/Buildings/wall.rsi/solid7.png and b/Resources/Textures/Buildings/wall.rsi/solid7.png differ diff --git a/Resources/Textures/Buildings/window.rsi/meta.json b/Resources/Textures/Buildings/window.rsi/meta.json new file mode 100644 index 0000000000..bb6a983f12 --- /dev/null +++ b/Resources/Textures/Buildings/window.rsi/meta.json @@ -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/c0293684320e7b70cbcac932b8dddeee35f3a51f/icons/obj/structures/windows.dmi", "states": [{"name": "window0", "directions": 4, "delays": [[1.0], [1.0], [1.0], [1.0]]}, {"name": "window1", "directions": 4, "delays": [[1.0], [1.0], [1.0], [1.0]]}, {"name": "window2", "directions": 4, "delays": [[1.0], [1.0], [1.0], [1.0]]}, {"name": "window3", "directions": 4, "delays": [[1.0], [1.0], [1.0], [1.0]]}, {"name": "window4", "directions": 4, "delays": [[1.0], [1.0], [1.0], [1.0]]}, {"name": "window5", "directions": 4, "delays": [[1.0], [1.0], [1.0], [1.0]]}, {"name": "window6", "directions": 4, "delays": [[1.0], [1.0], [1.0], [1.0]]}, {"name": "window7", "directions": 4, "delays": [[1.0], [1.0], [1.0], [1.0]]}]} \ No newline at end of file diff --git a/Resources/Textures/Buildings/window.rsi/window0.png b/Resources/Textures/Buildings/window.rsi/window0.png new file mode 100644 index 0000000000..bc0a3c2731 Binary files /dev/null and b/Resources/Textures/Buildings/window.rsi/window0.png differ diff --git a/Resources/Textures/Buildings/window.rsi/window1.png b/Resources/Textures/Buildings/window.rsi/window1.png new file mode 100644 index 0000000000..274b4bbb5e Binary files /dev/null and b/Resources/Textures/Buildings/window.rsi/window1.png differ diff --git a/Resources/Textures/Buildings/window.rsi/window2.png b/Resources/Textures/Buildings/window.rsi/window2.png new file mode 100644 index 0000000000..bc0a3c2731 Binary files /dev/null and b/Resources/Textures/Buildings/window.rsi/window2.png differ diff --git a/Resources/Textures/Buildings/window.rsi/window3.png b/Resources/Textures/Buildings/window.rsi/window3.png new file mode 100644 index 0000000000..274b4bbb5e Binary files /dev/null and b/Resources/Textures/Buildings/window.rsi/window3.png differ diff --git a/Resources/Textures/Buildings/window.rsi/window4.png b/Resources/Textures/Buildings/window.rsi/window4.png new file mode 100644 index 0000000000..f7bdfb316f Binary files /dev/null and b/Resources/Textures/Buildings/window.rsi/window4.png differ diff --git a/Resources/Textures/Buildings/window.rsi/window5.png b/Resources/Textures/Buildings/window.rsi/window5.png new file mode 100644 index 0000000000..cb440e5fc2 Binary files /dev/null and b/Resources/Textures/Buildings/window.rsi/window5.png differ diff --git a/Resources/Textures/Buildings/window.rsi/window6.png b/Resources/Textures/Buildings/window.rsi/window6.png new file mode 100644 index 0000000000..f7bdfb316f Binary files /dev/null and b/Resources/Textures/Buildings/window.rsi/window6.png differ diff --git a/Resources/Textures/Buildings/window.rsi/window7.png b/Resources/Textures/Buildings/window.rsi/window7.png new file mode 100644 index 0000000000..58a2d6a215 Binary files /dev/null and b/Resources/Textures/Buildings/window.rsi/window7.png differ