diff --git a/Content.Client/Administration/UI/Tabs/AdminbusTab/AdminbusTab.xaml.cs b/Content.Client/Administration/UI/Tabs/AdminbusTab/AdminbusTab.xaml.cs index cf04b6be63..9b70624d54 100644 --- a/Content.Client/Administration/UI/Tabs/AdminbusTab/AdminbusTab.xaml.cs +++ b/Content.Client/Administration/UI/Tabs/AdminbusTab/AdminbusTab.xaml.cs @@ -7,6 +7,7 @@ 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; @@ -20,8 +21,10 @@ namespace Content.Client.Administration.UI.Tabs.AdminbusTab private EntitySpawnWindow? _entitySpawnWindow; private TileSpawnWindow? _tileSpawnWindow; - protected override void EnteredTree() + 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; @@ -47,17 +50,27 @@ namespace Content.Client.Administration.UI.Tabs.AdminbusTab private void SpawnEntitiesButtonOnOnPressed(BaseButton.ButtonEventArgs obj) { - _entitySpawnWindow ??= new EntitySpawnWindow(IoCManager.Resolve(), - IoCManager.Resolve(), - IoCManager.Resolve()); + //FIXME: WE SHOULDN'T NEED TO CHECK FOR DISPOSED + if (_entitySpawnWindow == null || _entitySpawnWindow.Disposed) + { + _entitySpawnWindow = new EntitySpawnWindow(IoCManager.Resolve(), + IoCManager.Resolve(), + IoCManager.Resolve()); + } + EntitySystem.Get().OpenCommand(_entitySpawnWindow); } private void SpawnTilesButtonOnOnPressed(BaseButton.ButtonEventArgs obj) { - _tileSpawnWindow ??= new TileSpawnWindow(IoCManager.Resolve(), - IoCManager.Resolve(), - IoCManager.Resolve()); + //FIXME: WE SHOULDN'T NEED TO CHECK FOR DISPOSED + if (_tileSpawnWindow == null || _tileSpawnWindow.Disposed) + { + _tileSpawnWindow = new TileSpawnWindow(IoCManager.Resolve(), + IoCManager.Resolve(), + IoCManager.Resolve()); + } + EntitySystem.Get().OpenCommand(_tileSpawnWindow); } } diff --git a/Content.Shared/Administration/GamePrototypeLoadMessage.cs b/Content.Shared/Administration/GamePrototypeLoadMessage.cs index 130dd21eb0..51f40abafd 100644 --- a/Content.Shared/Administration/GamePrototypeLoadMessage.cs +++ b/Content.Shared/Administration/GamePrototypeLoadMessage.cs @@ -1,12 +1,8 @@ -using System; using Lidgren.Network; using Robust.Shared.Network; -using Robust.Shared.Serialization; namespace Content.Shared.Administration; -[NetSerializable] -[Serializable] public class GamePrototypeLoadMessage : NetMessage { public override MsgGroups MsgGroup => MsgGroups.String;