Fixes Breaking Change with UI windows. (#192)
* Custom UI window constructors were changed. * Update Submodule.
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
@@ -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<CategoryNode> FlattenedCategories;
|
||||
PlacementManager Placement;
|
||||
public ConstructionMenu(IDisplayManager displayMan) : base(displayMan) { }
|
||||
|
||||
protected override void Initialize()
|
||||
{
|
||||
|
||||
@@ -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<ICharacterUI> windowcomponents)
|
||||
public CharacterWindow(IEnumerable<ICharacterUI> windowcomponents) : base(IoCManager.Resolve<IDisplayManager>())
|
||||
{
|
||||
//TODO: sort window components by priority of window component
|
||||
foreach(var element in windowcomponents.OrderByDescending(x => x.Priority))
|
||||
|
||||
@@ -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<IDisplayManager>());
|
||||
Button.Owner = this;
|
||||
}
|
||||
Button.AddToScreen();
|
||||
|
||||
@@ -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<IDisplayManager>());
|
||||
_window.OnClose += Close;
|
||||
_breakerButton = _window.Contents.GetChild<BaseButton>("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) { }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<IDisplayManager>())
|
||||
{
|
||||
Title = "Power Debug Tool",
|
||||
};
|
||||
|
||||
@@ -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<IDisplayManager>())
|
||||
{ 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();
|
||||
|
||||
Submodule RobustToolbox updated: 4b663fd508...613ad10f29
Reference in New Issue
Block a user