diff --git a/MiraAPI/Patches/Options/LobbyViewPanePatches.cs b/MiraAPI/Patches/Options/LobbyViewPanePatches.cs new file mode 100644 index 0000000..77109f1 --- /dev/null +++ b/MiraAPI/Patches/Options/LobbyViewPanePatches.cs @@ -0,0 +1,58 @@ +using HarmonyLib; +using MiraAPI.PluginLoading; +using MiraAPI.Utilities.Assets; +using Reactor.Utilities.Extensions; +using TMPro; +using UnityEngine; +using UnityEngine.Events; +using UnityEngine.UI; + +namespace MiraAPI.Patches.Options; + +[HarmonyPatch(typeof(LobbyViewSettingsPane))] +public static class LobbyViewPanePatches +{ + [HarmonyPostfix] + [HarmonyPatch(nameof(LobbyViewSettingsPane.Awake))] + public static void AwakePatch(LobbyViewSettingsPane __instance) + { + __instance.gameModeText.transform.localPosition = new Vector3(-4.3f, 2.4f, -2); + __instance.gameModeText.horizontalAlignment = HorizontalAlignmentOptions.Center; + __instance.gameModeText.fontSizeMax = 10f; + __instance.gameModeText.margin = new Vector4(1,0,1,0); + + // Create the next button + GameObject nextButton = Object.Instantiate(__instance.BackButton, __instance.BackButton.transform.parent).gameObject; + nextButton.transform.localPosition = new Vector3(-2.3f, 2.4f, -2f); + nextButton.transform.localScale = new Vector3(3, 3, 2); + nextButton.name = "RightArrowButton"; + + var normal = nextButton.transform.FindChild("Normal").GetComponentInChildren(); + normal.transform.localPosition = new Vector3(0, 0f, 0.3f); + normal.sprite = MiraAssets.NextButton.LoadAsset(); + + var hover = nextButton.transform.FindChild("Hover").GetComponentInChildren(); + hover.transform.localPosition = new Vector3(0, 0f, 0.3f); + hover.sprite = MiraAssets.NextButtonActive.LoadAsset(); + + PassiveButton passiveButton = nextButton.gameObject.GetComponent(); + passiveButton.OnClick = new Button.ButtonClickedEvent(); + passiveButton.OnClick.AddListener((UnityAction)(() => + { + })); + + // Create the back button + GameObject backButton = Object.Instantiate(nextButton, __instance.BackButton.transform.parent).gameObject; + backButton.transform.localPosition = new Vector3(-6.3f, 2.4f, -2f); + backButton.name = "LeftArrowButton"; + backButton.transform.FindChild("Normal").gameObject.GetComponentInChildren().flipX + = backButton.transform.FindChild("Hover").gameObject.GetComponentInChildren().flipX + = true; + + PassiveButton passiveButton2 = backButton.gameObject.GetComponent(); + passiveButton2.OnClick = new Button.ButtonClickedEvent(); + passiveButton2.OnClick.AddListener((UnityAction)(() => + { + })); + } +} \ No newline at end of file