Fix window positions not saving (#35055)
Co-authored-by: Kevin Zheng <kevinz5000@gmail.com>
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
using Robust.Client.GameObjects;
|
using Robust.Client.GameObjects;
|
||||||
|
using Robust.Client.UserInterface;
|
||||||
using static Content.Shared.Atmos.Components.GasAnalyzerComponent;
|
using static Content.Shared.Atmos.Components.GasAnalyzerComponent;
|
||||||
|
|
||||||
namespace Content.Client.Atmos.UI
|
namespace Content.Client.Atmos.UI
|
||||||
@@ -16,9 +17,7 @@ namespace Content.Client.Atmos.UI
|
|||||||
{
|
{
|
||||||
base.Open();
|
base.Open();
|
||||||
|
|
||||||
_window = new GasAnalyzerWindow();
|
_window = this.CreateWindowCenteredLeft<GasAnalyzerWindow>();
|
||||||
_window.OnClose += OnClose;
|
|
||||||
_window.OpenCenteredLeft();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void ReceiveMessage(BoundUserInterfaceMessage message)
|
protected override void ReceiveMessage(BoundUserInterfaceMessage message)
|
||||||
|
|||||||
@@ -21,11 +21,10 @@ namespace Content.Client.Crayon.UI
|
|||||||
protected override void Open()
|
protected override void Open()
|
||||||
{
|
{
|
||||||
base.Open();
|
base.Open();
|
||||||
_menu = this.CreateWindow<CrayonWindow>();
|
_menu = this.CreateWindowCenteredLeft<CrayonWindow>();
|
||||||
_menu.OnColorSelected += SelectColor;
|
_menu.OnColorSelected += SelectColor;
|
||||||
_menu.OnSelected += Select;
|
_menu.OnSelected += Select;
|
||||||
PopulateCrayons();
|
PopulateCrayons();
|
||||||
_menu.OpenCenteredLeft();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void PopulateCrayons()
|
private void PopulateCrayons()
|
||||||
|
|||||||
@@ -21,14 +21,12 @@ public sealed class HumanoidMarkingModifierBoundUserInterface : BoundUserInterfa
|
|||||||
{
|
{
|
||||||
base.Open();
|
base.Open();
|
||||||
|
|
||||||
_window = this.CreateWindow<HumanoidMarkingModifierWindow>();
|
_window = this.CreateWindowCenteredLeft<HumanoidMarkingModifierWindow>();
|
||||||
_window.OnMarkingAdded += SendMarkingSet;
|
_window.OnMarkingAdded += SendMarkingSet;
|
||||||
_window.OnMarkingRemoved += SendMarkingSet;
|
_window.OnMarkingRemoved += SendMarkingSet;
|
||||||
_window.OnMarkingColorChange += SendMarkingSetNoResend;
|
_window.OnMarkingColorChange += SendMarkingSetNoResend;
|
||||||
_window.OnMarkingRankChange += SendMarkingSet;
|
_window.OnMarkingRankChange += SendMarkingSet;
|
||||||
_window.OnLayerInfoModified += SendBaseLayer;
|
_window.OnLayerInfoModified += SendBaseLayer;
|
||||||
|
|
||||||
_window.OpenCenteredLeft();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void UpdateState(BoundUserInterfaceState state)
|
protected override void UpdateState(BoundUserInterfaceState state)
|
||||||
|
|||||||
@@ -64,11 +64,9 @@ namespace Content.Client.Inventory
|
|||||||
{
|
{
|
||||||
base.Open();
|
base.Open();
|
||||||
|
|
||||||
_strippingMenu = this.CreateWindow<StrippingMenu>();
|
_strippingMenu = this.CreateWindowCenteredLeft<StrippingMenu>();
|
||||||
_strippingMenu.OnDirty += UpdateMenu;
|
_strippingMenu.OnDirty += UpdateMenu;
|
||||||
_strippingMenu.Title = Loc.GetString("strippable-bound-user-interface-stripping-menu-title", ("ownerName", Identity.Name(Owner, EntMan)));
|
_strippingMenu.Title = Loc.GetString("strippable-bound-user-interface-stripping-menu-title", ("ownerName", Identity.Name(Owner, EntMan)));
|
||||||
|
|
||||||
_strippingMenu?.OpenCenteredLeft();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Dispose(bool disposing)
|
protected override void Dispose(bool disposing)
|
||||||
|
|||||||
@@ -18,9 +18,8 @@ namespace Content.Client.Lathe.UI
|
|||||||
{
|
{
|
||||||
base.Open();
|
base.Open();
|
||||||
|
|
||||||
_menu = this.CreateWindow<LatheMenu>();
|
_menu = this.CreateWindowCenteredRight<LatheMenu>();
|
||||||
_menu.SetEntity(Owner);
|
_menu.SetEntity(Owner);
|
||||||
_menu.OpenCenteredRight();
|
|
||||||
|
|
||||||
_menu.OnServerListButtonPressed += _ =>
|
_menu.OnServerListButtonPressed += _ =>
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -21,9 +21,8 @@ public sealed class MechBoundUserInterface : BoundUserInterface
|
|||||||
{
|
{
|
||||||
base.Open();
|
base.Open();
|
||||||
|
|
||||||
_menu = this.CreateWindow<MechMenu>();
|
_menu = this.CreateWindowCenteredLeft<MechMenu>();
|
||||||
_menu.SetEntity(Owner);
|
_menu.SetEntity(Owner);
|
||||||
_menu.OpenCenteredLeft();
|
|
||||||
|
|
||||||
_menu.OnRemoveButtonPressed += uid =>
|
_menu.OnRemoveButtonPressed += uid =>
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ public sealed class PortableGeneratorBoundUserInterface : BoundUserInterface
|
|||||||
protected override void Open()
|
protected override void Open()
|
||||||
{
|
{
|
||||||
base.Open();
|
base.Open();
|
||||||
_window = this.CreateWindow<GeneratorWindow>();
|
_window = this.CreateWindowCenteredLeft<GeneratorWindow>();
|
||||||
_window.SetEntity(Owner);
|
_window.SetEntity(Owner);
|
||||||
_window.OnState += args =>
|
_window.OnState += args =>
|
||||||
{
|
{
|
||||||
@@ -34,8 +34,6 @@ public sealed class PortableGeneratorBoundUserInterface : BoundUserInterface
|
|||||||
_window.OnPower += SetTargetPower;
|
_window.OnPower += SetTargetPower;
|
||||||
_window.OnEjectFuel += EjectFuel;
|
_window.OnEjectFuel += EjectFuel;
|
||||||
_window.OnSwitchOutput += SwitchOutput;
|
_window.OnSwitchOutput += SwitchOutput;
|
||||||
|
|
||||||
_window.OpenCenteredLeft();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void UpdateState(BoundUserInterfaceState state)
|
protected override void UpdateState(BoundUserInterfaceState state)
|
||||||
|
|||||||
@@ -30,9 +30,8 @@ public sealed class SalvageExpeditionConsoleBoundUserInterface : BoundUserInterf
|
|||||||
protected override void Open()
|
protected override void Open()
|
||||||
{
|
{
|
||||||
base.Open();
|
base.Open();
|
||||||
_window = this.CreateWindow<OfferingWindow>();
|
_window = this.CreateWindowCenteredLeft<OfferingWindow>();
|
||||||
_window.Title = Loc.GetString("salvage-expedition-window-title");
|
_window.Title = Loc.GetString("salvage-expedition-window-title");
|
||||||
_window.OpenCenteredLeft();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void UpdateState(BoundUserInterfaceState state)
|
protected override void UpdateState(BoundUserInterfaceState state)
|
||||||
|
|||||||
@@ -22,9 +22,8 @@ public sealed class SalvageMagnetBoundUserInterface : BoundUserInterface
|
|||||||
{
|
{
|
||||||
base.Open();
|
base.Open();
|
||||||
|
|
||||||
_window = this.CreateWindow<OfferingWindow>();
|
_window = this.CreateWindowCenteredLeft<OfferingWindow>();
|
||||||
_window.Title = Loc.GetString("salvage-magnet-window-title");
|
_window.Title = Loc.GetString("salvage-magnet-window-title");
|
||||||
_window.OpenCenteredLeft();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void UpdateState(BoundUserInterfaceState state)
|
protected override void UpdateState(BoundUserInterfaceState state)
|
||||||
|
|||||||
@@ -21,10 +21,9 @@ public sealed class IFFConsoleBoundUserInterface : BoundUserInterface
|
|||||||
{
|
{
|
||||||
base.Open();
|
base.Open();
|
||||||
|
|
||||||
_window = this.CreateWindow<IFFConsoleWindow>();
|
_window = this.CreateWindowCenteredLeft<IFFConsoleWindow>();
|
||||||
_window.ShowIFF += SendIFFMessage;
|
_window.ShowIFF += SendIFFMessage;
|
||||||
_window.ShowVessel += SendVesselMessage;
|
_window.ShowVessel += SendVesselMessage;
|
||||||
_window.OpenCenteredLeft();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void UpdateState(BoundUserInterfaceState state)
|
protected override void UpdateState(BoundUserInterfaceState state)
|
||||||
|
|||||||
@@ -23,8 +23,7 @@ namespace Content.Client.VendingMachines
|
|||||||
{
|
{
|
||||||
base.Open();
|
base.Open();
|
||||||
|
|
||||||
_menu = this.CreateWindow<VendingMachineMenu>();
|
_menu = this.CreateWindowCenteredLeft<VendingMachineMenu>();
|
||||||
_menu.OpenCenteredLeft();
|
|
||||||
_menu.Title = EntMan.GetComponent<MetaDataComponent>(Owner).EntityName;
|
_menu.Title = EntMan.GetComponent<MetaDataComponent>(Owner).EntityName;
|
||||||
_menu.OnItemSelected += OnItemSelected;
|
_menu.OnItemSelected += OnItemSelected;
|
||||||
Refresh();
|
Refresh();
|
||||||
|
|||||||
Reference in New Issue
Block a user