public override void Shutdown() { escapeMenu.Dispose(); _gameChat.TextSubmitted -= console.ParseChatMessage; console.AddString -= _gameChat.AddLine; playerManager.LocalPlayer.DetachEntity(); _entityManager.Shutdown(); mapManager.Shutdown(); userInterfaceManager.StateRoot.DisposeAllChildren(); var maps = mapManager.GetAllMaps().ToArray(); foreach (var map in maps) { if (map.Index != MapId.Nullspace) { mapManager.DeleteMap(map.Index); } } inputManager.SetInputCommand(EngineKeyFunctions.EscapeMenu, null); inputManager.SetInputCommand(EngineKeyFunctions.FocusChat, null); inputManager.KeyBindStateChanged -= OnKeyBindStateChanged; }
public override void Shutdown() { escapeMenu.Dispose(); playerManager.LocalPlayer.DetachEntity(); userInterfaceManager.StateRoot.DisposeAllChildren(); inputManager.SetInputCommand(EngineKeyFunctions.EscapeMenu, null); inputManager.KeyBindStateChanged -= OnKeyBindStateChanged; }
public override void Shutdown() { escapeMenu.Dispose(); _gameChat.TextSubmitted -= console.ParseChatMessage; console.AddString -= _gameChat.AddLine; playerManager.LocalPlayer.DetachEntity(); userInterfaceManager.StateRoot.DisposeAllChildren(); inputManager.SetInputCommand(EngineKeyFunctions.EscapeMenu, null); inputManager.SetInputCommand(EngineKeyFunctions.FocusChat, null); inputManager.KeyBindStateChanged -= OnKeyBindStateChanged; }
private void StateManagerOnOnStateChanged(StateChangedEventArgs obj) { if (obj.NewState is GameScreen) { // Switched TO GameScreen. _escapeMenu = new EscapeMenu(_clientConsole, _tileDefinitionManager, _placementManager, _prototypeManager, _resourceCache, _configurationManager) { Visible = false }; _escapeMenu.AddToScreen(); var escapeMenuCommand = InputCmdHandler.FromDelegate(session => { if (_escapeMenu.Visible) { if (_escapeMenu.IsAtFront()) { _escapeMenu.Visible = false; } else { _escapeMenu.MoveToFront(); } } else { _escapeMenu.OpenCentered(); } }); _inputManager.SetInputCommand(EngineKeyFunctions.EscapeMenu, escapeMenuCommand); } else if (obj.OldState is GameScreen) { // Switched FROM GameScreen. _escapeMenu.Dispose(); _escapeMenu = null; _inputManager.SetInputCommand(EngineKeyFunctions.EscapeMenu, null); } }
private void StateManagerOnOnStateChanged(StateChangedEventArgs obj) { if (obj.NewState is GameScreenBase) { // Switched TO GameScreen. _escapeMenu = new EscapeMenu(_consoleHost); _escapeMenu.OnClose += () => _gameHud.EscapeButtonDown = false; _inputManager.SetInputCommand(EngineKeyFunctions.EscapeMenu, InputCmdHandler.FromDelegate(s => Enabled())); } else if (obj.OldState is GameScreenBase) { // Switched FROM GameScreen. _escapeMenu.Dispose(); _escapeMenu = null; _inputManager.SetInputCommand(EngineKeyFunctions.EscapeMenu, null); } }
public override void Shutdown() { escapeMenu.Dispose(); _gameChat.TextSubmitted -= console.ParseChatMessage; console.AddString -= _gameChat.AddLine; playerManager.LocalPlayer.DetachEntity(); _entityManager.Shutdown(); userInterfaceManager.StateRoot.DisposeAllChildren(); var maps = mapManager.GetAllMaps().ToArray(); foreach (var map in maps) { if (map.Index != MapId.Nullspace) { mapManager.DeleteMap(map.Index); } } }
private void StateManagerOnOnStateChanged(StateChangedEventArgs obj) { if (obj.NewState is GameScreen) { // Switched TO GameScreen. _escapeMenu = new EscapeMenu(_clientConsole, _tileDefinitionManager, _placementManager, _prototypeManager, _resourceCache, _configurationManager, _localizationManager); _escapeMenu.OnClose += () => _gameHud.EscapeButtonDown = false; _inputManager.SetInputCommand(EngineKeyFunctions.EscapeMenu, InputCmdHandler.FromDelegate(s => Enabled())); } else if (obj.OldState is GameScreen) { // Switched FROM GameScreen. _escapeMenu.Dispose(); _escapeMenu = null; _inputManager.SetInputCommand(EngineKeyFunctions.EscapeMenu, null); } }