Exemplo n.º 1
0
    /// <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");

        // Load settings
        if (Settings.Instance == null)
        {
            GD.PrintErr("Failed to initialize settings.");
        }

        // Set initial menu
        SwitchMenu();
    }
Exemplo n.º 2
0
    /// <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();
    }
Exemplo n.º 3
0
    /// <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);

        // Load settings
        if (Settings.Instance == null)
        {
            GD.PrintErr("Failed to initialize settings.");
        }

        // Set initial menu
        SwitchMenu();

        // Easter egg message
        ToolTipHelper.RegisterToolTipForControl(
            thriveLogo, toolTipCallbacks, ToolTipManager.Instance.GetToolTip("thriveLogoEasterEgg", "mainMenu"));

        if (OS.GetCurrentVideoDriver() == OS.VideoDriver.Gles2 && !IsReturningToMenu)
        {
            gles2Popup.PopupCenteredMinsize();
        }
    }