More minor UI refactor stuff (#11287)

This commit is contained in:
wrexbe
2022-09-14 20:42:35 -07:00
committed by GitHub
parent 82eff53a91
commit dc8cc81137
12 changed files with 190 additions and 175 deletions

View File

@@ -1,7 +1,6 @@
using System.IO;
using Content.Client.Administration.Commands;
using Content.Client.Administration.Managers;
using Content.Client.Sandbox;
using Content.Client.UserInterface.Systems.DecalPlacer;
using Content.Shared.Administration;
using Robust.Client.AutoGenerated;
@@ -15,11 +14,19 @@ namespace Content.Client.Administration.UI.Tabs.AdminbusTab
[GenerateTypedNameReferences]
public sealed partial class AdminbusTab : Control
{
private readonly EntitySpawningUIController _entitySpawningController;
private readonly TileSpawningUIController _tileSpawningController;
private readonly DecalPlacerUIController _decalPlacerController;
public AdminbusTab()
{
RobustXamlLoader.Load(this);
IoCManager.InjectDependencies(this);
_entitySpawningController = UserInterfaceManager.GetUIController<EntitySpawningUIController>();
_tileSpawningController = UserInterfaceManager.GetUIController<TileSpawningUIController>();
_decalPlacerController = UserInterfaceManager.GetUIController<DecalPlacerUIController>();
var adminManager = IoCManager.Resolve<IClientAdminManager>();
// For the SpawnEntitiesButton and SpawnTilesButton we need to do the press manually
@@ -39,17 +46,17 @@ namespace Content.Client.Administration.UI.Tabs.AdminbusTab
private void SpawnEntitiesButtonOnPressed(BaseButton.ButtonEventArgs obj)
{
IoCManager.Resolve<IUserInterfaceManager>().GetUIController<EntitySpawningUIController>().ToggleWindow();
_entitySpawningController.ToggleWindow();
}
private void SpawnTilesButtonOnOnPressed(BaseButton.ButtonEventArgs obj)
{
IoCManager.Resolve<IUserInterfaceManager>().GetUIController<TileSpawningUIController>().ToggleWindow();
_tileSpawningController.ToggleWindow();
}
private void SpawnDecalsButtonOnPressed(BaseButton.ButtonEventArgs obj)
{
IoCManager.Resolve<IUserInterfaceManager>().GetUIController<DecalPlacerUIController>().ToggleWindow();
_decalPlacerController.ToggleWindow();
}
}
}