diff --git a/Content.Client/Commands/ShowHealthBarsCommand.cs b/Content.Client/Commands/ShowHealthBarsCommand.cs index 0811f96663..6ea9d06c8c 100644 --- a/Content.Client/Commands/ShowHealthBarsCommand.cs +++ b/Content.Client/Commands/ShowHealthBarsCommand.cs @@ -1,6 +1,8 @@ +using Content.Shared.Damage.Prototypes; using Content.Shared.Overlays; using Robust.Client.Player; using Robust.Shared.Console; +using Robust.Shared.Prototypes; using System.Linq; namespace Content.Client.Commands; @@ -34,7 +36,7 @@ public override void Execute(IConsoleShell shell, string argStr, string[] args) { var showHealthBarsComponent = new ShowHealthBarsComponent { - DamageContainers = args.ToList(), + DamageContainers = args.Select(arg => new ProtoId(arg)).ToList(), HealthStatusIcon = null, NetSyncEnabled = false }; diff --git a/Content.Client/Effects/ColorFlashEffectSystem.cs b/Content.Client/Effects/ColorFlashEffectSystem.cs index 956c946524..b584aa9ad1 100644 --- a/Content.Client/Effects/ColorFlashEffectSystem.cs +++ b/Content.Client/Effects/ColorFlashEffectSystem.cs @@ -124,6 +124,10 @@ private void OnColorFlashEffect(ColorFlashEffectEvent ev) continue; } + var targetEv = new GetFlashEffectTargetEvent(ent); + RaiseLocalEvent(ent, ref targetEv); + ent = targetEv.Target; + EnsureComp(ent, out comp); comp.NetSyncEnabled = false; comp.Color = sprite.Color; @@ -132,3 +136,9 @@ private void OnColorFlashEffect(ColorFlashEffectEvent ev) } } } + +/// +/// Raised on an entity to change the target for a color flash effect. +/// +[ByRefEvent] +public record struct GetFlashEffectTargetEvent(EntityUid Target); diff --git a/Content.Client/HealthAnalyzer/UI/HealthAnalyzerWindow.xaml b/Content.Client/HealthAnalyzer/UI/HealthAnalyzerWindow.xaml index 19d00a0bbf..aae8785b1f 100644 --- a/Content.Client/HealthAnalyzer/UI/HealthAnalyzerWindow.xaml +++ b/Content.Client/HealthAnalyzer/UI/HealthAnalyzerWindow.xaml @@ -47,8 +47,7 @@ - + diff --git a/Content.Client/HealthAnalyzer/UI/HealthAnalyzerWindow.xaml.cs b/Content.Client/HealthAnalyzer/UI/HealthAnalyzerWindow.xaml.cs index d61267d002..fd3615d59f 100644 --- a/Content.Client/HealthAnalyzer/UI/HealthAnalyzerWindow.xaml.cs +++ b/Content.Client/HealthAnalyzer/UI/HealthAnalyzerWindow.xaml.cs @@ -110,18 +110,29 @@ public void Populate(HealthAnalyzerScannedUserMessage msg) // Alerts - AlertsDivider.Visible = msg.Bleeding == true; - AlertsContainer.Visible = msg.Bleeding == true; + var showAlerts = msg.Unrevivable == true || msg.Bleeding == true; - if (msg.Bleeding == true) - { + AlertsDivider.Visible = showAlerts; + AlertsContainer.Visible = showAlerts; + + if (showAlerts) AlertsContainer.DisposeAllChildren(); - AlertsContainer.AddChild(new Label + + if (msg.Unrevivable == true) + AlertsContainer.AddChild(new RichTextLabel + { + Text = Loc.GetString("health-analyzer-window-entity-unrevivable-text"), + Margin = new Thickness(0, 4), + MaxWidth = 300 + }); + + if (msg.Bleeding == true) + AlertsContainer.AddChild(new RichTextLabel { Text = Loc.GetString("health-analyzer-window-entity-bleeding-text"), - FontColorOverride = Color.Red, + Margin = new Thickness(0, 4), + MaxWidth = 300 }); - } // Damage Groups diff --git a/Content.Client/Mapping/MappingScreen.xaml b/Content.Client/Mapping/MappingScreen.xaml index 9cc3e734f0..bad492e7e4 100644 --- a/Content.Client/Mapping/MappingScreen.xaml +++ b/Content.Client/Mapping/MappingScreen.xaml @@ -8,7 +8,7 @@ VerticalExpand="False" VerticalAlignment="Bottom" HorizontalAlignment="Center"> - @@ -82,5 +82,5 @@ - + diff --git a/Content.Client/Mapping/MappingScreen.xaml.cs b/Content.Client/Mapping/MappingScreen.xaml.cs index 46c0e51fad..20e2528a44 100644 --- a/Content.Client/Mapping/MappingScreen.xaml.cs +++ b/Content.Client/Mapping/MappingScreen.xaml.cs @@ -197,7 +197,6 @@ private void RefreshList() public override void SetChatSize(Vector2 size) { - ScreenContainer.DesiredSplitCenter = size.X; ScreenContainer.ResizeMode = SplitContainer.SplitResizeMode.RespectChildrenMinSize; } diff --git a/Content.Client/Overlays/ShowThirstIconsSystem.cs b/Content.Client/Overlays/ShowThirstIconsSystem.cs index 44be1f7a67..9fc64165c5 100644 --- a/Content.Client/Overlays/ShowThirstIconsSystem.cs +++ b/Content.Client/Overlays/ShowThirstIconsSystem.cs @@ -22,6 +22,6 @@ private void OnGetStatusIconsEvent(EntityUid uid, ThirstComponent component, ref return; if (_thirst.TryGetStatusIconPrototype(component, out var iconPrototype)) - ev.StatusIcons.Add(iconPrototype!); + ev.StatusIcons.Add(iconPrototype); } } diff --git a/Content.Client/Polymorph/Systems/ChameleonProjectorSystem.cs b/Content.Client/Polymorph/Systems/ChameleonProjectorSystem.cs index 5ba4878c6d..8ba09c6617 100644 --- a/Content.Client/Polymorph/Systems/ChameleonProjectorSystem.cs +++ b/Content.Client/Polymorph/Systems/ChameleonProjectorSystem.cs @@ -1,7 +1,10 @@ +using Content.Client.Effects; +using Content.Client.Smoking; using Content.Shared.Chemistry.Components; using Content.Shared.Polymorph.Components; using Content.Shared.Polymorph.Systems; using Robust.Client.GameObjects; +using Robust.Shared.Player; namespace Content.Client.Polymorph.Systems; @@ -10,14 +13,20 @@ public sealed class ChameleonProjectorSystem : SharedChameleonProjectorSystem [Dependency] private readonly SharedAppearanceSystem _appearance = default!; private EntityQuery _appearanceQuery; + private EntityQuery _spriteQuery; public override void Initialize() { base.Initialize(); _appearanceQuery = GetEntityQuery(); + _spriteQuery = GetEntityQuery(); SubscribeLocalEvent(OnHandleState); + + SubscribeLocalEvent(OnStartup); + SubscribeLocalEvent(OnShutdown); + SubscribeLocalEvent(OnGetFlashEffectTargetEvent); } private void OnHandleState(Entity ent, ref AfterAutoHandleStateEvent args) @@ -25,9 +34,30 @@ private void OnHandleState(Entity ent, ref AfterAuto CopyComp(ent); CopyComp(ent); CopyComp(ent); + CopyComp(ent); // reload appearance to hopefully prevent any invisible layers if (_appearanceQuery.TryComp(ent, out var appearance)) _appearance.QueueUpdate(ent, appearance); } + + private void OnStartup(Entity ent, ref ComponentStartup args) + { + if (!_spriteQuery.TryComp(ent, out var sprite)) + return; + + ent.Comp.WasVisible = sprite.Visible; + sprite.Visible = false; + } + + private void OnShutdown(Entity ent, ref ComponentShutdown args) + { + if (_spriteQuery.TryComp(ent, out var sprite)) + sprite.Visible = ent.Comp.WasVisible; + } + + private void OnGetFlashEffectTargetEvent(Entity ent, ref GetFlashEffectTargetEvent args) + { + args.Target = ent.Comp.Disguise; + } } diff --git a/Content.Client/UserInterface/Controls/RecordedSplitContainer.cs b/Content.Client/UserInterface/Controls/RecordedSplitContainer.cs deleted file mode 100644 index fd217bc7e8..0000000000 --- a/Content.Client/UserInterface/Controls/RecordedSplitContainer.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System.Numerics; -using Robust.Client.UserInterface.Controls; - -namespace Content.Client.UserInterface.Controls; - -/// -/// A split container that performs an action when the split resizing is finished. -/// -public sealed class RecordedSplitContainer : SplitContainer -{ - public double? DesiredSplitCenter; - - protected override Vector2 ArrangeOverride(Vector2 finalSize) - { - if (ResizeMode == SplitResizeMode.RespectChildrenMinSize - && DesiredSplitCenter != null - && !finalSize.Equals(Vector2.Zero)) - { - SplitFraction = (float) DesiredSplitCenter.Value; - - if (!Size.Equals(Vector2.Zero)) - { - DesiredSplitCenter = null; - } - } - - return base.ArrangeOverride(finalSize); - } -} diff --git a/Content.Client/UserInterface/Screens/SeparatedChatGameScreen.xaml b/Content.Client/UserInterface/Screens/SeparatedChatGameScreen.xaml index 7f1d1bcd5b..653302fae4 100644 --- a/Content.Client/UserInterface/Screens/SeparatedChatGameScreen.xaml +++ b/Content.Client/UserInterface/Screens/SeparatedChatGameScreen.xaml @@ -14,7 +14,7 @@ VerticalExpand="False" VerticalAlignment="Bottom" HorizontalAlignment="Center"> - + @@ -26,7 +26,7 @@ - + @@ -36,5 +36,5 @@ - + diff --git a/Content.Client/UserInterface/Screens/SeparatedChatGameScreen.xaml.cs b/Content.Client/UserInterface/Screens/SeparatedChatGameScreen.xaml.cs index e04d377d32..2892ca4425 100644 --- a/Content.Client/UserInterface/Screens/SeparatedChatGameScreen.xaml.cs +++ b/Content.Client/UserInterface/Screens/SeparatedChatGameScreen.xaml.cs @@ -40,7 +40,6 @@ private void ResizeActionContainer() public override void SetChatSize(Vector2 size) { - ScreenContainer.DesiredSplitCenter = size.X; ScreenContainer.ResizeMode = SplitContainer.SplitResizeMode.RespectChildrenMinSize; } } diff --git a/Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRoleButtonsBox.xaml b/Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRoleButtonsBox.xaml new file mode 100644 index 0000000000..32d611e771 --- /dev/null +++ b/Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRoleButtonsBox.xaml @@ -0,0 +1,9 @@ + + + + + diff --git a/Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRolesEntry.xaml.cs b/Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRoleButtonsBox.xaml.cs similarity index 86% rename from Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRolesEntry.xaml.cs rename to Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRoleButtonsBox.xaml.cs index fc53cc72ae..7df0243416 100644 --- a/Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRolesEntry.xaml.cs +++ b/Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRoleButtonsBox.xaml.cs @@ -10,20 +10,17 @@ namespace Content.Client.UserInterface.Systems.Ghost.Controls.Roles { [GenerateTypedNameReferences] - public sealed partial class GhostRolesEntry : BoxContainer + public sealed partial class GhostRoleButtonsBox : BoxContainer { private SpriteSystem _spriteSystem; public event Action? OnRoleSelected; public event Action? OnRoleFollow; - public GhostRolesEntry(string name, string description, bool hasAccess, FormattedMessage? reason, IEnumerable roles, SpriteSystem spriteSystem) + public GhostRoleButtonsBox(bool hasAccess, FormattedMessage? reason, IEnumerable roles, SpriteSystem spriteSystem) { RobustXamlLoader.Load(this); _spriteSystem = spriteSystem; - Title.Text = name; - Description.SetMessage(description); - foreach (var role in roles) { var button = new GhostRoleEntryButtons(role); diff --git a/Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRoleEntryButtons.xaml b/Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRoleEntryButtons.xaml index ffde5d69f7..05c52deef1 100644 --- a/Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRoleEntryButtons.xaml +++ b/Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRoleEntryButtons.xaml @@ -1,15 +1,15 @@  + Orientation="Horizontal" + HorizontalAlignment="Stretch">