* abomination * okay its less unabashedly garbage now * other UI changes * its britney bitch * proper greyscale full/half/quarter tiles * misc cleanup * rsi * Add a palette system. It's Kara's problem now. * oops * a * Departmental palette alpha tweaks * oopy * so true * Update Content.Shared/Decals/ColorPalettePrototype.cs Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> * fixes for that * neutral light color and new warning lines * dirt * checkerboards * oop Co-authored-by: moonheart08 <moonheart08@users.noreply.github.com> Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
91 lines
3.6 KiB
C#
91 lines
3.6 KiB
C#
using System.IO;
|
|
using Content.Client.Administration.Managers;
|
|
using Content.Client.Decals.UI;
|
|
using Content.Shared.Administration;
|
|
using Robust.Client.AutoGenerated;
|
|
using Robust.Client.Placement;
|
|
using Robust.Client.ResourceManagement;
|
|
using Robust.Client.UserInterface;
|
|
using Robust.Client.UserInterface.Controls;
|
|
using Robust.Client.UserInterface.CustomControls;
|
|
using Robust.Client.UserInterface.XAML;
|
|
using Robust.Shared.GameObjects;
|
|
using Robust.Shared.IoC;
|
|
using Robust.Shared.Map;
|
|
using Robust.Shared.Prototypes;
|
|
|
|
namespace Content.Client.Administration.UI.Tabs.AdminbusTab
|
|
{
|
|
[GenerateTypedNameReferences]
|
|
public sealed partial class AdminbusTab : Control
|
|
{
|
|
private EntitySpawnWindow? _entitySpawnWindow;
|
|
private TileSpawnWindow? _tileSpawnWindow;
|
|
private DecalPlacerWindow? _decalPlacerWindow;
|
|
|
|
public AdminbusTab()
|
|
{
|
|
RobustXamlLoader.Load(this);
|
|
IoCManager.InjectDependencies(this);
|
|
// For the SpawnEntitiesButton and SpawnTilesButton we need to do the press manually
|
|
// TODO: This will probably need some command check at some point
|
|
SpawnEntitiesButton.OnPressed += SpawnEntitiesButtonOnOnPressed;
|
|
SpawnTilesButton.OnPressed += SpawnTilesButtonOnOnPressed;
|
|
SpawnDecalsButton.OnPressed += SpawnDecalsButtonOnPressed;
|
|
LoadGamePrototypeButton.OnPressed += LoadGamePrototypeButtonOnOnPressed;
|
|
LoadGamePrototypeButton.Visible = IoCManager.Resolve<IClientAdminManager>().HasFlag(AdminFlags.Query);
|
|
}
|
|
|
|
private async void LoadGamePrototypeButtonOnOnPressed(BaseButton.ButtonEventArgs obj)
|
|
{
|
|
var dialogManager = IoCManager.Resolve<IFileDialogManager>();
|
|
var loadManager = IoCManager.Resolve<IGamePrototypeLoadManager>();
|
|
|
|
var stream = await dialogManager.OpenFile();
|
|
if (stream is null)
|
|
return;
|
|
|
|
// ew oop
|
|
var reader = new StreamReader(stream);
|
|
var proto = await reader.ReadToEndAsync();
|
|
loadManager.SendGamePrototype(proto);
|
|
}
|
|
|
|
private void SpawnEntitiesButtonOnOnPressed(BaseButton.ButtonEventArgs obj)
|
|
{
|
|
//FIXME: WE SHOULDN'T NEED TO CHECK FOR DISPOSED
|
|
if (_entitySpawnWindow == null || _entitySpawnWindow.Disposed)
|
|
{
|
|
_entitySpawnWindow = new EntitySpawnWindow(IoCManager.Resolve<IPlacementManager>(),
|
|
IoCManager.Resolve<IPrototypeManager>(),
|
|
IoCManager.Resolve<IResourceCache>());
|
|
}
|
|
|
|
EntitySystem.Get<AdminSystem>().OpenCommand(_entitySpawnWindow);
|
|
}
|
|
|
|
private void SpawnTilesButtonOnOnPressed(BaseButton.ButtonEventArgs obj)
|
|
{
|
|
//FIXME: WE SHOULDN'T NEED TO CHECK FOR DISPOSED
|
|
if (_tileSpawnWindow == null || _tileSpawnWindow.Disposed)
|
|
{
|
|
_tileSpawnWindow = new TileSpawnWindow(IoCManager.Resolve<ITileDefinitionManager>(),
|
|
IoCManager.Resolve<IPlacementManager>(),
|
|
IoCManager.Resolve<IResourceCache>());
|
|
}
|
|
|
|
EntitySystem.Get<AdminSystem>().OpenCommand(_tileSpawnWindow);
|
|
}
|
|
|
|
private void SpawnDecalsButtonOnPressed(BaseButton.ButtonEventArgs obj)
|
|
{
|
|
if (_decalPlacerWindow == null || _decalPlacerWindow.Disposed)
|
|
{
|
|
_decalPlacerWindow = new DecalPlacerWindow(IoCManager.Resolve<IPrototypeManager>());
|
|
}
|
|
|
|
EntitySystem.Get<AdminSystem>().OpenCommand(_decalPlacerWindow);
|
|
}
|
|
}
|
|
}
|