Exemplo n.º 1
0
    private void OnSavePressed()
    {
        GUICommon.Instance.PlayButtonPressSound();

        // Save the new settings to the config file.
        if (!Settings.Instance.Save())
        {
            GD.PrintErr("Failed to save new options menu settings to configuration file.");
            errorAcceptBox.PopupCenteredShrink();
            return;
        }

        // Copy over the new saved settings.
        savedSettings = Settings.Instance.Clone();

        if (optionsMode == OptionsMode.InGame)
        {
            savedTutorialsEnabled = gameProperties.TutorialState.Enabled;
        }

        UpdateResetSaveButtonState();
    }
Exemplo n.º 2
0
    /*
     * GUI Control Callbacks
     */

    private void OnBackPressed()
    {
        GUICommon.Instance.PlayButtonPressSound();

        // If any settings have been changed, show a dialogue asking if the changes should be kept or
        // discarded.
        if (!CompareSettings())
        {
            backConfirmationBox.PopupCenteredShrink();
            return;
        }

        EmitSignal(nameof(OnOptionsClosed));
    }
Exemplo n.º 3
0
    public void OnQuickLoad()
    {
        if (!InProgressLoad.IsLoading)
        {
            GD.Print("Quick load pressed, attempting to load latest save");

            if (!SaveHelper.QuickLoad())
            {
                differentVersionDialog.PopupCenteredShrink();
            }
        }
        else
        {
            GD.Print("Quick load pressed, cancelled because another is already in progress");
        }
    }
Exemplo n.º 4
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);

        // Set initial menu
        SwitchMenu();

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

        if (OS.GetCurrentVideoDriver() == OS.VideoDriver.Gles2 && !IsReturningToMenu)
        {
            gles2Popup.PopupCenteredShrink();
        }
    }
Exemplo n.º 5
0
 private void OnKnownIncompatibleLoaded()
 {
     loadIncompatibleDialog.PopupCenteredShrink();
 }