Exemple #1
0
        private void load(OsuColour colours, AudioManager audio, BeatmapManager beatmaps, DialogOverlay dialogOverlay)
        {
            sampleConfirm = audio.Sample.Get(@"SongSelect/confirm-selection");

            Footer.AddButton(@"mods", colours.Yellow, modSelect, Key.F1, float.MaxValue);

            BeatmapOptions.AddButton(@"Remove", @"from unplayed", FontAwesome.fa_times_circle_o, colours.Purple, null, Key.Number1);
            BeatmapOptions.AddButton(@"Clear", @"local scores", FontAwesome.fa_eraser, colours.Purple, null, Key.Number2);
            BeatmapOptions.AddButton(@"Edit", @"Beatmap", FontAwesome.fa_pencil, colours.Yellow, () =>
            {
                ValidForResume = false;
                Push(new Editor());
            }, Key.Number3);

            if (dialogOverlay != null)
            {
                Schedule(() =>
                {
                    // if we have no beatmaps but osu-stable is found, let's prompt the user to import.
                    if (!beatmaps.GetAllUsableBeatmapSets().Any() && beatmaps.StableInstallationAvailable)
                    {
                        dialogOverlay.Push(new ImportFromStablePopup(() => beatmaps.ImportFromStable()));
                    }
                });
            }
        }
Exemple #2
0
 private void load(BeatmapManager beatmaps)
 {
     Children = new Drawable[]
     {
         importButton = new OsuButton
         {
             RelativeSizeAxes = Axes.X,
             Text             = "Import beatmaps from stable",
             Action           = () =>
             {
                 importButton.Enabled.Value = false;
                 Task.Run(() => beatmaps.ImportFromStable()).ContinueWith(t => Schedule(() => importButton.Enabled.Value = true));
             }
         },
         deleteButton = new OsuButton
         {
             RelativeSizeAxes = Axes.X,
             Text             = "Delete ALL beatmaps",
             Action           = () =>
             {
                 deleteButton.Enabled.Value = false;
                 Task.Run(() => beatmaps.DeleteAll()).ContinueWith(t => Schedule(() => deleteButton.Enabled.Value = true));
             }
         },
     };
 }
Exemple #3
0
 private void load(BeatmapManager beatmaps, DialogOverlay dialogOverlay)
 {
     Children = new Drawable[]
     {
         importButton = new SettingsButton
         {
             Text   = "Import beatmaps from stable",
             Action = () =>
             {
                 importButton.Enabled.Value = false;
                 beatmaps.ImportFromStable().ContinueWith(t => Schedule(() => importButton.Enabled.Value = true));
             }
         },
         deleteButton = new DangerousSettingsButton
         {
             Text   = "Delete ALL beatmaps",
             Action = () =>
             {
                 dialogOverlay?.Push(new DeleteAllBeatmapsDialog(() =>
                 {
                     deleteButton.Enabled.Value = false;
                     Task.Run(() => beatmaps.DeleteAll()).ContinueWith(t => Schedule(() => deleteButton.Enabled.Value = true));
                 }));
             }
         },
         restoreButton = new SettingsButton
         {
             Text   = "Restore all hidden difficulties",
             Action = () =>
             {
                 restoreButton.Enabled.Value = false;
                 Task.Run(() =>
                 {
                     foreach (var b in beatmaps.QueryBeatmaps(b => b.Hidden).ToList())
                     {
                         beatmaps.Restore(b);
                     }
                 }).ContinueWith(t => Schedule(() => restoreButton.Enabled.Value = true));
             }
         },
         undeleteButton = new SettingsButton
         {
             Text   = "Restore all recently deleted beatmaps",
             Action = () =>
             {
                 undeleteButton.Enabled.Value = false;
                 Task.Run(() => beatmaps.UndeleteAll()).ContinueWith(t => Schedule(() => undeleteButton.Enabled.Value = true));
             }
         },
     };
 }
Exemple #4
0
 private void load(BeatmapManager beatmaps)
 {
     Children = new Drawable[]
     {
         importButton = new OsuButton
         {
             RelativeSizeAxes = Axes.X,
             Text             = "Import beatmaps from stable",
             Action           = () =>
             {
                 importButton.Enabled.Value = false;
                 Task.Run(() => beatmaps.ImportFromStable()).ContinueWith(t => Schedule(() => importButton.Enabled.Value = true));
             }
         },
         deleteButton = new OsuButton
         {
             RelativeSizeAxes = Axes.X,
             Text             = "Delete ALL beatmaps",
             Action           = () =>
             {
                 deleteButton.Enabled.Value = false;
                 Task.Run(() => beatmaps.DeleteAll()).ContinueWith(t => Schedule(() => deleteButton.Enabled.Value = true));
             }
         },
         restoreButton = new OsuButton
         {
             RelativeSizeAxes = Axes.X,
             Text             = "Restore all hidden difficulties",
             Action           = () =>
             {
                 restoreButton.Enabled.Value = false;
                 Task.Run(() =>
                 {
                     foreach (var b in beatmaps.QueryBeatmaps(b => b.Hidden))
                     {
                         beatmaps.Restore(b);
                     }
                 }).ContinueWith(t => Schedule(() => restoreButton.Enabled.Value = true));
             }
         },
     };
 }