From fab1f2b0c5b880cb64baf0f480b5637c6f445088 Mon Sep 17 00:00:00 2001 From: _nebula <41904486+misternebula@users.noreply.github.com> Date: Tue, 19 Mar 2024 00:43:00 +0000 Subject: [PATCH] fix navigation on text entry --- .../NewMenuSystem/OptionsMenuManager.cs | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/OWML.ModHelper.Menus/NewMenuSystem/OptionsMenuManager.cs b/src/OWML.ModHelper.Menus/NewMenuSystem/OptionsMenuManager.cs index 44a61f73..3839cad4 100644 --- a/src/OWML.ModHelper.Menus/NewMenuSystem/OptionsMenuManager.cs +++ b/src/OWML.ModHelper.Menus/NewMenuSystem/OptionsMenuManager.cs @@ -551,6 +551,7 @@ public SubmitAction CreateButtonWithLabel(Menu menu, string label, string button var newButton = Object.Instantiate(existingButton); newButton.transform.parent = controlBlock; newButton.transform.localScale = Vector3.one; + newButton.name = $"UIElement-{label}"; var rt = newButton.GetComponent(); var ort = existingHorizLayout.transform.Find("ControlBlock").Find("HorizontalLayoutGroup").GetComponent(); @@ -604,7 +605,7 @@ public SubmitAction CreateButtonWithLabel(Menu menu, string label, string button } }; - newButton.AddComponent(); + newButton.GetAddComponent(); var menuOption = newButton.GetComponent(); menuOption._tooltipTextType = UITextType.None; @@ -618,8 +619,6 @@ public SubmitAction CreateButtonWithLabel(Menu menu, string label, string button menu._selectOnActivate = newButtonObj.GetComponent(); } - newButton.AddComponent(); - return submitAction; } @@ -643,13 +642,6 @@ public IOWMLTextEntryElement AddTextEntryInput(Menu menu, string label, string i }; } - menu._menuOptions = menu._menuOptions.Add(textEntry); - - if (menu._selectOnActivate == null) - { - menu._selectOnActivate = textEntry.GetComponent(); - } - return textEntry; }