Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge stable into master #34924

Merged
merged 2 commits into from
Feb 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion Content.Client/Labels/UI/HandLabelerWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,13 @@ public HandLabelerWindow()
_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();
}
Expand Down
11 changes: 8 additions & 3 deletions Content.Client/UserInterface/Controls/DialogWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,6 @@ public DialogWindow(string title, List<QuickDialogEntry> entries, bool ok = true
Prompts.AddChild(box);
}

// Grab keyboard focus for the first dialog entry
_promptLines[0].Item2.GrabKeyboardFocus();

OkButton.OnPressed += _ => Confirm();

CancelButton.OnPressed += _ =>
Expand All @@ -110,6 +107,14 @@ public DialogWindow(string title, List<QuickDialogEntry> entries, bool ok = true
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<string, string>();
Expand Down
20 changes: 13 additions & 7 deletions Content.Server/Implants/ImplantedSystem.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -13,21 +14,26 @@ public void InitializeImplanted()
SubscribeLocalEvent<ImplantedComponent, BeingGibbedEvent>(OnGibbed);
}

private void OnImplantedInit(EntityUid uid, ImplantedComponent component, ComponentInit args)
private void OnImplantedInit(Entity<ImplantedComponent> ent, ref ComponentInit args)
{
component.ImplantContainer = _container.EnsureContainer<Container>(uid, ImplanterComponent.ImplantSlotId);
component.ImplantContainer.OccludesLight = false;
ent.Comp.ImplantContainer = _container.EnsureContainer<Container>(ent.Owner, ImplanterComponent.ImplantSlotId);
ent.Comp.ImplantContainer.OccludesLight = false;
}

private void OnShutdown(EntityUid uid, ImplantedComponent component, ComponentShutdown args)
private void OnShutdown(Entity<ImplantedComponent> 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<ImplantedComponent> 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<StorageComponent>(implant, out var storage))
_container.EmptyContainer(storage.Container, destination: Transform(ent).Coordinates);
}

}
}
1 change: 1 addition & 0 deletions Content.Shared/Implants/Components/ImplantedComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ namespace Content.Shared.Implants.Components;
[RegisterComponent, NetworkedComponent]
public sealed partial class ImplantedComponent : Component
{
[ViewVariables(VVAccess.ReadOnly)]
public Container ImplantContainer = default!;
}
Loading