diff --git a/Content.Client/Actions/ActionsSystem.cs b/Content.Client/Actions/ActionsSystem.cs index 26a22fa8b8df37..7b13233bab5cd5 100644 --- a/Content.Client/Actions/ActionsSystem.cs +++ b/Content.Client/Actions/ActionsSystem.cs @@ -51,6 +51,29 @@ public override void Initialize() SubscribeLocalEvent(OnEntityWorldTargetHandleState); } + public override void FrameUpdate(float frameTime) + { + base.FrameUpdate(frameTime); + + var worldActionQuery = EntityQueryEnumerator(); + while (worldActionQuery.MoveNext(out var uid, out var action)) + { + UpdateAction(uid, action); + } + + var instantActionQuery = EntityQueryEnumerator(); + while (instantActionQuery.MoveNext(out var uid, out var action)) + { + UpdateAction(uid, action); + } + + var entityActionQuery = EntityQueryEnumerator(); + while (entityActionQuery.MoveNext(out var uid, out var action)) + { + UpdateAction(uid, action); + } + } + private void OnInstantHandleState(EntityUid uid, InstantActionComponent component, ref ComponentHandleState args) { if (args.Current is not InstantActionComponentState state) @@ -95,6 +118,8 @@ private void BaseHandleState(EntityUid uid, BaseActionComponent component, Ba component.Icon = state.Icon; component.IconOn = state.IconOn; component.IconColor = state.IconColor; + component.OriginalIconColor = state.OriginalIconColor; + component.DisabledIconColor = state.DisabledIconColor; component.Keywords.Clear(); component.Keywords.UnionWith(state.Keywords); component.Enabled = state.Enabled; @@ -125,6 +150,8 @@ public override void UpdateAction(EntityUid? actionId, BaseActionComponent? acti if (!ResolveActionData(actionId, ref action)) return; + action.IconColor = action.Charges < 1 ? action.DisabledIconColor : action.OriginalIconColor; + base.UpdateAction(actionId, action); if (_playerManager.LocalEntity != action.AttachedEntity) return; diff --git a/Content.Client/Audio/ContentAudioSystem.LobbyMusic.cs b/Content.Client/Audio/ContentAudioSystem.LobbyMusic.cs index 9864dbcb2a91bf..7d7d77f51a3fd2 100644 --- a/Content.Client/Audio/ContentAudioSystem.LobbyMusic.cs +++ b/Content.Client/Audio/ContentAudioSystem.LobbyMusic.cs @@ -20,7 +20,6 @@ public sealed partial class ContentAudioSystem { [Dependency] private readonly IBaseClient _client = default!; [Dependency] private readonly ClientGameTicker _gameTicker = default!; - [Dependency] private readonly IStateManager _stateManager = default!; [Dependency] private readonly IResourceCache _resourceCache = default!; private readonly AudioParams _lobbySoundtrackParams = new(-5f, 1, 0, 0, 0, false, 0f); @@ -71,7 +70,7 @@ private void InitializeLobbyMusic() Subs.CVar(_configManager, CCVars.LobbyMusicEnabled, LobbyMusicCVarChanged); Subs.CVar(_configManager, CCVars.LobbyMusicVolume, LobbyMusicVolumeCVarChanged); - _stateManager.OnStateChanged += StateManagerOnStateChanged; + _state.OnStateChanged += StateManagerOnStateChanged; _client.PlayerLeaveServer += OnLeave; @@ -115,7 +114,7 @@ private void LobbyMusicVolumeCVarChanged(float volume) private void LobbyMusicCVarChanged(bool musicEnabled) { - if (musicEnabled && _stateManager.CurrentState is LobbyState) + if (musicEnabled && _state.CurrentState is LobbyState) { StartLobbyMusic(); } @@ -234,7 +233,7 @@ private void PlayRestartSound(RoundRestartCleanupEvent ev) private void ShutdownLobbyMusic() { - _stateManager.OnStateChanged -= StateManagerOnStateChanged; + _state.OnStateChanged -= StateManagerOnStateChanged; _client.PlayerLeaveServer -= OnLeave; diff --git a/Content.Client/Buckle/BuckleSystem.cs b/Content.Client/Buckle/BuckleSystem.cs index f854acddb9d433..3b0623a86d8d08 100644 --- a/Content.Client/Buckle/BuckleSystem.cs +++ b/Content.Client/Buckle/BuckleSystem.cs @@ -16,7 +16,6 @@ public override void Initialize() { base.Initialize(); - SubscribeLocalEvent(OnHandleState); SubscribeLocalEvent(OnAppearanceChange); SubscribeLocalEvent(OnStrapMoveEvent); } @@ -63,21 +62,6 @@ private void OnStrapMoveEvent(EntityUid uid, StrapComponent component, ref MoveE } } - private void OnHandleState(Entity ent, ref ComponentHandleState args) - { - if (args.Current is not BuckleState state) - return; - - ent.Comp.DontCollide = state.DontCollide; - ent.Comp.BuckleTime = state.BuckleTime; - var strapUid = EnsureEntity(state.BuckledTo, ent); - - SetBuckledTo(ent, strapUid == null ? null : new (strapUid.Value, null)); - - var (uid, component) = ent; - - } - private void OnAppearanceChange(EntityUid uid, BuckleComponent component, ref AppearanceChangeEvent args) { if (!TryComp(uid, out var rotVisuals)) diff --git a/Content.Client/Cargo/Systems/ClientPriceGunSystem.cs b/Content.Client/Cargo/Systems/ClientPriceGunSystem.cs new file mode 100644 index 00000000000000..f1739324783649 --- /dev/null +++ b/Content.Client/Cargo/Systems/ClientPriceGunSystem.cs @@ -0,0 +1,21 @@ +using Content.Shared.Timing; +using Content.Shared.Cargo.Systems; + +namespace Content.Client.Cargo.Systems; + +/// +/// This handles... +/// +public sealed class ClientPriceGunSystem : SharedPriceGunSystem +{ + [Dependency] private readonly UseDelaySystem _useDelay = default!; + + protected override bool GetPriceOrBounty(EntityUid priceGunUid, EntityUid target, EntityUid user) + { + if (!TryComp(priceGunUid, out UseDelayComponent? useDelay) || _useDelay.IsDelayed((priceGunUid, useDelay))) + return false; + + // It feels worse if the cooldown is predicted but the popup isn't! So only do the cooldown reset on the server. + return true; + } +} diff --git a/Content.Client/Chat/Managers/ChatManager.cs b/Content.Client/Chat/Managers/ChatManager.cs index 9f6be69eafa03c..b0f0ee804bd565 100644 --- a/Content.Client/Chat/Managers/ChatManager.cs +++ b/Content.Client/Chat/Managers/ChatManager.cs @@ -21,6 +21,16 @@ public void Initialize() _sawmill.Level = LogLevel.Info; } + public void SendAdminAlert(string message) + { + // See server-side manager. This just exists for shared code. + } + + public void SendAdminAlert(EntityUid player, string message) + { + // See server-side manager. This just exists for shared code. + } + public void SendMessage(string text, ChatSelectChannel channel) { var str = text.ToString(); diff --git a/Content.Client/Chat/Managers/IChatManager.cs b/Content.Client/Chat/Managers/IChatManager.cs index 6464ca1019615c..62a97c6bd82b22 100644 --- a/Content.Client/Chat/Managers/IChatManager.cs +++ b/Content.Client/Chat/Managers/IChatManager.cs @@ -2,10 +2,8 @@ namespace Content.Client.Chat.Managers { - public interface IChatManager + public interface IChatManager : ISharedChatManager { - void Initialize(); - public void SendMessage(string text, ChatSelectChannel channel); } } diff --git a/Content.Client/Ensnaring/EnsnareableSystem.cs b/Content.Client/Ensnaring/EnsnareableSystem.cs index b7a5a45ca0c62a..6861bd8f09a81c 100644 --- a/Content.Client/Ensnaring/EnsnareableSystem.cs +++ b/Content.Client/Ensnaring/EnsnareableSystem.cs @@ -2,7 +2,7 @@ using Content.Shared.Ensnaring.Components; using Robust.Client.GameObjects; -namespace Content.Client.Ensnaring.Visualizers; +namespace Content.Client.Ensnaring; public sealed class EnsnareableSystem : SharedEnsnareableSystem { @@ -12,13 +12,14 @@ public override void Initialize() { base.Initialize(); - SubscribeLocalEvent(OnComponentInit); SubscribeLocalEvent(OnAppearanceChange); } - private void OnComponentInit(EntityUid uid, EnsnareableComponent component, ComponentInit args) + protected override void OnEnsnareInit(Entity ent, ref ComponentInit args) { - if(!TryComp(uid, out var sprite)) + base.OnEnsnareInit(ent, ref args); + + if(!TryComp(ent.Owner, out var sprite)) return; // TODO remove this, this should just be in yaml. diff --git a/Content.Client/Entry/EntryPoint.cs b/Content.Client/Entry/EntryPoint.cs index 72104df47be1cc..102204bbbbcd74 100644 --- a/Content.Client/Entry/EntryPoint.cs +++ b/Content.Client/Entry/EntryPoint.cs @@ -78,7 +78,6 @@ public sealed class EntryPoint : GameClient [Dependency] private readonly IReplayLoadManager _replayLoad = default!; [Dependency] private readonly ILogManager _logManager = default!; [Dependency] private readonly DiscordPlayerInfoManager _discordPlayerInfoManager = default!; // SS220 discord info manager - [Dependency] private readonly ContentReplayPlaybackManager _replayMan = default!; [Dependency] private readonly DebugMonitorManager _debugMonitorManager = default!; public override void Init() @@ -205,7 +204,7 @@ private void SwitchToDefaultState(bool disconnected = false) _resourceManager, ReplayConstants.ReplayZipFolder.ToRootedPath()); - _replayMan.LastLoad = (null, ReplayConstants.ReplayZipFolder.ToRootedPath()); + _playbackMan.LastLoad = (null, ReplayConstants.ReplayZipFolder.ToRootedPath()); _replayLoad.LoadAndStartReplay(reader); } else if (_gameController.LaunchState.FromLauncher) diff --git a/Content.Client/GPS/Components/HandheldGPSComponent.cs b/Content.Client/GPS/Components/HandheldGPSComponent.cs deleted file mode 100644 index 0f5271fd80c45b..00000000000000 --- a/Content.Client/GPS/Components/HandheldGPSComponent.cs +++ /dev/null @@ -1,9 +0,0 @@ -using Content.Shared.GPS; - -namespace Content.Client.GPS.Components -{ - [RegisterComponent] - public sealed partial class HandheldGPSComponent : SharedHandheldGPSComponent - { - } -} diff --git a/Content.Client/GPS/Systems/HandheldGpsSystem.cs b/Content.Client/GPS/Systems/HandheldGpsSystem.cs index cc2b888da37f3d..3f38a3b69529a8 100644 --- a/Content.Client/GPS/Systems/HandheldGpsSystem.cs +++ b/Content.Client/GPS/Systems/HandheldGpsSystem.cs @@ -1,4 +1,4 @@ -using Content.Client.GPS.Components; +using Content.Shared.GPS.Components; using Content.Client.GPS.UI; using Content.Client.Items; diff --git a/Content.Client/GPS/UI/HandheldGpsStatusControl.cs b/Content.Client/GPS/UI/HandheldGpsStatusControl.cs index 7dcf3f29c5197e..57645e386e7390 100644 --- a/Content.Client/GPS/UI/HandheldGpsStatusControl.cs +++ b/Content.Client/GPS/UI/HandheldGpsStatusControl.cs @@ -1,4 +1,4 @@ -using Content.Client.GPS.Components; +using Content.Shared.GPS.Components; using Content.Client.Message; using Content.Client.Stylesheets; using Robust.Client.GameObjects; @@ -30,6 +30,13 @@ protected override void FrameUpdate(FrameEventArgs args) { base.FrameUpdate(args); + // don't display the label if the gps component is being removed + if (_parent.Comp.LifeStage > ComponentLifeStage.Running) + { + _label.Visible = false; + return; + } + _updateDif += args.DeltaSeconds; if (_updateDif < _parent.Comp.UpdateRate) return; @@ -44,9 +51,9 @@ private void UpdateGpsDetails() var posText = "Error"; if (_entMan.TryGetComponent(_parent, out TransformComponent? transComp)) { - var pos = _transform.GetMapCoordinates(_parent.Owner, xform: transComp); - var x = (int) pos.X; - var y = (int) pos.Y; + var pos = _transform.GetMapCoordinates(_parent.Owner, xform: transComp); + var x = (int)pos.X; + var y = (int)pos.Y; posText = $"({x}, {y})"; } _label.SetMarkup(Loc.GetString("handheld-gps-coordinates-title", ("coordinates", posText))); diff --git a/Content.Client/HealthAnalyzer/UI/HealthAnalyzerWindow.xaml b/Content.Client/HealthAnalyzer/UI/HealthAnalyzerWindow.xaml index 97968c4b990b3d..19d00a0bbf8b1d 100644 --- a/Content.Client/HealthAnalyzer/UI/HealthAnalyzerWindow.xaml +++ b/Content.Client/HealthAnalyzer/UI/HealthAnalyzerWindow.xaml @@ -21,6 +21,7 @@ Orientation="Vertical"> +