Exemple #1
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 #3
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;
            }
        }