Make content work with UI engine changes (#10990)

This commit is contained in:
wrexbe
2022-09-04 16:17:05 -07:00
committed by GitHub
parent 292f3de02d
commit 88465961e0
6 changed files with 17 additions and 43 deletions

View File

@@ -49,7 +49,7 @@ namespace Content.Client.Launcher
public event Action<string?>? ConnectFailReasonChanged;
public event Action<ClientConnectionState>? ConnectionStateChanged;
public override void Startup()
protected override void Startup()
{
_control = new LauncherConnectingGui(this);
@@ -61,7 +61,7 @@ namespace Content.Client.Launcher
CurrentPage = Page.Connecting;
}
public override void Shutdown()
protected override void Shutdown()
{
_control?.Dispose();

View File

@@ -50,7 +50,7 @@ namespace Content.Client.Lobby
private ClientGameTicker _gameTicker = default!;
public override void Startup()
protected override void Startup()
{
_gameTicker = EntitySystem.Get<ClientGameTicker>();
_characterSetup = new CharacterSetupGui(_entityManager, _resourceCache, _preferencesManager,
@@ -114,7 +114,7 @@ namespace Content.Client.Lobby
_gameTicker.LobbyLateJoinStatusUpdated += LobbyLateJoinStatusUpdated;
}
public override void Shutdown()
protected override void Shutdown()
{
_gameTicker.InfoBlobUpdated -= UpdateLobbyUi;
_gameTicker.LobbyStatusUpdated -= LobbyStatusUpdated;

View File

@@ -35,7 +35,7 @@ namespace Content.Client.MainMenu
private static readonly Regex IPv6Regex = new(@"\[(.*:.*:.*)](?::(\d+))?");
/// <inheritdoc />
public override void Startup()
protected override void Startup()
{
_mainMenuControl = new MainMenuControl(_resourceCache, _configurationManager);
_userInterfaceManager.StateRoot.AddChild(_mainMenuControl);
@@ -51,7 +51,7 @@ namespace Content.Client.MainMenu
}
/// <inheritdoc />
public override void Shutdown()
protected override void Shutdown()
{
_client.RunLevelChanged -= RunLevelChanged;
_netManager.ConnectFailed -= _onConnectFailed;

View File

@@ -14,6 +14,8 @@ using Robust.Client.Input;
using Robust.Client.Placement;
using Robust.Client.Placement.Modes;
using Robust.Client.ResourceManagement;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controllers.Implementations;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.CustomControls;
using Robust.Shared.Input.Binding;
@@ -47,7 +49,6 @@ namespace Content.Client.Sandbox
{
Resizable = false;
_gameHud = IoCManager.Resolve<IGameHud>();
Title = Loc.GetString("sandbox-window-title");
var vBox = new BoxContainer
@@ -125,6 +126,7 @@ namespace Content.Client.Sandbox
[Dependency] private readonly ITileDefinitionManager _tileDefinitionManager = default!;
[Dependency] private readonly IInputManager _inputManager = default!;
[Dependency] private readonly IClientAdminManager _adminManager = default!;
[Dependency] private readonly IUserInterfaceManager _userInterfaceManager = default!;
public bool SandboxAllowed { get; private set; }
@@ -394,44 +396,16 @@ namespace Content.Client.Sandbox
// TODO: These should check for command perms + be reset if the round is over.
public void ToggleEntitySpawnWindow()
{
if (_spawnWindow == null)
{
if (!CanSandbox()) return;
_spawnWindow = new EntitySpawnWindow(_placementManager, PrototypeManager, _resourceCache);
_spawnWindow.OpenToLeft();
if (!CanSandbox())
return;
}
if (_spawnWindow.IsOpen)
{
_spawnWindow.Close();
}
else
{
_spawnWindow.Open();
}
_userInterfaceManager.GetUIController<EntitySpawningUIController>().ToggleWindow();
}
public void ToggleTilesWindow()
{
if (_tilesSpawnWindow == null)
{
if (!CanSandbox()) return;
_tilesSpawnWindow = new TileSpawnWindow(_tileDefinitionManager, _placementManager, _resourceCache);
_tilesSpawnWindow.OpenToLeft();
if (!CanSandbox())
return;
}
if (_tilesSpawnWindow.IsOpen)
{
_tilesSpawnWindow.Close();
}
else
{
_tilesSpawnWindow.Open();
}
_userInterfaceManager.GetUIController<TileSpawningUIController>().ToggleWindow();
}
public void ToggleDecalsWindow()

View File

@@ -44,7 +44,7 @@ namespace Content.Client.Viewport
public MainViewport Viewport { get; private set; } = default!;
public override void Startup()
protected override void Startup()
{
base.Startup();
@@ -88,7 +88,7 @@ namespace Content.Client.Viewport
_configurationManager.OnValueChanged(CCVars.HudFpsCounterVisible, (show) => { _fpsCounter.Visible = show; });
}
public override void Shutdown()
protected override void Shutdown()
{
_overlayManager.RemoveOverlay<ShowHandItemOverlay>();
DisposePresenters();

View File

@@ -34,13 +34,13 @@ namespace Content.Client.Viewport
private ClickableEntityComparer _comparer = default!;
public override void Startup()
protected override void Startup()
{
_inputManager.KeyBindStateChanged += OnKeyBindStateChanged;
_comparer = new ClickableEntityComparer(_entityManager);
}
public override void Shutdown()
protected override void Shutdown()
{
_inputManager.KeyBindStateChanged -= OnKeyBindStateChanged;
}