mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-09-03 02:27:08 +02:00
RobustToolbox projects should be named Robust.* This PR changes the RobustToolbox projects from SS14.* to Robust.* Updates SS14.* prefixes/namespaces to Robust.* Updates SpaceStation14.sln to RobustToolbox.sln Updates MSBUILD/SS14.* to MSBUILD/Robust.* Updates CSProject and MSBuild references for the above Updates git_helper.py Removes Runserver and Runclient as they are unusable
108 lines
3.8 KiB
C#
108 lines
3.8 KiB
C#
using Robust.Client.UserInterface.Controls;
|
|
using Robust.Client.Console;
|
|
using Robust.Client.Interfaces.Graphics;
|
|
using Robust.Client.Interfaces.Placement;
|
|
using Robust.Client.Interfaces.ResourceManagement;
|
|
using Robust.Shared.Interfaces.Configuration;
|
|
using Robust.Shared.Interfaces.Map;
|
|
using Robust.Shared.Prototypes;
|
|
using Robust.Shared.Utility;
|
|
|
|
namespace Robust.Client.UserInterface.CustomControls
|
|
{
|
|
public class EscapeMenu : SS14Window
|
|
{
|
|
private readonly IClientConsole _console;
|
|
private readonly ITileDefinitionManager __tileDefinitionManager;
|
|
private readonly IPlacementManager _placementManager;
|
|
private readonly IPrototypeManager _prototypeManager;
|
|
private readonly IResourceCache _resourceCache;
|
|
private readonly IDisplayManager _displayManager;
|
|
private readonly IConfigurationManager _configSystem;
|
|
|
|
protected override ResourcePath ScenePath => new ResourcePath("/Scenes/EscapeMenu/EscapeMenu.tscn");
|
|
private BaseButton QuitButton;
|
|
private BaseButton OptionsButton;
|
|
private BaseButton SpawnEntitiesButton;
|
|
private BaseButton SpawnTilesButton;
|
|
private OptionsMenu optionsMenu;
|
|
|
|
public EscapeMenu(IDisplayManager displayManager,
|
|
IClientConsole console,
|
|
ITileDefinitionManager tileDefinitionManager,
|
|
IPlacementManager placementManager,
|
|
IPrototypeManager prototypeManager,
|
|
IResourceCache resourceCache,
|
|
IConfigurationManager configSystem) : base(displayManager)
|
|
{
|
|
_configSystem = configSystem;
|
|
_displayManager = displayManager;
|
|
_console = console;
|
|
__tileDefinitionManager = tileDefinitionManager;
|
|
_placementManager = placementManager;
|
|
_prototypeManager = prototypeManager;
|
|
_resourceCache = resourceCache;
|
|
|
|
PerformLayout();
|
|
}
|
|
|
|
private void PerformLayout()
|
|
{
|
|
optionsMenu = new OptionsMenu(_displayManager, _configSystem)
|
|
{
|
|
Visible = false
|
|
};
|
|
optionsMenu.AddToScreen();
|
|
|
|
Resizable = false;
|
|
HideOnClose = true;
|
|
|
|
QuitButton = Contents.GetChild<BaseButton>("QuitButton");
|
|
QuitButton.OnPressed += OnQuitButtonClicked;
|
|
|
|
OptionsButton = Contents.GetChild<BaseButton>("OptionsButton");
|
|
OptionsButton.OnPressed += OnOptionsButtonClicked;
|
|
|
|
SpawnEntitiesButton = Contents.GetChild<BaseButton>("SpawnEntitiesButton");
|
|
SpawnEntitiesButton.OnPressed += OnSpawnEntitiesButtonClicked;
|
|
|
|
SpawnTilesButton = Contents.GetChild<BaseButton>("SpawnTilesButton");
|
|
SpawnTilesButton.OnPressed += OnSpawnTilesButtonClicked;
|
|
}
|
|
|
|
private void OnQuitButtonClicked(BaseButton.ButtonEventArgs args)
|
|
{
|
|
_console.ProcessCommand("disconnect");
|
|
Dispose();
|
|
}
|
|
|
|
private void OnOptionsButtonClicked(BaseButton.ButtonEventArgs args)
|
|
{
|
|
optionsMenu.OpenCentered();
|
|
}
|
|
|
|
private void OnSpawnEntitiesButtonClicked(BaseButton.ButtonEventArgs args)
|
|
{
|
|
var window = new EntitySpawnWindow(_displayManager, _placementManager, _prototypeManager, _resourceCache);
|
|
window.AddToScreen();
|
|
window.OpenToLeft();
|
|
}
|
|
|
|
private void OnSpawnTilesButtonClicked(BaseButton.ButtonEventArgs args)
|
|
{
|
|
var window = new TileSpawnWindow(__tileDefinitionManager, _placementManager, _displayManager);
|
|
window.AddToScreen();
|
|
window.OpenToLeft();
|
|
}
|
|
|
|
protected override void Dispose(bool disposing)
|
|
{
|
|
base.Dispose(disposing);
|
|
if (disposing)
|
|
{
|
|
optionsMenu.Dispose();
|
|
}
|
|
}
|
|
}
|
|
}
|