diff --git a/Content.Client/Commands/ToggleHealthBarsCommand.cs b/Content.Client/Commands/ToggleHealthBarsCommand.cs index 3842325f94..33aaceabdb 100644 --- a/Content.Client/Commands/ToggleHealthBarsCommand.cs +++ b/Content.Client/Commands/ToggleHealthBarsCommand.cs @@ -1,6 +1,6 @@ using Robust.Client.Player; using Robust.Shared.Console; -using Content.Shared.EntityHealthBar; +using Content.Shared.White.EntityHealthBar; namespace Content.Client.Commands { diff --git a/Content.Client/White/EntityCrimeRecords/EntityCrimeRecordsOverlay.cs b/Content.Client/White/EntityCrimeRecords/EntityCrimeRecordsOverlay.cs index 0aed2ba10a..fc5b3d7e08 100644 --- a/Content.Client/White/EntityCrimeRecords/EntityCrimeRecordsOverlay.cs +++ b/Content.Client/White/EntityCrimeRecords/EntityCrimeRecordsOverlay.cs @@ -19,24 +19,19 @@ public sealed class EntityCrimeRecordsOverlay : Overlay { private readonly IEntityManager _entManager; private readonly SharedTransformSystem _transform; - private readonly IPrototypeManager _prototypeManager; private readonly InventorySystem _inventorySystem; - private readonly ShaderInstance _shader; private readonly ShowCrimeRecordsSystem _parentSystem; public override OverlaySpace Space => OverlaySpace.WorldSpaceBelowFOV; public EntityCrimeRecordsOverlay( IEntityManager entManager, - IPrototypeManager protoManager, InventorySystem inventorySystem, ShowCrimeRecordsSystem showCrimSystem) { _entManager = entManager; - _prototypeManager = protoManager; _inventorySystem = inventorySystem; _parentSystem = showCrimSystem; _transform = _entManager.EntitySysManager.GetEntitySystem(); - _shader = protoManager.Index("unshaded").Instance(); } protected override void Draw(in OverlayDrawArgs args) @@ -49,7 +44,6 @@ public sealed class EntityCrimeRecordsOverlay : Overlay const float scale = 1f; var scaleMatrix = Matrix3.CreateScale(new Vector2(scale, scale)); var rotationMatrix = Matrix3.CreateRotation(-rotation); - handle.UseShader(_shader); // da pizda this.ZIndex = this.ZIndex -= 1; diff --git a/Content.Client/White/EntityCrimeRecords/ShowCrimeRecordsSystem.cs b/Content.Client/White/EntityCrimeRecords/ShowCrimeRecordsSystem.cs index e3c3e1b5da..f9842337f4 100644 --- a/Content.Client/White/EntityCrimeRecords/ShowCrimeRecordsSystem.cs +++ b/Content.Client/White/EntityCrimeRecords/ShowCrimeRecordsSystem.cs @@ -30,7 +30,7 @@ namespace Content.Client.White.EntityCrimeRecords SubscribeLocalEvent(OnPlayerDetached); SubscribeLocalEvent(OnRoundRestart); - _overlay = new(EntityManager, _protoMan, _inventorySystem, this); + _overlay = new(EntityManager, _inventorySystem, this); } private void OnInit(EntityUid uid, ShowCrimeRecordsComponent component, ComponentInit args) diff --git a/Content.Client/White/EntityHealthBar/EntityHealthBarOverlay.cs b/Content.Client/White/EntityHealthBar/EntityHealthBarOverlay.cs index a7e62ea999..5d9f3c5db5 100644 --- a/Content.Client/White/EntityHealthBar/EntityHealthBarOverlay.cs +++ b/Content.Client/White/EntityHealthBar/EntityHealthBarOverlay.cs @@ -11,7 +11,7 @@ using Robust.Shared.Prototypes; using Robust.Shared.Utility; using Robust.Shared.Timing; -namespace Content.Client.EntityHealthBar; +namespace Content.Client.White.EntityHealthBar; /// /// Yeah a lot of this is duplicated from doafters. diff --git a/Content.Client/White/EntityHealthBar/ShowHealthBarsSystem.cs b/Content.Client/White/EntityHealthBar/ShowHealthBarsSystem.cs index fd1127b16a..17aab45d73 100644 --- a/Content.Client/White/EntityHealthBar/ShowHealthBarsSystem.cs +++ b/Content.Client/White/EntityHealthBar/ShowHealthBarsSystem.cs @@ -1,11 +1,11 @@ -using Content.Shared.EntityHealthBar; +using Content.Shared.White.EntityHealthBar; using Content.Shared.GameTicking; using Robust.Client.Player; using Robust.Client.Graphics; using Robust.Shared.Player; using Robust.Shared.Prototypes; -namespace Content.Client.EntityHealthBar +namespace Content.Client.White.EntityHealthBar { public sealed class ShowHealthBarsSystem : EntitySystem { diff --git a/Content.Client/White/EntityJobInfo/EntityJobInfoOverlay.cs b/Content.Client/White/EntityJobInfo/EntityJobInfoOverlay.cs index 70cd8df5fc..8eef408442 100644 --- a/Content.Client/White/EntityJobInfo/EntityJobInfoOverlay.cs +++ b/Content.Client/White/EntityJobInfo/EntityJobInfoOverlay.cs @@ -11,7 +11,7 @@ using Content.Shared.Roles; using System.Diagnostics.CodeAnalysis; using System.Numerics; -namespace Content.Client.EntityJobInfo; +namespace Content.Client.White.EntityJobInfo; public sealed class EntityJobInfoOverlay : Overlay { @@ -19,7 +19,6 @@ public sealed class EntityJobInfoOverlay : Overlay private readonly SharedTransformSystem _transform; private readonly IPrototypeManager _prototypeManager; private readonly InventorySystem _inventorySystem; - private readonly ShaderInstance _shader; public override OverlaySpace Space => OverlaySpace.WorldSpaceBelowFOV; public EntityJobInfoOverlay(IEntityManager entManager, IPrototypeManager protoManager, InventorySystem inventorySystem) @@ -28,7 +27,6 @@ public sealed class EntityJobInfoOverlay : Overlay _prototypeManager = protoManager; _inventorySystem = inventorySystem; _transform = _entManager.EntitySysManager.GetEntitySystem(); - _shader = protoManager.Index("unshaded").Instance(); } protected override void Draw(in OverlayDrawArgs args) @@ -41,7 +39,6 @@ public sealed class EntityJobInfoOverlay : Overlay const float scale = 1f; var scaleMatrix = Matrix3.CreateScale(new Vector2(scale, scale)); var rotationMatrix = Matrix3.CreateRotation(-rotation); - handle.UseShader(_shader); foreach (var hum in _entManager.EntityQuery(true)) { diff --git a/Content.Client/White/EntityJobInfo/ShowJobInfoSystem.cs b/Content.Client/White/EntityJobInfo/ShowJobInfoSystem.cs index f8d6e75199..2b1c6adeb6 100644 --- a/Content.Client/White/EntityJobInfo/ShowJobInfoSystem.cs +++ b/Content.Client/White/EntityJobInfo/ShowJobInfoSystem.cs @@ -1,4 +1,4 @@ -using Content.Shared.EntityJobInfo; +using Content.Shared.White.EntityJobInfo; using Content.Shared.GameTicking; using Robust.Client.Player; using Robust.Client.Graphics; @@ -7,59 +7,58 @@ using Robust.Shared.Prototypes; using Content.Shared.Inventory; using Robust.Shared.Player; -namespace Content.Client.EntityJobInfo +namespace Content.Client.White.EntityJobInfo; + +public sealed class ShowJobInfoSystem : EntitySystem { - public sealed class ShowJobInfoSystem : EntitySystem + [Dependency] private readonly IPlayerManager _player = default!; + [Dependency] private readonly IPrototypeManager _protoMan = default!; + [Dependency] private readonly IOverlayManager _overlayMan = default!; + [Dependency] private readonly InventorySystem _inventorySystem = default!; + [Dependency] private readonly ILogManager _log = default!; + + private EntityJobInfoOverlay _overlay = default!; + public override void Initialize() { - [Dependency] private readonly IPlayerManager _player = default!; - [Dependency] private readonly IPrototypeManager _protoMan = default!; - [Dependency] private readonly IOverlayManager _overlayMan = default!; - [Dependency] private readonly InventorySystem _inventorySystem = default!; + base.Initialize(); - private EntityJobInfoOverlay _overlay = default!; - public override void Initialize() - { - base.Initialize(); + SubscribeLocalEvent(OnInit); + SubscribeLocalEvent(OnRemove); + SubscribeLocalEvent(OnPlayerAttached); + SubscribeLocalEvent(OnPlayerDetached); + SubscribeLocalEvent(OnRoundRestart); - SubscribeLocalEvent(OnInit); - SubscribeLocalEvent(OnRemove); - SubscribeLocalEvent(OnPlayerAttached); - SubscribeLocalEvent(OnPlayerDetached); - SubscribeLocalEvent(OnRoundRestart); + _overlay = new(EntityManager, _protoMan, _inventorySystem); + } - _overlay = new(EntityManager, _protoMan, _inventorySystem); - } - - private void OnInit(EntityUid uid, ShowJobInfoComponent component, ComponentInit args) - { - if (_player.LocalPlayer?.ControlledEntity == uid) - { - _overlayMan.AddOverlay(_overlay); - } - - - } - private void OnRemove(EntityUid uid, ShowJobInfoComponent component, ComponentRemove args) - { - if (_player.LocalPlayer?.ControlledEntity == uid) - { - _overlayMan.RemoveOverlay(_overlay); - } - } - - private void OnPlayerAttached(EntityUid uid, ShowJobInfoComponent component, PlayerAttachedEvent args) + private void OnInit(EntityUid uid, ShowJobInfoComponent component, ComponentInit args) + { + if (_player.LocalPlayer?.ControlledEntity == uid) { _overlayMan.AddOverlay(_overlay); } + } - private void OnPlayerDetached(EntityUid uid, ShowJobInfoComponent component, PlayerDetachedEvent args) - { - _overlayMan.RemoveOverlay(_overlay); - } - - private void OnRoundRestart(RoundRestartCleanupEvent args) + private void OnRemove(EntityUid uid, ShowJobInfoComponent component, ComponentRemove args) + { + if (_player.LocalPlayer?.ControlledEntity == uid) { _overlayMan.RemoveOverlay(_overlay); } } + + private void OnPlayerAttached(EntityUid uid, ShowJobInfoComponent component, PlayerAttachedEvent args) + { + _overlayMan.AddOverlay(_overlay); + } + + private void OnPlayerDetached(EntityUid uid, ShowJobInfoComponent component, PlayerDetachedEvent args) + { + _overlayMan.RemoveOverlay(_overlay); + } + + private void OnRoundRestart(RoundRestartCleanupEvent args) + { + _overlayMan.RemoveOverlay(_overlay); + } } diff --git a/Content.Shared/White/ClothingGrant/Components/ClothingGrantComponent.cs b/Content.Shared/White/ClothingGrant/Components/ClothingGrantComponent.cs index 8a39931c7d..e8546f6d50 100644 --- a/Content.Shared/White/ClothingGrant/Components/ClothingGrantComponent.cs +++ b/Content.Shared/White/ClothingGrant/Components/ClothingGrantComponent.cs @@ -1,15 +1,17 @@ +using Robust.Shared.GameStates; using Robust.Shared.Prototypes; -namespace Content.Shared.Clothing -{ - [RegisterComponent] - public sealed partial class ClothingGrantComponentComponent : Component - { - [DataField("component", required: true)] - [AlwaysPushInheritance] - public ComponentRegistry Components { get; set; } = new(); +namespace Content.Shared.White.ClothingGrant.Components; - [ViewVariables(VVAccess.ReadWrite)] - public bool IsActive = false; - } +[RegisterComponent, NetworkedComponent] +[AutoGenerateComponentState] +public sealed partial class ClothingGrantComponentComponent : Component +{ + [DataField("component", required: true)] + [AlwaysPushInheritance] + public ComponentRegistry Components { get; private set; } = new(); + + [ViewVariables(VVAccess.ReadWrite)] + [AutoNetworkedField] + public bool IsActive = false; } diff --git a/Content.Shared/White/ClothingGrant/Components/ClothingGrantTagComponent.cs b/Content.Shared/White/ClothingGrant/Components/ClothingGrantTagComponent.cs index ff67f5c9a5..53afd1062c 100644 --- a/Content.Shared/White/ClothingGrant/Components/ClothingGrantTagComponent.cs +++ b/Content.Shared/White/ClothingGrant/Components/ClothingGrantTagComponent.cs @@ -1,11 +1,16 @@ -namespace Content.Shared.Clothing +using Robust.Shared.GameStates; + +namespace Content.Shared.White.ClothingGrant.Components { - [RegisterComponent] + [RegisterComponent, NetworkedComponent] + [AutoGenerateComponentState] public sealed partial class ClothingGrantTagComponent : Component { [DataField("tag", required: true), ViewVariables(VVAccess.ReadWrite)] public string Tag = ""; - [ViewVariables(VVAccess.ReadWrite)] public bool IsActive = false; + [ViewVariables(VVAccess.ReadWrite)] + [AutoNetworkedField] + public bool IsActive = false; } } diff --git a/Content.Shared/White/ClothingGrant/Systems/ClothingGrantingSystem.cs b/Content.Shared/White/ClothingGrant/Systems/ClothingGrantingSystem.cs index f82cd566d7..7411c84fca 100644 --- a/Content.Shared/White/ClothingGrant/Systems/ClothingGrantingSystem.cs +++ b/Content.Shared/White/ClothingGrant/Systems/ClothingGrantingSystem.cs @@ -2,8 +2,9 @@ using Content.Shared.Clothing.Components; using Content.Shared.Inventory.Events; using Robust.Shared.Serialization.Manager; using Content.Shared.Tag; +using Content.Shared.White.ClothingGrant.Components; -namespace Content.Shared.Clothing; +namespace Content.Shared.White.ClothingGrant.Systems; public sealed class ClothingGrantingSystem : EntitySystem { @@ -44,9 +45,10 @@ public sealed class ClothingGrantingSystem : EntitySystem var temp = (object) newComp; _serializationManager.CopyTo(data.Component, ref temp); EntityManager.AddComponent(args.Equipee, (Component)temp!); - - component.IsActive = true; } + + component.IsActive = true; + Dirty(component); } private void OnCompUnequip(EntityUid uid, ClothingGrantComponentComponent component, GotUnequippedEvent args) @@ -61,6 +63,7 @@ public sealed class ClothingGrantingSystem : EntitySystem } component.IsActive = false; + Dirty(component); } private void OnTagEquip(EntityUid uid, ClothingGrantTagComponent component, GotEquippedEvent args) @@ -73,6 +76,7 @@ public sealed class ClothingGrantingSystem : EntitySystem _tagSystem.AddTag(args.Equipee, component.Tag); component.IsActive = true; + Dirty(component); } private void OnTagUnequip(EntityUid uid, ClothingGrantTagComponent component, GotUnequippedEvent args) @@ -82,5 +86,6 @@ public sealed class ClothingGrantingSystem : EntitySystem _tagSystem.RemoveTag(args.Equipee, component.Tag); component.IsActive = false; + Dirty(component); } } diff --git a/Content.Shared/White/EntityCrimeRecords/ShowCrimeRecordsComponent.cs b/Content.Shared/White/EntityCrimeRecords/ShowCrimeRecordsComponent.cs index 76c1544562..a06f960eea 100644 --- a/Content.Shared/White/EntityCrimeRecords/ShowCrimeRecordsComponent.cs +++ b/Content.Shared/White/EntityCrimeRecords/ShowCrimeRecordsComponent.cs @@ -1,9 +1,11 @@ +using Robust.Shared.GameStates; + namespace Content.Shared.White.EntityCrimeRecords { /// /// Allow to see crime records info for character /// - [RegisterComponent] + [RegisterComponent, NetworkedComponent] public sealed partial class ShowCrimeRecordsComponent : Component { } diff --git a/Content.Shared/White/EntityHealthBar/ShowHealthBarsComponent.cs b/Content.Shared/White/EntityHealthBar/ShowHealthBarsComponent.cs index 0feae82ad8..75f5477be9 100644 --- a/Content.Shared/White/EntityHealthBar/ShowHealthBarsComponent.cs +++ b/Content.Shared/White/EntityHealthBar/ShowHealthBarsComponent.cs @@ -1,14 +1,15 @@ using Content.Shared.Damage.Prototypes; +using Robust.Shared.GameStates; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List; -namespace Content.Shared.EntityHealthBar +namespace Content.Shared.White.EntityHealthBar { /// /// This component allows you to see health bars above damageable mobs. /// - [RegisterComponent] - public sealed partial class ShowWhiteHealthBarsComponent : Component + [RegisterComponent, NetworkedComponent] + public sealed partial class ShowHealthBarsComponent : Component { /// /// Displays health bars of the damage containers. diff --git a/Content.Shared/White/EntityJobInfo/ShowJobInfoComponent.cs b/Content.Shared/White/EntityJobInfo/ShowJobInfoComponent.cs index 9f9126a0ae..6a92314e57 100644 --- a/Content.Shared/White/EntityJobInfo/ShowJobInfoComponent.cs +++ b/Content.Shared/White/EntityJobInfo/ShowJobInfoComponent.cs @@ -1,9 +1,11 @@ -namespace Content.Shared.EntityJobInfo; +using Robust.Shared.GameStates; + +namespace Content.Shared.White.EntityJobInfo; /// /// This component allows you to see job icon from entity(char) /// -[RegisterComponent] +[RegisterComponent, NetworkedComponent] public sealed partial class ShowJobInfoComponent : Component { }