diff --git a/Content.Client/Administration/Managers/GamePrototypeLoadManager.cs b/Content.Client/Administration/Managers/GamePrototypeLoadManager.cs index 2958cd71fa..504b35cad2 100644 --- a/Content.Client/Administration/Managers/GamePrototypeLoadManager.cs +++ b/Content.Client/Administration/Managers/GamePrototypeLoadManager.cs @@ -1,8 +1,4 @@ -using System; using Content.Shared.Administration; -using Robust.Shared.IoC; -using Robust.Shared.Localization; -using Robust.Shared.Log; using Robust.Shared.Network; using Robust.Shared.Prototypes; @@ -21,19 +17,20 @@ public sealed class GamePrototypeLoadManager : IGamePrototypeLoadManager private void LoadGamePrototype(GamePrototypeLoadMessage message) { - _prototypeManager.LoadString(message.PrototypeData, true); + var changed = new Dictionary>(); + _prototypeManager.LoadString(message.PrototypeData, true, changed); _prototypeManager.ResolveResults(); + _prototypeManager.ReloadPrototypes(changed); _localizationManager.ReloadLocalizations(); - GamePrototypeLoaded?.Invoke(); Logger.InfoS("adminbus", "Loaded adminbus prototype data."); } public void SendGamePrototype(string prototype) { - var msg = _netManager.CreateNetMessage(); - msg.PrototypeData = prototype; + var msg = new GamePrototypeLoadMessage + { + PrototypeData = prototype + }; _netManager.ClientSendMessage(msg); } - - public event Action? GamePrototypeLoaded; } diff --git a/Content.Client/Buckle/BuckleComponent.cs b/Content.Client/Buckle/BuckleComponent.cs deleted file mode 100644 index 69ad94b7d0..0000000000 --- a/Content.Client/Buckle/BuckleComponent.cs +++ /dev/null @@ -1,11 +0,0 @@ -using Content.Shared.Buckle.Components; - -namespace Content.Client.Buckle; - -[RegisterComponent] -[ComponentReference(typeof(SharedBuckleComponent))] -[Access(typeof(BuckleSystem))] -public sealed class BuckleComponent : SharedBuckleComponent -{ - public int? OriginalDrawDepth { get; set; } -} diff --git a/Content.Client/Buckle/BuckleSystem.cs b/Content.Client/Buckle/BuckleSystem.cs index 0279001d10..4b89d9b106 100644 --- a/Content.Client/Buckle/BuckleSystem.cs +++ b/Content.Client/Buckle/BuckleSystem.cs @@ -1,4 +1,3 @@ -using Content.Client.Buckle.Strap; using Content.Client.Rotation; using Content.Shared.ActionBlocker; using Content.Shared.Buckle; @@ -12,15 +11,14 @@ namespace Content.Client.Buckle internal sealed class BuckleSystem : SharedBuckleSystem { [Dependency] private readonly ActionBlockerSystem _actionBlocker = default!; - [Dependency] private readonly AppearanceSystem AppearanceSystem = default!; - [Dependency] private readonly RotationVisualizerSystem RotationVisualizerSystem = default!; + [Dependency] private readonly AppearanceSystem _appearanceSystem = default!; + [Dependency] private readonly RotationVisualizerSystem _rotationVisualizerSystem = default!; public override void Initialize() { base.Initialize(); SubscribeLocalEvent(OnBuckleHandleState); - SubscribeLocalEvent(OnStrapHandleState); SubscribeLocalEvent(OnAppearanceChange); } @@ -65,22 +63,10 @@ namespace Content.Client.Buckle } } - private void OnStrapHandleState(EntityUid uid, StrapComponent component, ref ComponentHandleState args) - { - if (args.Current is not StrapComponentState state) - return; - - component.Position = state.Position; - component.BuckleOffsetUnclamped = state.BuckleOffsetClamped; - component.BuckledEntities.Clear(); - component.BuckledEntities.UnionWith(state.BuckledEntities); - component.MaxBuckleDistance = state.MaxBuckleDistance; - } - private void OnAppearanceChange(EntityUid uid, BuckleComponent component, ref AppearanceChangeEvent args) { - if (!AppearanceSystem.TryGetData(uid, StrapVisuals.RotationAngle, out var angle, args.Component) || - !AppearanceSystem.TryGetData(uid, BuckleVisuals.Buckled, out var buckled, args.Component) || + if (!_appearanceSystem.TryGetData(uid, StrapVisuals.RotationAngle, out var angle, args.Component) || + !_appearanceSystem.TryGetData(uid, BuckleVisuals.Buckled, out var buckled, args.Component) || !buckled || args.Sprite == null) { @@ -88,7 +74,7 @@ namespace Content.Client.Buckle } // Animate strapping yourself to something at a given angle - RotationVisualizerSystem.AnimateSpriteRotation(args.Sprite, Angle.FromDegrees(angle), 0.125f); + _rotationVisualizerSystem.AnimateSpriteRotation(args.Sprite, Angle.FromDegrees(angle), 0.125f); } } } diff --git a/Content.Client/Buckle/Strap/StrapComponent.cs b/Content.Client/Buckle/Strap/StrapComponent.cs deleted file mode 100644 index 1168fff8ea..0000000000 --- a/Content.Client/Buckle/Strap/StrapComponent.cs +++ /dev/null @@ -1,10 +0,0 @@ -using Content.Shared.Buckle.Components; - -namespace Content.Client.Buckle.Strap; - -[RegisterComponent] -[ComponentReference(typeof(SharedStrapComponent))] -[Access(typeof(BuckleSystem))] -public sealed class StrapComponent : SharedStrapComponent -{ -} diff --git a/Content.Client/CartridgeLoader/CartridgeLoaderSystem.cs b/Content.Client/CartridgeLoader/CartridgeLoaderSystem.cs index 46e28d9142..e06a547814 100644 --- a/Content.Client/CartridgeLoader/CartridgeLoaderSystem.cs +++ b/Content.Client/CartridgeLoader/CartridgeLoaderSystem.cs @@ -6,10 +6,3 @@ public sealed class CartridgeLoaderSystem : SharedCartridgeLoaderSystem { //Empty client system for component replication } - -[RegisterComponent] -[ComponentReference(typeof(SharedCartridgeLoaderComponent))] -public sealed class CartridgeLoaderComponent : SharedCartridgeLoaderComponent -{ - -} diff --git a/Content.Client/Configurable/UI/ConfigurationBoundUserInterface.cs b/Content.Client/Configurable/UI/ConfigurationBoundUserInterface.cs index 9ec62e01a0..f114f0cc11 100644 --- a/Content.Client/Configurable/UI/ConfigurationBoundUserInterface.cs +++ b/Content.Client/Configurable/UI/ConfigurationBoundUserInterface.cs @@ -2,7 +2,7 @@ using System.Text.RegularExpressions; using Robust.Client.GameObjects; using Robust.Shared.GameObjects; -using static Content.Shared.Configurable.SharedConfigurationComponent; +using static Content.Shared.Configurable.ConfigurationComponent; namespace Content.Client.Configurable.UI { diff --git a/Content.Client/Configurable/UI/ConfigurationMenu.cs b/Content.Client/Configurable/UI/ConfigurationMenu.cs index 4b94e3055e..dc1e939eba 100644 --- a/Content.Client/Configurable/UI/ConfigurationMenu.cs +++ b/Content.Client/Configurable/UI/ConfigurationMenu.cs @@ -4,7 +4,7 @@ using Robust.Client.UserInterface.Controls; using Robust.Client.UserInterface.CustomControls; using Robust.Shared.Localization; using Robust.Shared.Maths; -using static Content.Shared.Configurable.SharedConfigurationComponent; +using static Content.Shared.Configurable.ConfigurationComponent; using static Robust.Client.UserInterface.Controls.BaseButton; using static Robust.Client.UserInterface.Controls.BoxContainer; diff --git a/Content.Client/Decals/UI/DecalPlacerWindow.xaml.cs b/Content.Client/Decals/UI/DecalPlacerWindow.xaml.cs index 51f48e6927..78e0725d9f 100644 --- a/Content.Client/Decals/UI/DecalPlacerWindow.xaml.cs +++ b/Content.Client/Decals/UI/DecalPlacerWindow.xaml.cs @@ -20,7 +20,7 @@ public sealed partial class DecalPlacerWindow : DefaultWindow private PaletteColorPicker? _picker; - private Dictionary? _decals; + private SortedDictionary? _decals; private string? _selected; private Color _color = Color.White; private bool _useColor; @@ -170,7 +170,7 @@ public sealed partial class DecalPlacerWindow : DefaultWindow public void Populate(IEnumerable prototypes) { - _decals = new Dictionary(); + _decals = new SortedDictionary(); foreach (var decalPrototype in prototypes) { if (decalPrototype.ShowMenu) diff --git a/Content.Client/Ensnaring/Components/EnsnareableComponent.cs b/Content.Client/Ensnaring/Components/EnsnareableComponent.cs deleted file mode 100644 index 7035dcfad8..0000000000 --- a/Content.Client/Ensnaring/Components/EnsnareableComponent.cs +++ /dev/null @@ -1,13 +0,0 @@ -using Content.Shared.Ensnaring.Components; - -namespace Content.Client.Ensnaring.Components; -[RegisterComponent] -[ComponentReference(typeof(SharedEnsnareableComponent))] -public sealed class EnsnareableComponent : SharedEnsnareableComponent -{ - [DataField("sprite")] - public string? Sprite; - - [DataField("state")] - public string? State; -} diff --git a/Content.Client/Ensnaring/Components/EnsnaringComponent.cs b/Content.Client/Ensnaring/Components/EnsnaringComponent.cs index 83c7e1199d..63c8d0dfbe 100644 --- a/Content.Client/Ensnaring/Components/EnsnaringComponent.cs +++ b/Content.Client/Ensnaring/Components/EnsnaringComponent.cs @@ -1,9 +1,3 @@ using Content.Shared.Ensnaring.Components; -namespace Content.Client.Ensnaring.Components; -[RegisterComponent] -[ComponentReference(typeof(SharedEnsnaringComponent))] -public sealed class EnsnaringComponent : SharedEnsnaringComponent -{ -} diff --git a/Content.Client/Ensnaring/EnsnareableSystem.cs b/Content.Client/Ensnaring/EnsnareableSystem.cs index 9ccb5dcba5..dd4c76e6b1 100644 --- a/Content.Client/Ensnaring/EnsnareableSystem.cs +++ b/Content.Client/Ensnaring/EnsnareableSystem.cs @@ -1,5 +1,5 @@ -using Content.Client.Ensnaring.Components; using Content.Shared.Ensnaring; +using Content.Shared.Ensnaring.Components; using Robust.Client.GameObjects; namespace Content.Client.Ensnaring.Visualizers; diff --git a/Content.Client/Flash/FlashSystem.cs b/Content.Client/Flash/FlashSystem.cs index 9cdfd61e03..3393662fa4 100644 --- a/Content.Client/Flash/FlashSystem.cs +++ b/Content.Client/Flash/FlashSystem.cs @@ -1,9 +1,7 @@ using Content.Shared.Flash; using Robust.Client.Graphics; using Robust.Client.Player; -using Robust.Shared.GameObjects; using Robust.Shared.GameStates; -using Robust.Shared.IoC; using Robust.Shared.Timing; namespace Content.Client.Flash diff --git a/Content.Client/Flash/FlashableComponent.cs b/Content.Client/Flash/FlashableComponent.cs deleted file mode 100644 index 714d2d7c1c..0000000000 --- a/Content.Client/Flash/FlashableComponent.cs +++ /dev/null @@ -1,12 +0,0 @@ -using Content.Shared.Flash; -using Robust.Shared.Analyzers; -using Robust.Shared.GameObjects; - -namespace Content.Client.Flash -{ - [ComponentReference(typeof(SharedFlashableComponent))] - [RegisterComponent, Access(typeof(FlashSystem))] - public sealed class FlashableComponent : SharedFlashableComponent - { - } -} diff --git a/Content.Client/Humanoid/HumanoidComponent.cs b/Content.Client/Humanoid/HumanoidComponent.cs deleted file mode 100644 index d433013c9d..0000000000 --- a/Content.Client/Humanoid/HumanoidComponent.cs +++ /dev/null @@ -1,15 +0,0 @@ -using Content.Shared.Humanoid; -using Content.Shared.Humanoid.Markings; -using Content.Shared.Humanoid.Prototypes; - -namespace Content.Client.Humanoid; - -[RegisterComponent] -public sealed class HumanoidComponent : SharedHumanoidComponent -{ - [ViewVariables] public List CurrentMarkings = new(); - - public Dictionary BaseLayers = new(); - - public string LastSpecies = default!; -} diff --git a/Content.Client/Humanoid/HumanoidVisualizerSystem.cs b/Content.Client/Humanoid/HumanoidVisualizerSystem.cs index 808a5a1ba7..5539ec27d1 100644 --- a/Content.Client/Humanoid/HumanoidVisualizerSystem.cs +++ b/Content.Client/Humanoid/HumanoidVisualizerSystem.cs @@ -108,23 +108,23 @@ public sealed class HumanoidVisualizerSystem : VisualizerSystem(); - var dirtyRangeStart = humanoid.CurrentMarkings.Count == 0 ? 0 : -1; + var dirtyRangeStart = humanoid.CurrentClientMarkings.Count == 0 ? 0 : -1; // edge cases: - // humanoid.CurrentMarkings < newMarkings.Count + // humanoid.CurrentClientMarkings < newMarkings.Count // - check if count matches this condition before diffing - // - if count is unequal, set dirty range to start from humanoid.CurrentMarkings.Count - // humanoid.CurrentMarkings > newMarkings.Count, no dirty markings + // - if count is unequal, set dirty range to start from humanoid.CurrentClientMarkings.Count + // humanoid.CurrentClientMarkings > newMarkings.Count, no dirty markings // - break count upon meeting this condition - // - clear markings from newMarkings.Count to humanoid.CurrentMarkings.Count - newMarkings.Count + // - clear markings from newMarkings.Count to humanoid.CurrentClientMarkings.Count - newMarkings.Count - for (var i = 0; i < humanoid.CurrentMarkings.Count; i++) + for (var i = 0; i < humanoid.CurrentClientMarkings.Count; i++) { // if we've reached the end of the new set of markings, // then that means it's time to finish @@ -135,7 +135,7 @@ public sealed class HumanoidVisualizerSystem : VisualizerSystem