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; } }
/// <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; }
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); }
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; }
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; } }
void OnHostGameButtonPressed() { Hide(); hostWindow.PopupCentered(); }
void OnJoinGameButtonPressed() { Hide(); joinWindow.PopupCentered(); }