Example #1
0
        private void _ShowAboutDialog()
        {
            bool showOnStart = (bool)editorSettings.GetSetting("mono/editor/show_info_on_start");

            aboutDialogCheckBox.Pressed = showOnStart;
            aboutDialog.PopupCenteredMinsize();
        }
Example #2
0
    private void OnSavePressed()
    {
        GUICommon.Instance.PlayButtonPressSound();

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

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

        CompareSettings();
    }
Example #3
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.PopupCenteredMinsize();
            return;
        }

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

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

        UpdateResetSaveButtonState();
    }
Example #4
0
    public void OnQuickLoad()
    {
        if (!InProgressLoad.IsLoading)
        {
            GD.Print("Quick load pressed, attempting to load latest save");

            if (!SaveHelper.QuickLoad())
            {
                differentVersionDialog.PopupCenteredMinsize();
            }
        }
        else
        {
            GD.Print("Quick load pressed, cancelled because another is already in progress");
        }
    }
Example #5
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();
        }
    }
Example #6
0
    public override void _Process(float delta)
    {
        inputs.OnFrameChanged();

        if (load.ReadTrigger())
        {
            if (!InProgressLoad.IsLoading)
            {
                GD.Print("Quick load pressed, attempting to load latest save");

                if (!SaveHelper.QuickLoad())
                {
                    differentVersionDialog.PopupCenteredMinsize();
                }
            }
            else
            {
                GD.Print("Quick load pressed, cancelled because another is already in progress");
            }
        }
    }
Example #7
0
 public void ShowErrorDialog(string message, string title = "Error")
 {
     errorDialog.WindowTitle = title;
     errorDialog.DialogText  = message;
     errorDialog.PopupCenteredMinsize();
 }
Example #8
0
 private void OnKnownIncompatibleLoaded()
 {
     loadIncompatibleDialog.PopupCenteredMinsize();
 }