Skip to content

Commit

Permalink
fix custom title buttons not hiding in option menu
Browse files Browse the repository at this point in the history
  • Loading branch information
misternebula committed Feb 20, 2024
1 parent 8afa6fc commit 30cc28e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/OWML.ModHelper.Menus/NewMenuSystem/TitleMenuManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ internal class TitleMenuManager : ITitleMenuManager
{
public SubmitAction CreateTitleButton(string text, int index, bool fromTop)
{
var existingTitleButton = Object.FindObjectOfType<TitleScreenManager>().GetValue<SubmitAction>("_resetGameAction");
var titleScreenManager = Object.FindObjectOfType<TitleScreenManager>();

var existingTitleButton = titleScreenManager.GetValue<SubmitAction>("_resetGameAction");
var newButton = Object.Instantiate(existingTitleButton.gameObject);
newButton.transform.parent = existingTitleButton.transform.parent;
newButton.transform.localScale = existingTitleButton.transform.localScale;
Expand All @@ -37,6 +39,8 @@ public SubmitAction CreateTitleButton(string text, int index, bool fromTop)
});
animController._buttonFadeControllers = list.ToArray();

titleScreenManager._mainMenuTextFields = titleScreenManager._mainMenuTextFields.Append(submitAction.GetComponentInChildren<Text>()).ToArray();

return submitAction;
}

Expand Down

0 comments on commit 30cc28e

Please sign in to comment.