Move GUI size init into constructor
Setting the initial size in `Initialize` has no effect on the windows size so it's set in the constructor instead.
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
using Content.Client.GameObjects.Components.Construction;
|
using Content.Client.GameObjects.Components.Construction;
|
||||||
using Robust.Client.Interfaces.Graphics;
|
using Robust.Client.Interfaces.Graphics;
|
||||||
using Robust.Client.UserInterface.Controls;
|
using Robust.Client.UserInterface.Controls;
|
||||||
using Robust.Shared.Maths;
|
using Robust.Shared.Maths;
|
||||||
@@ -41,10 +41,7 @@ namespace Content.Client.Construction
|
|||||||
|
|
||||||
private void PerformLayout()
|
private void PerformLayout()
|
||||||
{
|
{
|
||||||
Menu = new ConstructionMenu(_displayManager)
|
Menu = new ConstructionMenu(_displayManager);
|
||||||
{
|
|
||||||
Size = new Vector2(500.0f, 350.0f)
|
|
||||||
};
|
|
||||||
Menu.AddToScreen();
|
Menu.AddToScreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -48,7 +48,11 @@ namespace Content.Client.Construction
|
|||||||
// This list is flattened in such a way that the top most deepest category is first.
|
// This list is flattened in such a way that the top most deepest category is first.
|
||||||
List<CategoryNode> FlattenedCategories;
|
List<CategoryNode> FlattenedCategories;
|
||||||
PlacementManager Placement;
|
PlacementManager Placement;
|
||||||
public ConstructionMenu(IDisplayManager displayMan) : base(displayMan) { }
|
|
||||||
|
public ConstructionMenu(IDisplayManager displayMan) : base(displayMan)
|
||||||
|
{
|
||||||
|
Size = new Vector2(500.0f, 350.0f);
|
||||||
|
}
|
||||||
|
|
||||||
protected override void Initialize()
|
protected override void Initialize()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ namespace Content.Client.GameObjects.Components.Storage
|
|||||||
base.OnAdd();
|
base.OnAdd();
|
||||||
|
|
||||||
Window = new StorageWindow(IoCManager.Resolve<IDisplayManager>())
|
Window = new StorageWindow(IoCManager.Resolve<IDisplayManager>())
|
||||||
{ StorageEntity = this, Size = new Vector2(180.0f, 320.0f)};
|
{ StorageEntity = this};
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void OnRemove()
|
public override void OnRemove()
|
||||||
@@ -109,7 +109,10 @@ namespace Content.Client.GameObjects.Components.Storage
|
|||||||
private Label Information;
|
private Label Information;
|
||||||
public ClientStorageComponent StorageEntity;
|
public ClientStorageComponent StorageEntity;
|
||||||
|
|
||||||
public StorageWindow(IDisplayManager displayMan) : base(displayMan) { }
|
public StorageWindow(IDisplayManager displayMan) : base(displayMan)
|
||||||
|
{
|
||||||
|
Size = new Vector2(180.0f, 320.0f);
|
||||||
|
}
|
||||||
|
|
||||||
protected override void Initialize()
|
protected override void Initialize()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user