/// <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); _window.AddToScreen(); //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 override void HandleMessage(ComponentMessage message, INetChannel netChannel = null, IComponent component = null) { base.HandleMessage(message, netChannel, component); switch (message) { case OpenDataWindowMsg msg: var window = new SS14Window { Title = "Power Debug Tool" }; window.Contents.AddChild(new Label() { Text = msg.Data }); window.AddToScreen(); window.Open(); break; } }
public override void HandleMessage(ComponentMessage message, INetChannel netChannel = null, IComponent component = null) { base.HandleMessage(message, netChannel, component); switch (message) { case OpenDataWindowMsg msg: if (LastWindow != null && !LastWindow.Disposed) { LastWindow.Dispose(); } LastWindow = new SS14Window() { Title = "Power Debug Tool", }; LastWindow.Contents.AddChild(new Label() { Text = msg.Data }); LastWindow.Open(); break; } }