private static void OnMenuClosed(object sender, EventArgsClickableMenuClosed e)
        {
            switch (e.PriorMenu)
            {
            case GameMenu _:
                GameMenuClosed?.Invoke(sender, e);
                UnregisterTabEvent();
                break;

            case CraftingPage _:
                CraftingMenuClosed?.Invoke(sender, e);
                break;
            }
        }
Exemple #2
0
        /// <summary>Raised after a game menu is opened, closed, or replaced.</summary>
        /// <param name="sender">The event sender.</param>
        /// <param name="e">The event data.</param>
        private void OnMenuChanged(object sender, MenuChangedEventArgs e)
        {
            if (e.NewMenu == e.OldMenu)
            {
                return;
            }

            switch (e.OldMenu)
            {
            case GameMenu _:
                GameMenuClosed?.Invoke(sender, e);
                UnregisterTabEvent();
                break;

            case CraftingPage _:
                if (e.NewMenu is CraftingPage)
                {
                    break;
                }

                CraftingMenuClosed?.Invoke(sender, e);
                break;
            }

            switch (e.NewMenu)
            {
            case GameMenu _:
                GameMenuShown?.Invoke(sender, e);
                _events.Display.RenderedActiveMenu += OnRenderedActiveMenu;
                break;

            case CraftingPage _:
            case object m when m.GetType().ToString() == "CookingSkill.NewCraftingPage":
                CraftingMenuShown?.Invoke(sender, e);

                break;
            }
        }
        private static void OnMenuChanged(object sender, EventArgsClickableMenuChanged e)
        {
            if (e.NewMenu == e.PriorMenu)
            {
                return;
            }

            switch (e.PriorMenu)
            {
            case GameMenu _:
                GameMenuClosed?.Invoke(sender, e);
                UnregisterTabEvent();
                break;

            case CraftingPage _:
                if (e.NewMenu is CraftingPage)
                {
                    break;
                }

                CraftingMenuClosed?.Invoke(sender, e);
                break;
            }

            switch (e.NewMenu)
            {
            case GameMenu _:
                GameMenuShown?.Invoke(sender, e);
                GraphicsEvents.OnPostRenderGuiEvent += OnPostRenderGuiEvent;
                break;

            case CraftingPage _:
                CraftingMenuShown?.Invoke(sender, e);
                break;
            }
        }
Exemple #4
0
        /// <summary>Raised after a game menu is opened, closed, or replaced.</summary>
        /// <param name="sender">The event sender.</param>
        /// <param name="e">The event data.</param>
        private void OnMenuChanged(object sender, MenuChangedEventArgs e)
        {
            if (e.NewMenu == e.OldMenu)
            {
                return;
            }

            switch (e.OldMenu)
            {
            case GameMenu _:
                GameMenuClosed?.Invoke(sender, e);
                UnregisterTabEvent();
                break;

            case CraftingPage _:
                if (e.NewMenu is CraftingPage)
                {
                    break;
                }

                CraftingMenuClosed?.Invoke(sender, e);
                break;
            }

            switch (e.NewMenu)
            {
            case GameMenu _:
                GameMenuShown?.Invoke(sender, e);
                this.Events.Display.RenderedActiveMenu += OnRenderedActiveMenu;
                break;

            case CraftingPage _:
                CraftingMenuShown?.Invoke(sender, e);
                break;
            }
        }