예제 #1
0
    public void FileButtonPressed(int id)
    {
        GD.Print(id);
        switch (id)
        {
        case 0:
            break;

        case 1:
            break;

        case 2:
            ImportWindow.PopupCentered();
            break;

        case 4:
            break;

        case 7:
            PreferencesWindow.PopupCentered();
            EmitSignal("PreferencesPressed");
            break;

        case 8:
            break;

        default:
            break;
        }
    }
예제 #2
0
    /// <summary>
    ///   Shows an error dialog
    /// </summary>
    /// <param name="title">Title of the dialog to show</param>
    /// <param name="message">Message to show</param>
    /// <param name="exception">Extra / exception info to show</param>
    /// <param name="returnToMenu">
    ///   If true closing the dialog returns to menu. If false the dialog is just closed (and game is unpaused)
    /// </param>
    /// <param name="onClosed">Callback for when the dialog is closed</param>
    public void ShowError(string title, string message, string exception, bool returnToMenu = false,
                          Action onClosed = null)
    {
        errorDialog.WindowTitle    = title;
        extraDescriptionLabel.Text = message;
        exceptionLabel.Text        = exception;
        errorDialog.PopupCentered();

        onDialogDismissReturnToMenu = returnToMenu;
        onDialogCloseCallback       = onClosed;
    }
예제 #3
0
        private void OnNodeSelectorSelected(int idx)
        {
            _nodeSelectorDialog.Hide();
            var nodeName = _nodeSelectorDialog.GetNode <ItemList>("VBoxContainer/ItemList").GetItemText(idx);

            if (nodeName == nameof(QuestEventNode))
            {
                _eventSelectorDialog.PopupCentered();
                return;
            }
            var node = _resourcePreloader.InstanceScene <QuestNode>(nodeName);

            AddQuestNode(node);
        }
예제 #4
0
 public override void _Process(float delta)
 {
     if (!Input.IsActionJustPressed("ui_cancel") || Popup != null)
     {
         return;
     }
     Popup = PopupScene.Instance <WindowDialog>();
     Popup.GetNode("Button_quit").Connect("pressed", this, nameof(PopupQuit));
     Popup.Connect("popup_hide", this, nameof(PopupClosed));
     Popup.GetNode("Button_resume").Connect("pressed", this, nameof(PopupClosed));
     CanvasLayer.AddChild(Popup);
     Popup.PopupCentered();
     Input.SetMouseMode(Input.MouseMode.Visible);
     GetTree().Paused = true;
 }
예제 #5
0
    public void OnFilePressed(int id)
    {
        switch (id)
        {
        case 0:     // new
            WindowDialog dialog = (WindowDialog)GetNode(newGlobe);
            dialog.PopupCentered();
            break;

        case 1:     // open
            FileDialog open = (FileDialog)GetNode(openGlobe);
            open.PopupCentered();
            break;

        case 3:     // save
            if (lastSave != null)
            {
                image.SavePng(lastSave);
            }
            else
            {
                FileDialog save1 = (FileDialog)GetNode(saveGlobe);
                save1.PopupCentered();
            }
            break;

        case 4:     // save as
            FileDialog save2 = (FileDialog)GetNode(saveGlobe);
            save2.PopupCentered();
            break;

        case 6:     // quit
            GetTree().Quit();
            break;
        }
    }
예제 #6
0
 void OnHostGameButtonPressed()
 {
     Hide();
     hostWindow.PopupCentered();
 }
예제 #7
0
 void OnJoinGameButtonPressed()
 {
     Hide();
     joinWindow.PopupCentered();
 }