예제 #1
0
        public static void Open()
        {
            if (!isClosed)
            {
                return;
            }

            isClosed = false;
            var menu = new MenuCharacterCreation();

            instance = menu;

            Api.Client.UI.LayoutRootChildren.Add(instance);

            Menu.CloseAll();

            // ReSharper disable once CanExtractXamlLocalizableStringCSharp
            inputContext = ClientInputContext.Start("Character creation menu - intercept all other input")
                           .HandleAll(
                () =>
            {
                if (ClientInputManager.IsButtonDown(GameButton.CancelOrClose))
                {
                    MainMenuOverlay.Toggle();
                }

                ClientInputManager.ConsumeAllButtons();
            });
        }
예제 #2
0
        private void RemoveControl()
        {
            if (instance == this)
            {
                instance = null;
            }

            Api.Client.UI.LayoutRootChildren.Remove(this);
            inputContext?.Stop();
            inputContext = null;
        }