Fix window positions not saving (#35055)

Co-authored-by: Kevin Zheng <kevinz5000@gmail.com>
This commit is contained in:
metalgearsloth
2025-02-23 23:57:57 +11:00
committed by GitHub
parent fabfdd0673
commit 634c4a7780
11 changed files with 12 additions and 26 deletions

View File

@@ -1,4 +1,5 @@
using Robust.Client.GameObjects;
using Robust.Client.UserInterface;
using static Content.Shared.Atmos.Components.GasAnalyzerComponent;
namespace Content.Client.Atmos.UI
@@ -16,9 +17,7 @@ namespace Content.Client.Atmos.UI
{
base.Open();
_window = new GasAnalyzerWindow();
_window.OnClose += OnClose;
_window.OpenCenteredLeft();
_window = this.CreateWindowCenteredLeft<GasAnalyzerWindow>();
}
protected override void ReceiveMessage(BoundUserInterfaceMessage message)

View File

@@ -21,11 +21,10 @@ namespace Content.Client.Crayon.UI
protected override void Open()
{
base.Open();
_menu = this.CreateWindow<CrayonWindow>();
_menu = this.CreateWindowCenteredLeft<CrayonWindow>();
_menu.OnColorSelected += SelectColor;
_menu.OnSelected += Select;
PopulateCrayons();
_menu.OpenCenteredLeft();
}
private void PopulateCrayons()

View File

@@ -21,14 +21,12 @@ public sealed class HumanoidMarkingModifierBoundUserInterface : BoundUserInterfa
{
base.Open();
_window = this.CreateWindow<HumanoidMarkingModifierWindow>();
_window = this.CreateWindowCenteredLeft<HumanoidMarkingModifierWindow>();
_window.OnMarkingAdded += SendMarkingSet;
_window.OnMarkingRemoved += SendMarkingSet;
_window.OnMarkingColorChange += SendMarkingSetNoResend;
_window.OnMarkingRankChange += SendMarkingSet;
_window.OnLayerInfoModified += SendBaseLayer;
_window.OpenCenteredLeft();
}
protected override void UpdateState(BoundUserInterfaceState state)

View File

@@ -64,11 +64,9 @@ namespace Content.Client.Inventory
{
base.Open();
_strippingMenu = this.CreateWindow<StrippingMenu>();
_strippingMenu = this.CreateWindowCenteredLeft<StrippingMenu>();
_strippingMenu.OnDirty += UpdateMenu;
_strippingMenu.Title = Loc.GetString("strippable-bound-user-interface-stripping-menu-title", ("ownerName", Identity.Name(Owner, EntMan)));
_strippingMenu?.OpenCenteredLeft();
}
protected override void Dispose(bool disposing)

View File

@@ -18,9 +18,8 @@ namespace Content.Client.Lathe.UI
{
base.Open();
_menu = this.CreateWindow<LatheMenu>();
_menu = this.CreateWindowCenteredRight<LatheMenu>();
_menu.SetEntity(Owner);
_menu.OpenCenteredRight();
_menu.OnServerListButtonPressed += _ =>
{

View File

@@ -21,9 +21,8 @@ public sealed class MechBoundUserInterface : BoundUserInterface
{
base.Open();
_menu = this.CreateWindow<MechMenu>();
_menu = this.CreateWindowCenteredLeft<MechMenu>();
_menu.SetEntity(Owner);
_menu.OpenCenteredLeft();
_menu.OnRemoveButtonPressed += uid =>
{

View File

@@ -17,7 +17,7 @@ public sealed class PortableGeneratorBoundUserInterface : BoundUserInterface
protected override void Open()
{
base.Open();
_window = this.CreateWindow<GeneratorWindow>();
_window = this.CreateWindowCenteredLeft<GeneratorWindow>();
_window.SetEntity(Owner);
_window.OnState += args =>
{
@@ -34,8 +34,6 @@ public sealed class PortableGeneratorBoundUserInterface : BoundUserInterface
_window.OnPower += SetTargetPower;
_window.OnEjectFuel += EjectFuel;
_window.OnSwitchOutput += SwitchOutput;
_window.OpenCenteredLeft();
}
protected override void UpdateState(BoundUserInterfaceState state)

View File

@@ -30,9 +30,8 @@ public sealed class SalvageExpeditionConsoleBoundUserInterface : BoundUserInterf
protected override void Open()
{
base.Open();
_window = this.CreateWindow<OfferingWindow>();
_window = this.CreateWindowCenteredLeft<OfferingWindow>();
_window.Title = Loc.GetString("salvage-expedition-window-title");
_window.OpenCenteredLeft();
}
protected override void UpdateState(BoundUserInterfaceState state)

View File

@@ -22,9 +22,8 @@ public sealed class SalvageMagnetBoundUserInterface : BoundUserInterface
{
base.Open();
_window = this.CreateWindow<OfferingWindow>();
_window = this.CreateWindowCenteredLeft<OfferingWindow>();
_window.Title = Loc.GetString("salvage-magnet-window-title");
_window.OpenCenteredLeft();
}
protected override void UpdateState(BoundUserInterfaceState state)

View File

@@ -21,10 +21,9 @@ public sealed class IFFConsoleBoundUserInterface : BoundUserInterface
{
base.Open();
_window = this.CreateWindow<IFFConsoleWindow>();
_window = this.CreateWindowCenteredLeft<IFFConsoleWindow>();
_window.ShowIFF += SendIFFMessage;
_window.ShowVessel += SendVesselMessage;
_window.OpenCenteredLeft();
}
protected override void UpdateState(BoundUserInterfaceState state)

View File

@@ -23,8 +23,7 @@ namespace Content.Client.VendingMachines
{
base.Open();
_menu = this.CreateWindow<VendingMachineMenu>();
_menu.OpenCenteredLeft();
_menu = this.CreateWindowCenteredLeft<VendingMachineMenu>();
_menu.Title = EntMan.GetComponent<MetaDataComponent>(Owner).EntityName;
_menu.OnItemSelected += OnItemSelected;
Refresh();