mirror of
https://github.com/All-Of-Us-Mods/MiraAPI.git
synced 2026-10-20 01:46:15 +00:00
Redesign
This commit is contained in:
1 parent
2edd5e8a7a
commit
2affea8c96
1 file changed
+21
-28
@@ -17,55 +17,48 @@ public static class GameSettingMenuPatches
|
|||||||
[HarmonyPatch(nameof(GameSettingMenu.Start))]
|
[HarmonyPatch(nameof(GameSettingMenu.Start))]
|
||||||
public static void StartPrefix(GameSettingMenu __instance)
|
public static void StartPrefix(GameSettingMenu __instance)
|
||||||
{
|
{
|
||||||
|
__instance.transform.FindChild("GameSettingsLabel").gameObject.SetActive(false);
|
||||||
|
|
||||||
Transform helpThing = __instance.transform.FindChild("What Is This?");
|
Transform helpThing = __instance.transform.FindChild("What Is This?");
|
||||||
GameObject tmpText = GameObject.Instantiate(helpThing.transform.FindChild("InfoText"), helpThing.parent).gameObject;
|
GameObject tmpText = GameObject.Instantiate(helpThing.transform.FindChild("InfoText"), helpThing.parent).gameObject;
|
||||||
|
|
||||||
tmpText.GetComponent<TextTranslatorTMP>().Destroy();
|
tmpText.GetComponent<TextTranslatorTMP>().Destroy();
|
||||||
tmpText.name = "SelectedMod";
|
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<TextMeshPro>();
|
TextMeshPro tmp = tmpText.GetComponent<TextMeshPro>();
|
||||||
tmp.text = "Mira API";
|
tmp.text = "<b>Default</b>";
|
||||||
tmp.fontSizeMax = 3;
|
tmp.fontSizeMax = 3.2f;
|
||||||
tmp.fontSize = 3;
|
|
||||||
|
|
||||||
tmp.alignment = TextAlignmentOptions.Center;
|
tmp.alignment = TextAlignmentOptions.Center;
|
||||||
|
|
||||||
GameObject nextButton = GameObject.Instantiate(__instance.BackButton, __instance.BackButton.transform.parent).gameObject;
|
GameObject nextButton = GameObject.Instantiate(__instance.BackButton, __instance.BackButton.transform.parent).gameObject;
|
||||||
nextButton.transform.localPosition = new Vector3(-2.2663f, -0.4037f, -25f);
|
nextButton.transform.localPosition = new Vector3(-2.2663f, 1.5272f, -25f);
|
||||||
nextButton.name = "NextButton";
|
nextButton.name = "RightArrowButton";
|
||||||
nextButton.transform.FindChild("Inactive").gameObject.GetComponent<SpriteRenderer>().sprite = MiraAssets.NextButton.LoadAsset();
|
nextButton.transform.FindChild("Inactive").gameObject.GetComponent<SpriteRenderer>().sprite = MiraAssets.NextButton.LoadAsset();
|
||||||
nextButton.transform.FindChild("Active").gameObject.GetComponent<SpriteRenderer>().sprite = MiraAssets.NextButtonActive.LoadAsset();
|
nextButton.transform.FindChild("Active").gameObject.GetComponent<SpriteRenderer>().sprite = MiraAssets.NextButtonActive.LoadAsset();
|
||||||
nextButton.gameObject.GetComponent<PassiveButton>().OnClick.AddListener((UnityAction)(() =>
|
nextButton.gameObject.GetComponent<CloseButtonConsoleBehaviour>().DestroyImmediate();
|
||||||
|
nextButton.gameObject.GetComponent<PassiveButton>().DestroyImmediate();
|
||||||
|
|
||||||
|
PassiveButton passiveButton = nextButton.gameObject.AddComponent<PassiveButton>();
|
||||||
|
passiveButton.HoverSound = __instance.BackButton.GetComponent<PassiveButton>().HoverSound;
|
||||||
|
passiveButton.ClickSound = __instance.BackButton.GetComponent<PassiveButton>().ClickSound;
|
||||||
|
|
||||||
|
passiveButton.activeSprites = nextButton.transform.FindChild("Active").gameObject;
|
||||||
|
passiveButton.inactiveSprites = nextButton.transform.FindChild("Inactive").gameObject;
|
||||||
|
passiveButton.OnClick.AddListener((UnityAction)(() =>
|
||||||
{
|
{
|
||||||
currentSelectedMod += 1;
|
currentSelectedMod += 1;
|
||||||
}));
|
}));
|
||||||
|
|
||||||
GameObject backButton = GameObject.Instantiate(nextButton, __instance.BackButton.transform.parent).gameObject;
|
GameObject backButton = GameObject.Instantiate(nextButton, __instance.BackButton.transform.parent).gameObject;
|
||||||
nextButton.transform.localPosition = new Vector3(-4.4209f, -0.4037f, -25f);
|
backButton.transform.localPosition = new Vector3(-4.4209f, 1.5272f, -25f);
|
||||||
nextButton.name = "BackButton";
|
backButton.name = "LeftArrowButton";
|
||||||
nextButton.transform.FindChild("Active").gameObject.GetComponent<SpriteRenderer>().flipX = nextButton.transform.FindChild("Inactive").gameObject.GetComponent<SpriteRenderer>().flipX = true;
|
backButton.gameObject.GetComponent<CloseButtonConsoleBehaviour>().Destroy();
|
||||||
backButton.gameObject.GetComponent<PassiveButton>().OnClick.RemoveAllListeners();
|
backButton.transform.FindChild("Active").gameObject.GetComponent<SpriteRenderer>().flipX = backButton.transform.FindChild("Inactive").gameObject.GetComponent<SpriteRenderer>().flipX = true;
|
||||||
backButton.gameObject.GetComponent<PassiveButton>().OnClick.AddListener((UnityAction)(() =>
|
backButton.gameObject.GetComponent<PassiveButton>().OnClick.AddListener((UnityAction)(() =>
|
||||||
{
|
{
|
||||||
currentSelectedMod -= 1;
|
currentSelectedMod -= 1;
|
||||||
}));
|
}));
|
||||||
|
|
||||||
__instance.GamePresetsButton.gameObject.SetActive(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*public static void CreateOptionsFor(GameSettingMenu __instance, ToggleOption togglePrefab, NumberOption numberPrefab, StringOption stringPrefab, Transform container,
|
|
||||||
List<IModdedOption> 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();
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user