public void NotAvailableOnXNA() { if (!SystemInfo.IsRunningOnMonogame ()) { ConfirmDialog confirm = new ConfirmDialog ( screen: Screens.Peek (), drawOrder: DisplayLayer.Dialog, title: "Old Runtime Environment", text: "This feature is not available in the XNA version of this game.\nDo you want to download the MonoGame version?" ); confirm.Bounds.Size = new ScreenPoint (Screens.Peek (), 0.800f, 0.400f); confirm.Cancel += (l) => { }; confirm.Submit += (r) => { Process.Start ("https://github.com/pse-knot/knot3-code/releases"); Exit (); }; Screens.Peek ().AddGameComponents (null, confirm); } }
/// <summary> /// Wird aufgerufen, wenn auf den Button zum Erstellen der Challenge gedrückt wird /// </summary> private void OnCreateChallenge(GameTime time) { if (TryConstructChallenge ()) { Log.Debug ("Save Challenge: ", selectedChallenge); try { selectedChallenge.Save (false); NextScreen = new ChallengeStartScreen (Game); } catch (FileAlreadyExistsException) { ConfirmDialog confirm = new ConfirmDialog ( screen: this, drawOrder: DisplayLayer.Dialog, title: "Warning", text: "Do you want to overwrite the existing challenge?" ); confirm.Submit += (r) => { selectedChallenge.Save (true); NextScreen = new ChallengeStartScreen (Game); }; AddGameComponents (null, confirm); } } }
private void KnotSaveAs(Action onClose, GameTime time) { TextInputDialog saveDialog = new TextInputDialog ( screen: Screen, drawOrder: DisplayLayer.Dialog, title: "Save Knot", text: "Name:", inputText: knot.Name != null ? knot.Name : String.Empty ); saveDialog.NoCloseEmpty = true; saveDialog.NoWhiteSpace = true; saveDialog.Text = "Press Enter to save the Knot."; Screen.AddGameComponents (null, saveDialog); saveDialog.Submit += (t) => { try { knot.Name = saveDialog.InputText; knot.Save (false); onClose (); } catch (FileAlreadyExistsException) { ConfirmDialog confirm = new ConfirmDialog ( screen: Screen, drawOrder: DisplayLayer.Dialog, title: "Warning", text: "Do you want to overwrite the existing knot?" ); confirm.Cancel += (l) => { KnotSaveAs (() => onClose (), time); }; confirm.Submit += (r) => { knot.Save (true); onClose (); }; Screen.AddGameComponents (null, confirm); } }; }