diff --git a/Content.Client/Construction/ConstructionButton.cs b/Content.Client/Construction/ConstructionButton.cs index 4b064aa1bb..dbc5444c62 100644 --- a/Content.Client/Construction/ConstructionButton.cs +++ b/Content.Client/Construction/ConstructionButton.cs @@ -1,5 +1,5 @@ -using Content.Client.GameObjects.Components.Construction; -using SS14.Client.UserInterface; +using Content.Client.GameObjects.Components.Construction; +using SS14.Client.Interfaces.Graphics; using SS14.Client.UserInterface.Controls; using SS14.Shared.Utility; @@ -7,6 +7,7 @@ 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 @@ -16,12 +17,22 @@ namespace Content.Client.Construction } ConstructionMenu Menu; + public ConstructionButton(IDisplayManager displayManager) + { + _displayManager = displayManager; + PerformLayout(); + } + protected override void Initialize() { base.Initialize(); OnPressed += IWasPressed; - Menu = new ConstructionMenu(); + } + + private void PerformLayout() + { + Menu = new ConstructionMenu(_displayManager); Menu.AddToScreen(); } diff --git a/Content.Client/Construction/ConstructionMenu.cs b/Content.Client/Construction/ConstructionMenu.cs index de1dac0db8..993d90fefa 100644 --- a/Content.Client/Construction/ConstructionMenu.cs +++ b/Content.Client/Construction/ConstructionMenu.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using Content.Client.GameObjects.Components.Construction; @@ -6,6 +6,7 @@ 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; @@ -48,6 +49,7 @@ namespace Content.Client.Construction // 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() { diff --git a/Content.Client/GameObjects/Components/Actor/CharacterInterface.cs b/Content.Client/GameObjects/Components/Actor/CharacterInterface.cs index 90c3303c5a..338408363b 100644 --- a/Content.Client/GameObjects/Components/Actor/CharacterInterface.cs +++ b/Content.Client/GameObjects/Components/Actor/CharacterInterface.cs @@ -8,6 +8,7 @@ using SS14.Shared.IoC; using SS14.Shared.Utility; using System.Collections.Generic; using System.Linq; +using SS14.Client.Interfaces.Graphics; namespace Content.Client.GameObjects.Components.Actor { @@ -82,7 +83,7 @@ namespace Content.Client.GameObjects.Components.Actor { protected override ResourcePath ScenePath => new ResourcePath("/Scenes/Mobs/CharacterWindow.tscn"); - public CharacterWindow(IEnumerable windowcomponents) + public CharacterWindow(IEnumerable windowcomponents) : base(IoCManager.Resolve()) { //TODO: sort window components by priority of window component foreach(var element in windowcomponents.OrderByDescending(x => x.Priority)) diff --git a/Content.Client/GameObjects/Components/Construction/ConstructorComponent.cs b/Content.Client/GameObjects/Components/Construction/ConstructorComponent.cs index e917a359fc..0f9484c326 100644 --- a/Content.Client/GameObjects/Components/Construction/ConstructorComponent.cs +++ b/Content.Client/GameObjects/Components/Construction/ConstructorComponent.cs @@ -4,6 +4,7 @@ using Content.Shared.Construction; using Content.Shared.GameObjects.Components.Construction; using SS14.Client.GameObjects; using SS14.Client.Interfaces.GameObjects; +using SS14.Client.Interfaces.Graphics; using SS14.Shared.GameObjects; using SS14.Shared.Interfaces.GameObjects; using SS14.Shared.Interfaces.GameObjects.Components; @@ -39,7 +40,7 @@ namespace Content.Client.GameObjects.Components.Construction case PlayerAttachedMsg _: if (Button == null) { - Button = new ConstructionButton(); + Button = new ConstructionButton(IoCManager.Resolve()); Button.Owner = this; } Button.AddToScreen(); diff --git a/Content.Client/GameObjects/Components/Power/ApcBoundUserInterface.cs b/Content.Client/GameObjects/Components/Power/ApcBoundUserInterface.cs index 9307b50b26..7253d5de5b 100644 --- a/Content.Client/GameObjects/Components/Power/ApcBoundUserInterface.cs +++ b/Content.Client/GameObjects/Components/Power/ApcBoundUserInterface.cs @@ -1,9 +1,11 @@ -using System; +using System; using Content.Shared.GameObjects.Components.Power; using SS14.Client.GameObjects.Components.UserInterface; +using SS14.Client.Interfaces.Graphics; using SS14.Client.UserInterface.Controls; using SS14.Client.UserInterface.CustomControls; using SS14.Shared.GameObjects.Components.UserInterface; +using SS14.Shared.IoC; using SS14.Shared.Utility; namespace Content.Client.GameObjects.Components.Power @@ -19,7 +21,7 @@ namespace Content.Client.GameObjects.Components.Power { base.Open(); - _window = new ApcWindow(); + _window = new ApcWindow(IoCManager.Resolve()); _window.OnClose += Close; _breakerButton = _window.Contents.GetChild("Rows/Breaker/Breaker"); _breakerButton.OnPressed += _ => SendMessage(new ApcToggleMainBreakerMessage()); @@ -70,6 +72,8 @@ namespace Content.Client.GameObjects.Components.Power private class ApcWindow : SS14Window { protected override ResourcePath ScenePath => new ResourcePath("/Scenes/Power/Apc.tscn"); + + public ApcWindow(IDisplayManager displayMan) : base(displayMan) { } } } } diff --git a/Content.Client/GameObjects/Components/Power/PowerDebugTool.cs b/Content.Client/GameObjects/Components/Power/PowerDebugTool.cs index 6ecbb050e5..9c6962892a 100644 --- a/Content.Client/GameObjects/Components/Power/PowerDebugTool.cs +++ b/Content.Client/GameObjects/Components/Power/PowerDebugTool.cs @@ -1,10 +1,11 @@ -using Content.Shared.GameObjects; -using Content.Shared.GameObjects.Components.Power; +using Content.Shared.GameObjects.Components.Power; +using SS14.Client.Interfaces.Graphics; using SS14.Client.UserInterface.Controls; using SS14.Client.UserInterface.CustomControls; using SS14.Shared.GameObjects; using SS14.Shared.Interfaces.GameObjects; using SS14.Shared.Interfaces.Network; +using SS14.Shared.IoC; namespace Content.Client.GameObjects.Components.Power { @@ -22,7 +23,7 @@ namespace Content.Client.GameObjects.Components.Power { LastWindow.Dispose(); } - LastWindow = new SS14Window + LastWindow = new SS14Window(IoCManager.Resolve()) { Title = "Power Debug Tool", }; diff --git a/Content.Client/GameObjects/Components/Storage/ClientStorageComponent.cs b/Content.Client/GameObjects/Components/Storage/ClientStorageComponent.cs index 5ca8539377..e0317257ed 100644 --- a/Content.Client/GameObjects/Components/Storage/ClientStorageComponent.cs +++ b/Content.Client/GameObjects/Components/Storage/ClientStorageComponent.cs @@ -14,6 +14,7 @@ using SS14.Shared.Maths; using SS14.Shared.Utility; using System; using System.Collections.Generic; +using SS14.Client.Interfaces.Graphics; namespace Content.Client.GameObjects.Components.Storage { @@ -41,7 +42,7 @@ namespace Content.Client.GameObjects.Components.Storage { base.OnAdd(); - Window = new StorageWindow() + Window = new StorageWindow(IoCManager.Resolve()) { StorageEntity = this }; } @@ -148,6 +149,8 @@ namespace Content.Client.GameObjects.Components.Storage protected override ResourcePath ScenePath => new ResourcePath("/Scenes/Storage/Storage.tscn"); + public StorageWindow(IDisplayManager displayMan) : base(displayMan) { } + protected override void Initialize() { base.Initialize(); diff --git a/RobustToolbox b/RobustToolbox index 4b663fd508..613ad10f29 160000 --- a/RobustToolbox +++ b/RobustToolbox @@ -1 +1 @@ -Subproject commit 4b663fd508bed17d5af78e4274ed93740d139561 +Subproject commit 613ad10f29a57ebc9d41f1570088383eb55c8d6a