/// <summary> /// </summary> private void CreateVisitMapsetPageButton() { VisitMapsetPageButton = new TextButton(UserInterface.BlankBox, Fonts.Exo2Medium, "Visit Mapset Page", 14, (o, e) => { BrowserHelper.OpenURL($"{OnlineClient.WEBSITE_URL}/mapsets/{Response.MapsetId}"); DialogManager.Dismiss(this); var game = GameBase.Game as QuaverGame; var screen = game?.CurrentScreen as EditorScreen; screen.UploadInProgress = false; if (Response.Code != MapsetSubmissionStatusCode.SuccessUpdated && Response.Code != MapsetSubmissionStatusCode.SuccessUploaded) { return; } game?.CurrentScreen.Exit(() => new EditorScreen(MapManager.Selected.Value.LoadQua(false))); }) { Parent = ContainingBox, Alignment = Alignment.TopCenter, Y = LoadingWheel.Y + 10, UsePreviousSpriteBatchOptions = true, Size = new ScalableVector2(200, 40), Tint = Color.Transparent, Text = { Tint = Colors.MainAccent, Font = Fonts.Exo2SemiBold } }; VisitMapsetPageButton.AddBorder(Colors.MainAccent, 2); }
/// <summary> /// Creates the button to cancel the dialog. /// </summary> private void CreateCancelButton() { CancelButton = new TextButton(UserInterface.BlankBox, Fonts.Exo2Medium, "Cancel", 14, (o, e) => Dismiss("Cancel Button")) { Parent = AreYouSure, Y = DividerLine.Y + DividerLine.Height + 25, UsePreviousSpriteBatchOptions = true, X = QuitButton.X + QuitButton.Width + 25, Size = new ScalableVector2(200, 40), Tint = Color.Transparent, Text = { Tint = Colors.MainAccent } }; CancelButton.AddBorder(Colors.MainAccent, 2); }
/// <summary> /// Creates the button to quit the game. /// </summary> private void CreateSureButton() { SureButton = new TextButton(UserInterface.BlankBox, Fonts.Exo2Medium, "Sure", 14, (o, e) => { var modeBeforeSave = Screen.WorkingMap.Mode; Changer.Container.Items.ForEach(x => x.SaveValue(x.GetValue())); // Need to handle the game mode change. if (modeBeforeSave != Screen.WorkingMap.Mode) { Logger.Important($"Game mode changed from: {modeBeforeSave} to {Screen.WorkingMap.Mode}", LogType.Runtime); // Mode changed from 7k to 4k, so get rid of all the 4k HitObjects if (modeBeforeSave == GameMode.Keys7) { Screen.WorkingMap.HitObjects.RemoveAll(x => x.Lane > 4); } // Need to destroy/remake the scroll container. var ruleset = Screen.Ruleset as EditorRulesetKeys; ruleset?.ScrollContainer.Destroy(); ruleset?.CreateScrollContainer(); } Screen.Save(); Dismiss(); Changer.Dialog.Close(); }) { Parent = AreYouSure, Y = DividerLine.Y + DividerLine.Height + 25, UsePreviousSpriteBatchOptions = true, Size = new ScalableVector2(200, 40), Tint = Color.Transparent, Text = { Tint = Color.LimeGreen } }; SureButton.AddBorder(Color.LimeGreen, 2); }
/// <summary> /// Creates the button to quit the game. /// </summary> private void CreateSureButton() { SureButton = new TextButton(UserInterface.BlankBox, Fonts.Exo2Medium, "Sure", 14, (o, e) => { OnConfirm(o, e); Dismiss(); }) { Parent = DividerLine, Y = 20, UsePreviousSpriteBatchOptions = true, Size = new ScalableVector2(200, 40), Tint = Color.Transparent, Text = { Tint = Color.LimeGreen } }; SureButton.X = -SureButton.Width / 2f - 10; SureButton.AddBorder(Color.LimeGreen, 2); }
/// <summary> /// </summary> private void CreateNoButton() { NoButton = new TextButton(UserInterface.BlankBox, Fonts.Exo2Medium, "No", 14, (o, e) => { DialogManager.Dismiss(this); Screen.CreateNewDifficulty(); }) { Parent = DividerLine, Y = 20, UsePreviousSpriteBatchOptions = true, Size = new ScalableVector2(200, 40), Tint = Color.Transparent, Text = { Tint = Colors.MainAccent } }; NoButton.X = -NoButton.Width / 2f - 10; NoButton.AddBorder(Color.Gold, 2); }
/// <summary> /// Creates the button to quit the game. /// </summary> private void CreateQuitButton() { QuitButton = new TextButton(UserInterface.BlankBox, Fonts.Exo2Medium, "Quit", 14, (o, e) => { Logger.Debug($"Exiting game via QuitDialog", LogType.Runtime); var game = GameBase.Game as QuaverGame; game?.Exit(); }) { Parent = AreYouSure, Y = DividerLine.Y + DividerLine.Height + 25, UsePreviousSpriteBatchOptions = true, Size = new ScalableVector2(200, 40), Tint = Color.Transparent, Text = { Tint = Color.Crimson } }; QuitButton.AddBorder(Color.Crimson, 2); }
/// <summary> /// Creates the button to cancel the dialog. /// </summary> private void CreateCancelButton() { CancelButton = new TextButton(UserInterface.BlankBox, Fonts.Exo2Medium, "Cancel", 14, (o, e) => { OnCancel?.Invoke(o, e); Dismiss(); }) { Parent = DividerLine, Y = SureButton.Y, UsePreviousSpriteBatchOptions = true, X = SureButton.X + SureButton.Width + 25, Size = new ScalableVector2(200, 40), Tint = Color.Transparent, Text = { Tint = Color.Crimson } }; CancelButton.X = CancelButton.Width / 2f + 10; CancelButton.AddBorder(Color.Crimson, 2); }