using System; using System.Collections.Generic; using System.Linq; using Content.Client.GameObjects.Components.Construction; using Content.Shared.Construction; using SS14.Client.GameObjects; using SS14.Client.Graphics; using SS14.Client.Interfaces.GameObjects; using SS14.Client.Interfaces.Graphics; using SS14.Client.Interfaces.Placement; using SS14.Client.Interfaces.ResourceManagement; using SS14.Client.Placement; using SS14.Client.ResourceManagement; using SS14.Client.UserInterface; using SS14.Client.UserInterface.Controls; using SS14.Client.UserInterface.CustomControls; using SS14.Client.Utility; using SS14.Shared.Enums; using SS14.Shared.Interfaces.GameObjects.Components; using SS14.Shared.IoC; using SS14.Shared.Log; using SS14.Shared.Maths; using SS14.Shared.Prototypes; using SS14.Shared.Utility; namespace Content.Client.Construction { public class ConstructionMenu : SS14Window { protected override ResourcePath ScenePath => new ResourcePath("/Scenes/Construction/ConstructionMenu.tscn"); #pragma warning disable CS0649 [Dependency] readonly IPrototypeManager PrototypeManager; [Dependency] readonly IResourceCache ResourceCache; #pragma warning restore public ConstructorComponent Owner { get; set; } Button BuildButton; Button EraseButton; LineEdit SearchBar; Tree RecipeList; TextureRect InfoIcon; Label InfoLabel; ItemList StepList; CategoryNode RootCategory; // This list is flattened in such a way that the top most deepest category is first. List FlattenedCategories; PlacementManager Placement; public ConstructionMenu(IDisplayManager displayMan) : base(displayMan) { } protected override void Initialize() { base.Initialize(); IoCManager.InjectDependencies(this); Placement = (PlacementManager)IoCManager.Resolve(); Placement.PlacementCanceled += OnPlacementCanceled; 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