/// <summary> /// Setup the main menu. /// </summary> private void RunMenuSetup() { Background = GetNode <TextureRect>("Background"); guiAnimations = GetNode <AnimationPlayer>("GUIAnimations"); thriveLogo = GetNode <TextureRect>(ThriveLogoPath); newGameButton = GetNode <Button>(NewGameButtonPath); freebuildButton = GetNode <Button>(FreebuildButtonPath); creditsContainer = GetNode <Control>(CreditsContainerPath); credits = GetNode <CreditsScroll>(CreditsScrollPath); licensesDisplay = GetNode <LicensesDisplay>(LicensesDisplayPath); storeLoggedInDisplay = GetNode <Label>(StoreLoggedInDisplayPath); modManager = GetNode <ModManager>(ModManagerPath); MenuArray?.Clear(); // Get all of menu items MenuArray = GetTree().GetNodesInGroup("MenuItem"); if (MenuArray == null) { GD.PrintErr("Failed to find all the menu items!"); return; } RandomizeBackground(); options = GetNode <OptionsMenu>("OptionsMenu"); saves = GetNode <SaveManagerGUI>("SaveManagerGUI"); gles2Popup = GetNode <CustomConfirmationDialog>(GLES2PopupPath); modLoadFailures = GetNode <ErrorDialog>(ModLoadFailuresPath); // Set initial menu SwitchMenu(); // Easter egg message thriveLogo.RegisterToolTipForControl("thriveLogoEasterEgg", "mainMenu"); if (OS.GetCurrentVideoDriver() == OS.VideoDriver.Gles2 && !IsReturningToMenu) { gles2Popup.PopupCenteredShrink(); } UpdateStoreNameLabel(); }
/// <summary> /// Setup the main menu. /// </summary> private void RunMenuSetup() { Background = GetNode <TextureRect>("Background"); guiAnimations = GetNode <AnimationPlayer>("GUIAnimations"); thriveLogo = GetNode <TextureRect>(ThriveLogoPath); newGameButton = GetNode <Button>(NewGameButtonPath); freebuildButton = GetNode <Button>(FreebuildButtonPath); MenuArray?.Clear(); // Get all of menu items MenuArray = GetTree().GetNodesInGroup("MenuItem"); if (MenuArray == null) { GD.PrintErr("Failed to find all the menu items!"); return; } RandomizeBackground(); options = GetNode <OptionsMenu>("OptionsMenu"); saves = GetNode <SaveManagerGUI>("SaveManagerGUI"); gles2Popup = GetNode <AcceptDialog>(GLES2PopupPath); // Set initial menu SwitchMenu(); // Easter egg message thriveLogo.RegisterToolTipForControl( ToolTipManager.Instance.GetToolTip("thriveLogoEasterEgg", "mainMenu"), toolTipCallbacks); if (OS.GetCurrentVideoDriver() == OS.VideoDriver.Gles2 && !IsReturningToMenu) { gles2Popup.PopupCenteredShrink(); } }