diff --git a/MiraAPI/Patches/Options/GameSettingMenuPatches.cs b/MiraAPI/Patches/Options/GameSettingMenuPatches.cs index 93f0c42..0c666ac 100644 --- a/MiraAPI/Patches/Options/GameSettingMenuPatches.cs +++ b/MiraAPI/Patches/Options/GameSettingMenuPatches.cs @@ -17,55 +17,48 @@ public static class GameSettingMenuPatches [HarmonyPatch(nameof(GameSettingMenu.Start))] public static void StartPrefix(GameSettingMenu __instance) { + __instance.transform.FindChild("GameSettingsLabel").gameObject.SetActive(false); + Transform helpThing = __instance.transform.FindChild("What Is This?"); GameObject tmpText = GameObject.Instantiate(helpThing.transform.FindChild("InfoText"), helpThing.parent).gameObject; tmpText.GetComponent().Destroy(); tmpText.name = "SelectedMod"; - tmpText.transform.localPosition = new Vector3(-3.3382f, -0.4019f, -2f); + tmpText.transform.localPosition = new Vector3(-3.3382f, 1.5399f, -2); TextMeshPro tmp = tmpText.GetComponent(); - tmp.text = "Mira API"; - tmp.fontSizeMax = 3; - tmp.fontSize = 3; + tmp.text = "Default"; + tmp.fontSizeMax = 3.2f; tmp.alignment = TextAlignmentOptions.Center; GameObject nextButton = GameObject.Instantiate(__instance.BackButton, __instance.BackButton.transform.parent).gameObject; - nextButton.transform.localPosition = new Vector3(-2.2663f, -0.4037f, -25f); - nextButton.name = "NextButton"; + nextButton.transform.localPosition = new Vector3(-2.2663f, 1.5272f, -25f); + nextButton.name = "RightArrowButton"; nextButton.transform.FindChild("Inactive").gameObject.GetComponent().sprite = MiraAssets.NextButton.LoadAsset(); nextButton.transform.FindChild("Active").gameObject.GetComponent().sprite = MiraAssets.NextButtonActive.LoadAsset(); - nextButton.gameObject.GetComponent().OnClick.AddListener((UnityAction)(() => + nextButton.gameObject.GetComponent().DestroyImmediate(); + nextButton.gameObject.GetComponent().DestroyImmediate(); + + PassiveButton passiveButton = nextButton.gameObject.AddComponent(); + passiveButton.HoverSound = __instance.BackButton.GetComponent().HoverSound; + passiveButton.ClickSound = __instance.BackButton.GetComponent().ClickSound; + + passiveButton.activeSprites = nextButton.transform.FindChild("Active").gameObject; + passiveButton.inactiveSprites = nextButton.transform.FindChild("Inactive").gameObject; + passiveButton.OnClick.AddListener((UnityAction)(() => { currentSelectedMod += 1; })); GameObject backButton = GameObject.Instantiate(nextButton, __instance.BackButton.transform.parent).gameObject; - nextButton.transform.localPosition = new Vector3(-4.4209f, -0.4037f, -25f); - nextButton.name = "BackButton"; - nextButton.transform.FindChild("Active").gameObject.GetComponent().flipX = nextButton.transform.FindChild("Inactive").gameObject.GetComponent().flipX = true; - backButton.gameObject.GetComponent().OnClick.RemoveAllListeners(); + backButton.transform.localPosition = new Vector3(-4.4209f, 1.5272f, -25f); + backButton.name = "LeftArrowButton"; + backButton.gameObject.GetComponent().Destroy(); + backButton.transform.FindChild("Active").gameObject.GetComponent().flipX = backButton.transform.FindChild("Inactive").gameObject.GetComponent().flipX = true; backButton.gameObject.GetComponent().OnClick.AddListener((UnityAction)(() => { currentSelectedMod -= 1; })); - - __instance.GamePresetsButton.gameObject.SetActive(false); } - - /*public static void CreateOptionsFor(GameSettingMenu __instance, ToggleOption togglePrefab, NumberOption numberPrefab, StringOption stringPrefab, Transform container, - List options) - { - foreach (IModdedOption option in options) - { - if (option.AdvancedRole is not null || option.OptionBehaviour) - { - continue; - } - - OptionBehaviour newOption = option.CreateOption(togglePrefab, numberPrefab, stringPrefab, container); - __instance.AllItems = __instance.AllItems.AddItem(newOption.transform).ToArray(); - } - }*/ }