Skip to content

Commit

Permalink
UIMenu: fix if there's an async method to build the items inside the …
Browse files Browse the repository at this point in the history
…menu.
  • Loading branch information
manups4e committed Jan 10, 2022
1 parent 60842f4 commit 285c5ba
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions New_NativeUI/UIMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1980,6 +1980,23 @@ internal async void BuildUpMenu()
ScaleformUI._ui.CallFunction("CREATE_MENU", Title, Subtitle, _customTexture.Key, _customTexture.Value);
if(Windows.Count > 0)
ScaleformUI._ui.CallFunction("ADD_HERITAGE_WINDOW", Windows[0].Mom, Windows[0].Dad);
var timer = GetGameTimer();
if (MenuItems.Count == 0)
{
while (MenuItems.Count == 0)
{
await BaseScript.Delay(0);
if (GetGameTimer() - timer > 150)
{
ScaleformUI._ui.CallFunction("SET_CURRENT_ITEM", CurrentSelection);
SetStreamedTextureDictAsNoLongerNeeded(_customTexture.Key);
SetStreamedTextureDictAsNoLongerNeeded("commonmenu");
SetStreamedTextureDictAsNoLongerNeeded("pause_menu_pages_char_mom_dad");
SetStreamedTextureDictAsNoLongerNeeded("char_creator_portraits");
return;
}
}
}
foreach (var item in MenuItems)
{
LoadScaleform();
Expand Down

0 comments on commit 285c5ba

Please sign in to comment.