From a385f3b59f299891144d2e4cadaf608a0e1a99ce Mon Sep 17 00:00:00 2001 From: Nick Date: Mon, 10 Jun 2024 16:24:44 -0400 Subject: [PATCH 1/8] Update game libs and bring back some buttons --- src/OWML.Common/OWML.Common.csproj | 2 +- .../NewMenuSystem/OptionsMenuManager.cs | 14 +++++--------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/OWML.Common/OWML.Common.csproj b/src/OWML.Common/OWML.Common.csproj index 992eb9d23..da3d44cff 100644 --- a/src/OWML.Common/OWML.Common.csproj +++ b/src/OWML.Common/OWML.Common.csproj @@ -6,7 +6,7 @@ - + diff --git a/src/OWML.ModHelper.Menus/NewMenuSystem/OptionsMenuManager.cs b/src/OWML.ModHelper.Menus/NewMenuSystem/OptionsMenuManager.cs index 62065d755..a4e8ac50e 100644 --- a/src/OWML.ModHelper.Menus/NewMenuSystem/OptionsMenuManager.cs +++ b/src/OWML.ModHelper.Menus/NewMenuSystem/OptionsMenuManager.cs @@ -231,8 +231,7 @@ public IOWMLToggleElement AddCheckboxInput(Menu menu, string label, string toolt { var existingCheckbox = Resources.FindObjectsOfTypeAll() .Single(x => x.name == "GameplayMenu").transform - .Find("MenuGameplayBasic") - .Find("UIElement-InvertPlayerLook").gameObject; + .Find("MenuGameplayBasic/Scroll View/Viewport/Content/UIElement-InvertPlayerLook").gameObject; var newCheckbox = Object.Instantiate(existingCheckbox); newCheckbox.transform.parent = GetParentForAddedElements(menu); @@ -276,8 +275,7 @@ public IOWMLTwoButtonToggleElement AddToggleInput(Menu menu, string label, strin { var existingToggle = Resources.FindObjectsOfTypeAll() .Single(x => x.name == "InputMenu").transform - .Find("MenuGeneral") - .Find("UIElement-ConfirmToggle").gameObject; + .Find("MenuGeneral/UIElement-ConfirmToggle").gameObject; var script = existingToggle.GetComponent(); var text = script._buttonTrue.GetComponent()._textItems[0]; @@ -330,8 +328,7 @@ public IOWMLOptionsSelectorElement AddSelectorInput(Menu menu, string label, str { var existingSelector = Resources.FindObjectsOfTypeAll() .Single(x => x.name == "GameplayMenu").transform - .Find("MenuGameplayBasic") - .Find("UIElement-ControllerProfile").gameObject; + .Find("MenuGameplayBasic/Scroll View/Viewport/Content/UIElement-ControllerProfile").gameObject; var newSelector = Object.Instantiate(existingSelector); newSelector.transform.parent = GetParentForAddedElements(menu); @@ -379,8 +376,7 @@ public IOWMLSliderElement AddSliderInput(Menu menu, string label, float lower, f { var existingSlider = Resources.FindObjectsOfTypeAll() .Single(x => x.name == "GameplayMenu").transform - .Find("MenuGameplayBasic") - .Find("UIElement-LookSensitivity").gameObject; + .Find("MenuGameplayBasic/Scroll View/Viewport/Content/UIElement-LookSensitivity").gameObject; var newSlider = Object.Instantiate(existingSlider); newSlider.transform.parent = GetParentForAddedElements(menu); @@ -432,7 +428,7 @@ public GameObject AddSeparator(Menu menu, bool dots) var dotsSprite = Resources.FindObjectsOfTypeAll() .Single(x => x.name == "GameplayMenu").transform - .Find("MenuGameplayBasic") + .Find("MenuGameplayBasic/Scroll View/Viewport/Content") .Find("UIElement-ControllerProfile") .Find("HorizontalLayoutGroup") .Find("LabelBlock") From a8ed9a47d9c72192fc5572d7fa77ae09a78db011 Mon Sep 17 00:00:00 2001 From: Nick Date: Mon, 10 Jun 2024 17:33:57 -0400 Subject: [PATCH 2/8] Use a different load bearing button --- .../NewMenuSystem/OptionsMenuManager.cs | 38 ++++++++----------- 1 file changed, 15 insertions(+), 23 deletions(-) diff --git a/src/OWML.ModHelper.Menus/NewMenuSystem/OptionsMenuManager.cs b/src/OWML.ModHelper.Menus/NewMenuSystem/OptionsMenuManager.cs index a4e8ac50e..85dabe3c4 100644 --- a/src/OWML.ModHelper.Menus/NewMenuSystem/OptionsMenuManager.cs +++ b/src/OWML.ModHelper.Menus/NewMenuSystem/OptionsMenuManager.cs @@ -462,12 +462,7 @@ public GameObject AddSeparator(Menu menu, bool dots) public SubmitAction CreateButton(Menu menu, string buttonLabel, string tooltip, MenuSide side) { - var existingButton = Resources.FindObjectsOfTypeAll() - .Single(x => x.name == "GraphicsMenu").transform - .Find("Scroll View") - .Find("Viewport") - .Find("Content") - .Find("GammaButtonPanel").gameObject; + var existingButton = Resources.FindObjectsOfTypeAll