Fix compiler warnings and remove dead code.

This commit is contained in:
Pieter-Jan Briers
2019-05-28 00:30:34 +02:00
parent 996b45a04f
commit 9c3587b00e
12 changed files with 15 additions and 37 deletions

View File

@@ -8,8 +8,6 @@ namespace Content.Client.Construction
{ {
public class ConstructionButton : Button public class ConstructionButton : Button
{ {
private readonly IDisplayManager _displayManager;
public ConstructorComponent Owner public ConstructorComponent Owner
{ {
get => Menu.Owner; get => Menu.Owner;
@@ -17,9 +15,8 @@ namespace Content.Client.Construction
} }
ConstructionMenu Menu; ConstructionMenu Menu;
public ConstructionButton(IDisplayManager displayManager) public ConstructionButton()
{ {
_displayManager = displayManager;
PerformLayout(); PerformLayout();
} }
@@ -38,7 +35,7 @@ namespace Content.Client.Construction
private void PerformLayout() private void PerformLayout()
{ {
Menu = new ConstructionMenu(_displayManager); Menu = new ConstructionMenu();
Menu.AddToScreen(); Menu.AddToScreen();
} }

View File

@@ -49,7 +49,7 @@ namespace Content.Client.Construction
List<CategoryNode> FlattenedCategories; List<CategoryNode> FlattenedCategories;
PlacementManager Placement; PlacementManager Placement;
public ConstructionMenu(IDisplayManager displayMan) : base(displayMan) public ConstructionMenu()
{ {
Size = new Vector2(500.0f, 350.0f); Size = new Vector2(500.0f, 350.0f);
} }

View File

@@ -82,7 +82,7 @@ namespace Content.Client.GameObjects.Components.Actor
{ {
private readonly VBoxContainer _contentsVBox; private readonly VBoxContainer _contentsVBox;
public CharacterWindow(IEnumerable<ICharacterUI> windowComponents) : base(IoCManager.Resolve<IDisplayManager>()) public CharacterWindow(IEnumerable<ICharacterUI> windowComponents)
{ {
Title = "Character"; Title = "Character";
HideOnClose = true; HideOnClose = true;

View File

@@ -40,8 +40,7 @@ namespace Content.Client.GameObjects.Components.Construction
case PlayerAttachedMsg _: case PlayerAttachedMsg _:
if (Button == null) if (Button == null)
{ {
Button = new ConstructionButton(IoCManager.Resolve<IDisplayManager>()); Button = new ConstructionButton {Owner = this};
Button.Owner = this;
} }
Button.AddToScreen(); Button.AddToScreen();
break; break;

View File

@@ -26,7 +26,7 @@ namespace Content.Client.GameObjects.Components.Power
{ {
base.Open(); base.Open();
_window = new ApcWindow(IoCManager.Resolve<IDisplayManager>()) _window = new ApcWindow()
{ {
MarginRight = 426.0f, MarginBottom = 270.0f MarginRight = 426.0f, MarginBottom = 270.0f
}; };
@@ -124,7 +124,7 @@ namespace Content.Client.GameObjects.Components.Power
public Label ExternalPowerStateLabel { get; set; } public Label ExternalPowerStateLabel { get; set; }
public ProgressBar ChargeBar { get; set; } public ProgressBar ChargeBar { get; set; }
public ApcWindow(IDisplayManager displayMan) : base(displayMan) public ApcWindow()
{ {
Title = "APC"; Title = "APC";
var rows = new VBoxContainer("Rows"); var rows = new VBoxContainer("Rows");

View File

@@ -23,7 +23,7 @@ namespace Content.Client.GameObjects.Components.Power
{ {
LastWindow.Dispose(); LastWindow.Dispose();
} }
LastWindow = new SS14Window(IoCManager.Resolve<IDisplayManager>()) LastWindow = new SS14Window()
{ {
Title = "Power Debug Tool", Title = "Power Debug Tool",
}; };

View File

@@ -3,7 +3,6 @@ using Content.Client.Research;
using Content.Shared.GameObjects.Components.Research; using Content.Shared.GameObjects.Components.Research;
using Content.Shared.Research; using Content.Shared.Research;
using Robust.Client.GameObjects.Components.UserInterface; using Robust.Client.GameObjects.Components.UserInterface;
using Robust.Client.Interfaces.Graphics;
using Robust.Shared.GameObjects.Components.UserInterface; using Robust.Shared.GameObjects.Components.UserInterface;
using Robust.Shared.IoC; using Robust.Shared.IoC;
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;
@@ -14,8 +13,6 @@ namespace Content.Client.GameObjects.Components.Research
public class LatheBoundUserInterface : BoundUserInterface public class LatheBoundUserInterface : BoundUserInterface
{ {
#pragma warning disable CS0649 #pragma warning disable CS0649
[Dependency]
private IDisplayManager _displayManager;
[Dependency] [Dependency]
private IPrototypeManager _prototypeManager; private IPrototypeManager _prototypeManager;
#pragma warning restore #pragma warning restore
@@ -50,8 +47,8 @@ namespace Content.Client.GameObjects.Components.Research
Lathe = lathe; Lathe = lathe;
Database = database; Database = database;
menu = new LatheMenu(_displayManager) {Owner = this}; menu = new LatheMenu {Owner = this};
queueMenu = new LatheQueueMenu(_displayManager) { Owner = this }; queueMenu = new LatheQueueMenu { Owner = this };
menu.OnClose += Close; menu.OnClose += Close;

View File

@@ -31,7 +31,7 @@ namespace Content.Client.GameObjects.Components.Storage
{ {
base.OnAdd(); base.OnAdd();
Window = new StorageWindow(IoCManager.Resolve<IDisplayManager>()) Window = new StorageWindow()
{ StorageEntity = this}; { StorageEntity = this};
} }
@@ -109,7 +109,7 @@ 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()
{ {
Size = new Vector2(180.0f, 320.0f); Size = new Vector2(180.0f, 320.0f);
} }

View File

@@ -35,11 +35,11 @@ namespace Content.Client.Research
private List<LatheRecipePrototype> _recipes = new List<LatheRecipePrototype>(); private List<LatheRecipePrototype> _recipes = new List<LatheRecipePrototype>();
private List<LatheRecipePrototype> _shownRecipes = new List<LatheRecipePrototype>(); private List<LatheRecipePrototype> _shownRecipes = new List<LatheRecipePrototype>();
public LatheMenu(IDisplayManager displayMan) : base(displayMan) public LatheMenu()
{ {
} }
public LatheMenu(IDisplayManager displayMan, string name) : base(displayMan, name) public LatheMenu(string name) : base(name)
{ {
} }

View File

@@ -25,11 +25,6 @@ namespace Content.Client.Research
private Label Description; private Label Description;
private TextureRect Icon; private TextureRect Icon;
public LatheQueueMenu(IDisplayManager displayManager) : base(displayManager)
{
}
protected override void Initialize() protected override void Initialize()
{ {
base.Initialize(); base.Initialize();

View File

@@ -252,15 +252,5 @@ namespace Content.Client.UserInterface
esm.GetEntitySystem<VerbSystem>().OpenContextMenu(entity, new ScreenCoordinates(args.GlobalPosition)); esm.GetEntitySystem<VerbSystem>().OpenContextMenu(entity, new ScreenCoordinates(args.GlobalPosition));
} }
} }
private static ISpriteProxy GetSpriteMirror(IEntity entity)
{
if (entity.TryGetComponent(out ISpriteComponent component))
{
return component.CreateProxy();
}
return null;
}
} }
} }