From ddcdeca4eabf4adef0e5bdb19a762215913d0ae6 Mon Sep 17 00:00:00 2001 From: moneyl <8206401+Moneyl@users.noreply.github.com> Date: Wed, 15 May 2019 17:37:44 -0400 Subject: [PATCH] Removed construction menu dependence on tscn file One minor issue remains with this that I can't resolve. The construction window starts off much larger than the tscn dependent version on master. It can be shrunk manually and it'll look the same, but it'd be nice to keep it as it was. Tried manually changing the window size and changing the size flags but couldn't get it to work as I wanted. --- .../Construction/ConstructionButton.cs | 10 +- .../Construction/ConstructionMenu.cs | 73 ++++- .../Construction/ConstructionButton.tscn | 26 -- .../Scenes/Construction/ConstructionMenu.tscn | 270 ------------------ 4 files changed, 67 insertions(+), 312 deletions(-) delete mode 100644 Resources/Scenes/Construction/ConstructionButton.tscn delete mode 100644 Resources/Scenes/Construction/ConstructionMenu.tscn diff --git a/Content.Client/Construction/ConstructionButton.cs b/Content.Client/Construction/ConstructionButton.cs index 14a8464f14..5bab5217ef 100644 --- a/Content.Client/Construction/ConstructionButton.cs +++ b/Content.Client/Construction/ConstructionButton.cs @@ -8,7 +8,6 @@ namespace Content.Client.Construction public class ConstructionButton : Button { private readonly IDisplayManager _displayManager; - protected override ResourcePath ScenePath => new ResourcePath("/Scenes/Construction/ConstructionButton.tscn"); public ConstructorComponent Owner { @@ -27,6 +26,15 @@ namespace Content.Client.Construction { base.Initialize(); + AnchorLeft = 1.0f; + AnchorTop = 1.0f; + AnchorRight = 1.0f; + AnchorBottom = 1.0f; + MarginLeft = -110.0f; + MarginTop = -70.0f; + MarginRight = -50.0f; + MarginBottom = -50.0f; + Text = "Crafting"; OnPressed += IWasPressed; } diff --git a/Content.Client/Construction/ConstructionMenu.cs b/Content.Client/Construction/ConstructionMenu.cs index 9ac87ace82..2551cf4a3f 100644 --- a/Content.Client/Construction/ConstructionMenu.cs +++ b/Content.Client/Construction/ConstructionMenu.cs @@ -27,7 +27,6 @@ namespace Content.Client.Construction { public class ConstructionMenu : SS14Window { - protected override ResourcePath ScenePath => new ResourcePath("/Scenes/Construction/ConstructionMenu.tscn"); #pragma warning disable CS0649 [Dependency] @@ -61,22 +60,66 @@ namespace Content.Client.Construction HideOnClose = true; Title = "Construction"; Visible = false; - var split = Contents.GetChild("HSplitContainer"); - var rightSide = split.GetChild("Guide"); - var info = rightSide.GetChild("Info"); - InfoIcon = info.GetChild("TextureRect"); - InfoLabel = info.GetChild