diff --git a/Content.Client/AirlockPainter/AirlockPainterSystem.cs b/Content.Client/AirlockPainter/AirlockPainterSystem.cs index 6831b0e4e1..b0ee4a970d 100644 --- a/Content.Client/AirlockPainter/AirlockPainterSystem.cs +++ b/Content.Client/AirlockPainter/AirlockPainterSystem.cs @@ -3,7 +3,7 @@ using Robust.Client.Graphics; using Robust.Client.ResourceManagement; using Robust.Shared.Utility; using System.Linq; -using static Robust.Shared.GameObjects.SharedSpriteComponent; +using Robust.Shared.Serialization.TypeSerializers.Implementations; namespace Content.Client.AirlockPainter { @@ -28,7 +28,7 @@ namespace Content.Client.AirlockPainter continue; } - RSIResource doorRsi = _resourceCache.GetResource(TextureRoot / new ResPath(iconPath)); + RSIResource doorRsi = _resourceCache.GetResource(SpriteSpecifierSerializer.TextureRoot / new ResPath(iconPath)); if (!doorRsi.RSI.TryGetState("closed", out var icon)) { Entries.Add(new AirlockPainterEntry(style, null)); diff --git a/Content.Client/Atmos/EntitySystems/AtmosPipeAppearanceSystem.cs b/Content.Client/Atmos/EntitySystems/AtmosPipeAppearanceSystem.cs index a9c5b53192..dcb904d5a5 100644 --- a/Content.Client/Atmos/EntitySystems/AtmosPipeAppearanceSystem.cs +++ b/Content.Client/Atmos/EntitySystems/AtmosPipeAppearanceSystem.cs @@ -5,6 +5,7 @@ using Content.Shared.Atmos.Piping; using JetBrains.Annotations; using Robust.Client.GameObjects; using Robust.Client.ResourceManagement; +using Robust.Shared.Serialization.TypeSerializers.Implementations; namespace Content.Client.Atmos.EntitySystems; @@ -27,7 +28,7 @@ public sealed class AtmosPipeAppearanceSystem : EntitySystem if (!TryComp(uid, out SpriteComponent? sprite)) return; - if (!_resCache.TryGetResource(SharedSpriteComponent.TextureRoot / component.RsiPath, out RSIResource? rsi)) + if (!_resCache.TryGetResource(SpriteSpecifierSerializer.TextureRoot / component.RsiPath, out RSIResource? rsi)) { Logger.Error($"{nameof(AtmosPipeAppearanceSystem)} could not load to load RSI {component.RsiPath}."); return; diff --git a/Content.Client/Clothing/ClientClothingSystem.cs b/Content.Client/Clothing/ClientClothingSystem.cs index e289fb8b47..22d639fc2f 100644 --- a/Content.Client/Clothing/ClientClothingSystem.cs +++ b/Content.Client/Clothing/ClientClothingSystem.cs @@ -11,8 +11,8 @@ using Content.Shared.Item; using Robust.Client.GameObjects; using Robust.Client.Graphics; using Robust.Client.ResourceManagement; +using Robust.Shared.Serialization.TypeSerializers.Implementations; using static Robust.Client.GameObjects.SpriteComponent; -using static Robust.Shared.GameObjects.SharedSpriteComponent; namespace Content.Client.Clothing; @@ -131,7 +131,7 @@ public sealed class ClientClothingSystem : ClothingSystem RSI? rsi = null; if (clothing.RsiPath != null) - rsi = _cache.GetResource(TextureRoot / clothing.RsiPath).RSI; + rsi = _cache.GetResource(SpriteSpecifierSerializer.TextureRoot / clothing.RsiPath).RSI; else if (TryComp(uid, out SpriteComponent? sprite)) rsi = sprite.BaseRSI; diff --git a/Content.Client/Doors/DoorSystem.cs b/Content.Client/Doors/DoorSystem.cs index c77412ac65..41680e4619 100644 --- a/Content.Client/Doors/DoorSystem.cs +++ b/Content.Client/Doors/DoorSystem.cs @@ -4,8 +4,8 @@ using Robust.Client.Animations; using Robust.Client.GameObjects; using Robust.Client.ResourceManagement; using Robust.Shared.Audio; -using Robust.Shared.GameObjects; using Robust.Shared.Player; +using Robust.Shared.Serialization.TypeSerializers.Implementations; using Robust.Shared.Timing; namespace Content.Client.Doors; @@ -80,7 +80,7 @@ public sealed class DoorSystem : SharedDoorSystem if (AppearanceSystem.TryGetData(uid, DoorVisuals.BaseRSI, out var baseRsi, args.Component)) { - if (!_resourceCache.TryGetResource(SharedSpriteComponent.TextureRoot / baseRsi, out var res)) + if (!_resourceCache.TryGetResource(SpriteSpecifierSerializer.TextureRoot / baseRsi, out var res)) { Logger.Error("Unable to load RSI '{0}'. Trace:\n{1}", baseRsi, Environment.StackTrace); } @@ -89,7 +89,7 @@ public sealed class DoorSystem : SharedDoorSystem layer.Rsi = res?.RSI; } } - + TryComp(uid, out var animPlayer); if (_animationSystem.HasRunningAnimation(uid, animPlayer, DoorComponent.AnimationKey)) _animationSystem.Stop(uid, animPlayer, DoorComponent.AnimationKey); // Halt all running anomations. diff --git a/Content.Client/Items/Systems/ItemSystem.cs b/Content.Client/Items/Systems/ItemSystem.cs index cfe7bd6fb9..7ddc7d6c6d 100644 --- a/Content.Client/Items/Systems/ItemSystem.cs +++ b/Content.Client/Items/Systems/ItemSystem.cs @@ -1,12 +1,12 @@ using System.Diagnostics.CodeAnalysis; using System.Linq; using Content.Shared.Hands; +using Content.Shared.Inventory.Events; using Content.Shared.Item; using Robust.Client.GameObjects; using Robust.Client.Graphics; using Robust.Client.ResourceManagement; -using Robust.Shared.Containers; -using static Robust.Shared.GameObjects.SharedSpriteComponent; +using Robust.Shared.Serialization.TypeSerializers.Implementations; namespace Content.Client.Items.Systems; @@ -19,6 +19,20 @@ public sealed class ItemSystem : SharedItemSystem base.Initialize(); SubscribeLocalEvent(OnGetVisuals); + + // TODO is this still needed? Shouldn't containers occlude them? + SubscribeLocalEvent(OnEquipped); + SubscribeLocalEvent(OnUnequipped); + } + + private void OnUnequipped(EntityUid uid, SpriteComponent component, GotUnequippedEvent args) + { + component.Visible = true; + } + + private void OnEquipped(EntityUid uid, SpriteComponent component, GotEquippedEvent args) + { + component.Visible = false; } #region InhandVisuals @@ -75,7 +89,7 @@ public sealed class ItemSystem : SharedItemSystem RSI? rsi = null; if (item.RsiPath != null) - rsi = _resCache.GetResource(TextureRoot / item.RsiPath).RSI; + rsi = _resCache.GetResource(SpriteSpecifierSerializer.TextureRoot / item.RsiPath).RSI; else if (TryComp(uid, out SpriteComponent? sprite)) rsi = sprite.BaseRSI; diff --git a/Content.Client/Toggleable/ToggleableLightVisualsComponent.cs b/Content.Client/Toggleable/ToggleableLightVisualsComponent.cs index 58ec08f2b8..6c7c3c256d 100644 --- a/Content.Client/Toggleable/ToggleableLightVisualsComponent.cs +++ b/Content.Client/Toggleable/ToggleableLightVisualsComponent.cs @@ -1,5 +1,4 @@ using Content.Shared.Hands.Components; -using static Robust.Shared.GameObjects.SharedSpriteComponent; namespace Content.Client.Toggleable; diff --git a/Content.MapRenderer/Painters/GridPainter.cs b/Content.MapRenderer/Painters/GridPainter.cs index c6175a722d..e46ff81b5a 100644 --- a/Content.MapRenderer/Painters/GridPainter.cs +++ b/Content.MapRenderer/Painters/GridPainter.cs @@ -73,7 +73,7 @@ namespace Content.MapRenderer.Painters foreach (var entity in _sEntityManager.GetEntities()) { - if (!_sEntityManager.HasComponent(entity)) + if (!_sEntityManager.HasComponent(entity)) { continue; } diff --git a/Content.Shared/Clothing/ClothingEvents.cs b/Content.Shared/Clothing/ClothingEvents.cs index 84603eb385..639212dd4d 100644 --- a/Content.Shared/Clothing/ClothingEvents.cs +++ b/Content.Shared/Clothing/ClothingEvents.cs @@ -1,4 +1,3 @@ -using static Robust.Shared.GameObjects.SharedSpriteComponent; namespace Content.Shared.Clothing; diff --git a/Content.Shared/Clothing/Components/ClothingComponent.cs b/Content.Shared/Clothing/Components/ClothingComponent.cs index e79bee3b54..3f6925fd24 100644 --- a/Content.Shared/Clothing/Components/ClothingComponent.cs +++ b/Content.Shared/Clothing/Components/ClothingComponent.cs @@ -16,7 +16,7 @@ public sealed class ClothingComponent : Component { [DataField("clothingVisuals")] [Access(typeof(ClothingSystem), typeof(InventorySystem), Other = AccessPermissions.ReadExecute)] // TODO remove execute permissions. - public Dictionary> ClothingVisuals = new(); + public Dictionary> ClothingVisuals = new(); [ViewVariables(VVAccess.ReadWrite)] [DataField("quickEquip")] diff --git a/Content.Shared/Hands/HandEvents.cs b/Content.Shared/Hands/HandEvents.cs index 29f4b2cad8..325601d9a0 100644 --- a/Content.Shared/Hands/HandEvents.cs +++ b/Content.Shared/Hands/HandEvents.cs @@ -2,8 +2,6 @@ using Content.Shared.Hands.Components; using JetBrains.Annotations; using Robust.Shared.Map; using Robust.Shared.Serialization; -using static Robust.Shared.GameObjects.SharedSpriteComponent; - namespace Content.Shared.Hands { diff --git a/Content.Shared/Item/ItemComponent.cs b/Content.Shared/Item/ItemComponent.cs index 7540901d88..58aae4f446 100644 --- a/Content.Shared/Item/ItemComponent.cs +++ b/Content.Shared/Item/ItemComponent.cs @@ -20,7 +20,7 @@ public sealed class ItemComponent : Component [Access(typeof(SharedItemSystem))] [DataField("inhandVisuals")] - public Dictionary> InhandVisuals = new(); + public Dictionary> InhandVisuals = new(); [Access(typeof(SharedItemSystem))] [ViewVariables(VVAccess.ReadWrite)] diff --git a/Content.Shared/Item/SharedItemSystem.cs b/Content.Shared/Item/SharedItemSystem.cs index 229a25bffd..963cf95f73 100644 --- a/Content.Shared/Item/SharedItemSystem.cs +++ b/Content.Shared/Item/SharedItemSystem.cs @@ -19,9 +19,6 @@ public abstract class SharedItemSystem : EntitySystem { base.Initialize(); SubscribeLocalEvent>(AddPickupVerb); - - SubscribeLocalEvent(OnEquipped); - SubscribeLocalEvent(OnUnequipped); SubscribeLocalEvent(OnHandInteract); SubscribeLocalEvent(OnGetState); @@ -92,21 +89,6 @@ public abstract class SharedItemSystem : EntitySystem args.State = new ItemComponentState(component.Size, component.HeldPrefix); } - // Although netsync is being set to false for items client can still update these - // Realistically: - // Container should already hide these - // Client is the only thing that matters. - - private void OnUnequipped(EntityUid uid, SharedSpriteComponent component, GotUnequippedEvent args) - { - component.Visible = true; - } - - private void OnEquipped(EntityUid uid, SharedSpriteComponent component, GotEquippedEvent args) - { - component.Visible = false; - } - private void AddPickupVerb(EntityUid uid, ItemComponent component, GetVerbsEvent args) { if (args.Hands == null ||