private static void SaveSlotButton_OnSubmit(On.UnityEngine.UI.SaveSlotButton.orig_OnSubmit orig, SaveSlotButton self, UnityEngine.EventSystems.BaseEventData eventData)
        {
            if (self.saveFileState == SaveSlotButton.SaveFileStates.LoadedStats &&
                self.GetSaveStats().permadeathMode != 2)
            {
                try
                {
                    Settings s = MenuChangerMod.instance.ManuallyLoadSettings <MenuChangerMod, Settings>(self.GetSaveSlotIndex());
                    if (s != null && s.resumeKey != null && _resumePages.TryGetValue(s.resumeKey, out MenuPage page) && page is MenuPage)
                    {
                        self.ForceDeselect();
                        UIManager.instance.StartCoroutine(GoToResumeMenu(UIManager.instance, self, page));
                        return;
                    }
                }
                catch (Exception e)
                {
                    MenuChangerMod.instance.LogError($"Unable to manually load settings from menu!\n{e}");
                }
            }
            else if (self.saveFileState == SaveSlotButton.SaveFileStates.Empty)
            {
                GameManager.instance.profileID = self.GetSaveSlotIndex();
                UIManager.instance.UIGoToPlayModeMenu();
                self.ForceDeselect();
                return;
            }

            orig(self, eventData);
        }
        private static IEnumerator GoToResumeMenu(UIManager s, SaveSlotButton button, MenuPage resumePage)
        {
            InputHandler.Instance.StopUIInput();
            yield return(s.HideSaveProfileMenu());

            ReflectionHelper.CallMethod(s, "SetMenuState", MainMenuState.PLAY_MODE_MENU);
            transitionPage.Show();
            loadingLabel.Show();
            yield return(null);

            yield return(LoadGameAndDoAction(button.GetSaveSlotIndex(), () =>
            {
                insideResumeMenu = true;
                loadingLabel.Hide();
                transitionPage.Hide();
                InputHandler.Instance.StartUIInput();
                resumePage.Show();
            }));
        }