Merge more UI refactor stuff (#11277)

* Changelog+options ui controller
* Sandbox UI controller
* Escape menu UI controller
This commit is contained in:
wrexbe
2022-09-14 14:34:48 -07:00
committed by GitHub
parent 8871c445b8
commit 018a96ee88
23 changed files with 591 additions and 573 deletions

View File

@@ -7,7 +7,6 @@ using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.CustomControls;
using Robust.Client.UserInterface.XAML;
using Robust.Client.Utility;
using Robust.Shared.Prototypes;
using static Robust.Client.UserInterface.Controls.BaseButton;
namespace Content.Client.Decals.UI;
@@ -15,7 +14,6 @@ namespace Content.Client.Decals.UI;
[GenerateTypedNameReferences]
public sealed partial class DecalPlacerWindow : DefaultWindow
{
private readonly IPrototypeManager _prototypeManager;
private readonly DecalPlacementSystem _decalPlacementSystem;
public FloatSpinBox RotationSpinBox;
@@ -31,11 +29,10 @@ public sealed partial class DecalPlacerWindow : DefaultWindow
private bool _cleanable;
private int _zIndex;
public DecalPlacerWindow(IPrototypeManager prototypeManager)
public DecalPlacerWindow()
{
RobustXamlLoader.Load(this);
_prototypeManager = prototypeManager;
_decalPlacementSystem = EntitySystem.Get<DecalPlacementSystem>();
// This needs to be done in C# so we can have custom stuff passed in the constructor
@@ -98,8 +95,6 @@ public sealed partial class DecalPlacerWindow : DefaultWindow
};
// i have to make this a member method for some reason and i have no idea why its only for spinboxes
ZIndexSpinBox.ValueChanged += ZIndexSpinboxChanged;
Populate();
}
private void OnColorPicked(Color color)
@@ -173,9 +168,8 @@ public sealed partial class DecalPlacerWindow : DefaultWindow
RefreshList();
}
public void Populate()
public void Populate(IEnumerable<DecalPrototype> prototypes)
{
var prototypes = _prototypeManager.EnumeratePrototypes<DecalPrototype>();
_decals = new Dictionary<string, Texture>();
foreach (var decalPrototype in prototypes)
{