Skip to content

Commit

Permalink
fix navigation on text entry
Browse files Browse the repository at this point in the history
  • Loading branch information
misternebula committed Mar 19, 2024
1 parent 47811ff commit fab1f2b
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions src/OWML.ModHelper.Menus/NewMenuSystem/OptionsMenuManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<RectTransform>();
var ort = existingHorizLayout.transform.Find("ControlBlock").Find("HorizontalLayoutGroup").GetComponent<RectTransform>();
Expand Down Expand Up @@ -604,7 +605,7 @@ public SubmitAction CreateButtonWithLabel(Menu menu, string label, string button
}
};

newButton.AddComponent<SelectableAudioPlayer>();
newButton.GetAddComponent<SelectableAudioPlayer>();

var menuOption = newButton.GetComponent<MenuOption>();
menuOption._tooltipTextType = UITextType.None;
Expand All @@ -618,8 +619,6 @@ public SubmitAction CreateButtonWithLabel(Menu menu, string label, string button
menu._selectOnActivate = newButtonObj.GetComponent<Selectable>();
}

newButton.AddComponent<SelectableAudioPlayer>();

return submitAction;
}

Expand All @@ -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<Selectable>();
}

return textEntry;
}

Expand Down

0 comments on commit fab1f2b

Please sign in to comment.