From d8305cd5a1777cc6a2190668de3935dd984bf26e Mon Sep 17 00:00:00 2001 From: Throckmorpheus Date: Fri, 16 Aug 2024 23:15:09 +0100 Subject: [PATCH 01/22] Fix off-centre subtab buttons New buttons were being placed after the spacers instead of between them --- src/OWML.ModHelper.Menus/NewMenuSystem/OptionsMenuManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OWML.ModHelper.Menus/NewMenuSystem/OptionsMenuManager.cs b/src/OWML.ModHelper.Menus/NewMenuSystem/OptionsMenuManager.cs index b3191800..853a7c9c 100644 --- a/src/OWML.ModHelper.Menus/NewMenuSystem/OptionsMenuManager.cs +++ b/src/OWML.ModHelper.Menus/NewMenuSystem/OptionsMenuManager.cs @@ -169,7 +169,7 @@ public void RemoveTab(Menu tab) newSubMenuTabButton.transform.localScale = Vector3.one; newSubMenuTabButton.transform.localPosition = Vector3.zero; newSubMenuTabButton.transform.localRotation = Quaternion.identity; - newSubMenuTabButton.transform.SetSiblingIndex(newSubMenuTabButton.transform.parent.childCount - 2); + newSubMenuTabButton.transform.SetSiblingIndex(newSubMenuTabButton.transform.parent.childCount - 3); newSubMenuTabButton.name = $"Button-{name}Tab"; Object.Destroy(newSubMenuTabButton.GetComponentInChildren()); newSubMenuTabButton.GetComponentInChildren().text = name; From 501eb16f69fb7524afe524ef1032ebaf0c236477 Mon Sep 17 00:00:00 2001 From: Throckmorpheus Date: Fri, 16 Aug 2024 23:42:26 +0100 Subject: [PATCH 02/22] Set names of main tab objects --- src/OWML.ModHelper.Menus/NewMenuSystem/OptionsMenuManager.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/OWML.ModHelper.Menus/NewMenuSystem/OptionsMenuManager.cs b/src/OWML.ModHelper.Menus/NewMenuSystem/OptionsMenuManager.cs index 853a7c9c..e6499343 100644 --- a/src/OWML.ModHelper.Menus/NewMenuSystem/OptionsMenuManager.cs +++ b/src/OWML.ModHelper.Menus/NewMenuSystem/OptionsMenuManager.cs @@ -31,6 +31,7 @@ public OptionsMenuManager(IModConsole console, IModUnityEvents unityEvents, IPop newMenu.transform.localScale = Vector3.one; newMenu.transform.localPosition = Vector3.zero; newMenu.transform.localRotation = Quaternion.identity; + newMenu.name = $"Menu-{name}"; var rt = newMenu.GetComponent(); var ert = existingMenu.GetComponent(); rt.anchorMin = ert.anchorMin; @@ -84,6 +85,7 @@ public OptionsMenuManager(IModConsole console, IModUnityEvents unityEvents, IPop newSubMenu.transform.localScale = Vector3.one; newSubMenu.transform.localPosition = Vector3.zero; newSubMenu.transform.localRotation = Quaternion.identity; + newSubMenu.name = $"Menu-{name}"; var rectTransform = newSubMenu.GetComponent(); rectTransform.anchorMin = existingTabbedSubMenu.GetComponent().anchorMin; rectTransform.anchorMax = existingTabbedSubMenu.GetComponent().anchorMax; From 190a3645e69b28d20dd076c9cbf03a1218a836a4 Mon Sep 17 00:00:00 2001 From: Throckmorpheus Date: Sat, 17 Aug 2024 02:10:37 +0100 Subject: [PATCH 03/22] Fix off-centre scroll viewport in sub-tabs --- src/OWML.ModHelper.Menus/NewMenuSystem/OptionsMenuManager.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/OWML.ModHelper.Menus/NewMenuSystem/OptionsMenuManager.cs b/src/OWML.ModHelper.Menus/NewMenuSystem/OptionsMenuManager.cs index e6499343..078bfab4 100644 --- a/src/OWML.ModHelper.Menus/NewMenuSystem/OptionsMenuManager.cs +++ b/src/OWML.ModHelper.Menus/NewMenuSystem/OptionsMenuManager.cs @@ -192,6 +192,9 @@ public void RemoveTab(Menu tab) rt.offsetMax = ert.offsetMax; rt.sizeDelta = ert.sizeDelta; + var viewportRect = newSubMenu.GetComponentInChildren().GetComponent(); + viewportRect.anchoredPosition3D = Vector3.zero; + if (menu._selectOnActivate == null) { menu._selectOnActivate = newSubMenuTabButton.GetComponent