/// <summary> /// Create the window with all character UIs and bind it to a keypress /// </summary> public override void Initialize() { base.Initialize(); //Use all the character ui interfaced components to create the character window var UIcomponents = Owner.GetAllComponents <ICharacterUI>(); _window = new CharacterWindow(UIcomponents); //Add to screen the window and hide it _window.AddToScreen(); _window.Close(); //Toggle window visible/invisible on keypress _openMenuCmdHandler = InputCmdHandler.FromDelegate(session => { if (_window.Visible) { _window.Close(); } else { _window.Open(); } }); //Set keybind to open character menu var inputMgr = IoCManager.Resolve <IInputManager>(); inputMgr.SetInputCommand(ContentKeyFunctions.OpenCharacterMenu, _openMenuCmdHandler); }
public void ResetWindow() { _window?.Close(); _window = null; foreach (var window in _commandWindows) { window?.Dispose(); } _commandWindows.Clear(); }
private void _setOpenValue(SS14Window menu, bool value) { _gameHud.CharacterButtonDown = value; if (value) { menu.OpenCentered(); } else { menu.Close(); } }
private void _setOpenValue(SS14Window menu, bool value) { if (value) { _gameHud.InventoryButtonDown = true; menu.OpenCentered(); } else { _gameHud.InventoryButtonDown = false; menu.Close(); } }