From cd91effefb5f0c6d59cd1de618a723b4477f14ce Mon Sep 17 00:00:00 2001 From: ShadowCommander <10494922+ShadowCommander@users.noreply.github.com> Date: Thu, 6 Feb 2025 07:14:55 -0800 Subject: [PATCH 1/2] HOTFIX: Fix lineedit focus (#34621) * Test entered tree fix * Use Opened override * Fix keyboard focus on window open for DialogWindow This affects Phone, Pray, Rename, and multiple other admin verbs. * Clean up --- Content.Client/Labels/UI/HandLabelerWindow.xaml.cs | 7 ++++++- .../UserInterface/Controls/DialogWindow.xaml.cs | 11 ++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/Content.Client/Labels/UI/HandLabelerWindow.xaml.cs b/Content.Client/Labels/UI/HandLabelerWindow.xaml.cs index 7a0627b3e2..528e227f55 100644 --- a/Content.Client/Labels/UI/HandLabelerWindow.xaml.cs +++ b/Content.Client/Labels/UI/HandLabelerWindow.xaml.cs @@ -33,8 +33,13 @@ namespace Content.Client.Labels.UI _focused = false; LabelLineEdit.Text = _label; }; + } - // Give the editor keybard focus, since that's the only + protected override void Opened() + { + base.Opened(); + + // Give the editor keyboard focus, since that's the only // thing the user will want to be doing with this UI LabelLineEdit.GrabKeyboardFocus(); } diff --git a/Content.Client/UserInterface/Controls/DialogWindow.xaml.cs b/Content.Client/UserInterface/Controls/DialogWindow.xaml.cs index 733dbe3265..d831f60247 100644 --- a/Content.Client/UserInterface/Controls/DialogWindow.xaml.cs +++ b/Content.Client/UserInterface/Controls/DialogWindow.xaml.cs @@ -87,9 +87,6 @@ public sealed partial class DialogWindow : FancyWindow Prompts.AddChild(box); } - // Grab keyboard focus for the first dialog entry - _promptLines[0].Item2.GrabKeyboardFocus(); - OkButton.OnPressed += _ => Confirm(); CancelButton.OnPressed += _ => @@ -110,6 +107,14 @@ public sealed partial class DialogWindow : FancyWindow OpenCentered(); } + protected override void Opened() + { + base.Opened(); + + // Grab keyboard focus for the first dialog entry + _promptLines[0].Item2.GrabKeyboardFocus(); + } + private void Confirm() { var results = new Dictionary(); From 11e5d59171739c11c8b1fe2271b3aceca8ff03ed Mon Sep 17 00:00:00 2001 From: slarticodefast <161409025+slarticodefast@users.noreply.github.com> Date: Thu, 6 Feb 2025 16:17:58 +0100 Subject: [PATCH 2/2] HOTFIX: fix minibomb implant and syndicats not exploding (#34923) fix minibomb implant not exploding --- Content.Server/Implants/ImplantedSystem.cs | 20 ++++++++++++------- .../Implants/Components/ImplantedComponent.cs | 1 + 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/Content.Server/Implants/ImplantedSystem.cs b/Content.Server/Implants/ImplantedSystem.cs index 16b2c79d25..c5048cbd8d 100644 --- a/Content.Server/Implants/ImplantedSystem.cs +++ b/Content.Server/Implants/ImplantedSystem.cs @@ -1,5 +1,6 @@ using Content.Server.Body.Components; using Content.Shared.Implants.Components; +using Content.Shared.Storage; using Robust.Shared.Containers; namespace Content.Server.Implants; @@ -13,21 +14,26 @@ public sealed partial class ImplanterSystem SubscribeLocalEvent(OnGibbed); } - private void OnImplantedInit(EntityUid uid, ImplantedComponent component, ComponentInit args) + private void OnImplantedInit(Entity ent, ref ComponentInit args) { - component.ImplantContainer = _container.EnsureContainer(uid, ImplanterComponent.ImplantSlotId); - component.ImplantContainer.OccludesLight = false; + ent.Comp.ImplantContainer = _container.EnsureContainer(ent.Owner, ImplanterComponent.ImplantSlotId); + ent.Comp.ImplantContainer.OccludesLight = false; } - private void OnShutdown(EntityUid uid, ImplantedComponent component, ComponentShutdown args) + private void OnShutdown(Entity ent, ref ComponentShutdown args) { //If the entity is deleted, get rid of the implants - _container.CleanContainer(component.ImplantContainer); + _container.CleanContainer(ent.Comp.ImplantContainer); } private void OnGibbed(Entity ent, ref BeingGibbedEvent args) { - //If the entity is gibbed, get rid of the implants - _container.CleanContainer(ent.Comp.ImplantContainer); + // Drop the storage implant contents before the implants are deleted by the body being gibbed + foreach (var implant in ent.Comp.ImplantContainer.ContainedEntities) + { + if (TryComp(implant, out var storage)) + _container.EmptyContainer(storage.Container, destination: Transform(ent).Coordinates); + } + } } diff --git a/Content.Shared/Implants/Components/ImplantedComponent.cs b/Content.Shared/Implants/Components/ImplantedComponent.cs index 727213907a..2744d0291b 100644 --- a/Content.Shared/Implants/Components/ImplantedComponent.cs +++ b/Content.Shared/Implants/Components/ImplantedComponent.cs @@ -10,5 +10,6 @@ namespace Content.Shared.Implants.Components; [RegisterComponent, NetworkedComponent] public sealed partial class ImplantedComponent : Component { + [ViewVariables(VVAccess.ReadOnly)] public Container ImplantContainer = default!; }