/// <inheritdoc /> /// <summary> /// </summary> /// <param name="screen"></param> /// <param name="leftAlignedItems"></param> /// <param name="rightAlignedItems"></param> /// <param name="isUpsideDown"></param> public NavbarMain(QuaverScreen screen, List <NavbarItem> leftAlignedItems, List <NavbarItem> rightAlignedItems, bool isUpsideDown = false) : base(leftAlignedItems, rightAlignedItems, isUpsideDown) { // Add community chat button DownloadMapsButton = new NavbarItem("Download", screen.Type == QuaverScreenType.Download) { DestroyIfParentIsNull = false }; DownloadMapsButton.Clicked += (o, e) => OnDownloadMapsButtonClicked(); // Add community chat button OpenChatButton = new NavbarItem("Community Chat") { DestroyIfParentIsNull = false }; OpenChatButton.Clicked += (o, e) => ChatManager.ToggleChatOverlay(true); // Make sure all online buttons are there if applicable if (OnlineManager.Status.Value == ConnectionStatus.Connected || OnlineManager.Status.Value == ConnectionStatus.Reconnecting) { LeftAlignedItems.Add(DownloadMapsButton); LeftAlignedItems.Add(OpenChatButton); AlignLeftItems(); } OnlineManager.Status.ValueChanged += OnOnlineStatusChanged; if (OnlineManager.Client != null) { OnlineManager.Client.OnLoginSuccess += OnLoginSuccess; } }
/// <summary> /// </summary> /// <param name="screen"></param> /// <param name="file"></param> private static void OnConfirm(QuaverScreen screen, string file) { for (var i = DialogManager.Dialogs.Count - 1; i >= 0; i--) { DialogManager.Dialogs[i].Destroy(); DialogManager.Dialogs.Remove(DialogManager.Dialogs[i]); } DialogManager.Update(new GameTime()); if (!MapDatabaseCache.MapsToUpdate.Contains(MapManager.Selected.Value)) { MapDatabaseCache.MapsToUpdate.Add(MapManager.Selected.Value); } screen.Exit(() => { try { return(new EditorScreen(Qua.Parse(file, false))); } catch (Exception exception) { Logger.Error(exception, LogType.Runtime); NotificationManager.Show(NotificationLevel.Error, "Failed to reload editor. Is your .qua file invalid?"); return(new SelectScreen()); } }); }
/// <inheritdoc /> /// <summary> /// </summary> /// <param name="screen"></param> /// <param name="file"></param> public EditorChangesDetectedConfirmationDialog(QuaverScreen screen, string file) : base("Detected outside changes to the .qua file. Would you like to reload the editor?", (o, e) => OnConfirm(screen, file)) { }
/// <inheritdoc /> /// <summary> /// </summary> /// <param name="screen"></param> /// <param name="offset"></param> public OffsetConfirmDialog(QuaverScreen screen, int offset) : base($"Your suggested offset is: {offset} ms. Would you like to use this?", (o, e) => OnOffsetConfirm(screen, offset), (o, e) => OnCancel(screen)) => Screen = screen;