mirror of
https://github.com/osukey/osukey.git
synced 2025-08-05 07:33:55 +09:00
*Database -> *Store
Welcome back BeatmapManager
This commit is contained in:
@ -68,7 +68,7 @@ namespace osu.Game.Screens.Select
|
||||
/// <summary>
|
||||
/// Required for now unfortunately.
|
||||
/// </summary>
|
||||
private BeatmapStore store;
|
||||
private BeatmapManager manager;
|
||||
|
||||
private readonly Container<Panel> scrollableContent;
|
||||
|
||||
@ -289,7 +289,7 @@ namespace osu.Game.Screens.Select
|
||||
b.Metadata = beatmapSet.Metadata;
|
||||
}
|
||||
|
||||
return new BeatmapGroup(beatmapSet, store)
|
||||
return new BeatmapGroup(beatmapSet, manager)
|
||||
{
|
||||
SelectionChanged = (g, p) => selectGroup(g, p),
|
||||
StartRequested = b => StartRequested?.Invoke(),
|
||||
@ -298,9 +298,9 @@ namespace osu.Game.Screens.Select
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader(permitNulls: true)]
|
||||
private void load(BeatmapStore store, OsuConfigManager config)
|
||||
private void load(BeatmapManager manager, OsuConfigManager config)
|
||||
{
|
||||
this.store = store;
|
||||
this.manager = manager;
|
||||
|
||||
randomType = config.GetBindable<SelectionRandomType>(OsuSetting.SelectionRandomType);
|
||||
}
|
||||
|
@ -11,12 +11,12 @@ namespace osu.Game.Screens.Select
|
||||
{
|
||||
public class BeatmapDeleteDialog : PopupDialog
|
||||
{
|
||||
private BeatmapStore store;
|
||||
private BeatmapManager manager;
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(BeatmapStore beatmapStore)
|
||||
private void load(BeatmapManager beatmapManager)
|
||||
{
|
||||
store = beatmapStore;
|
||||
manager = beatmapManager;
|
||||
}
|
||||
|
||||
public BeatmapDeleteDialog(WorkingBeatmap beatmap)
|
||||
@ -34,7 +34,7 @@ namespace osu.Game.Screens.Select
|
||||
Action = () =>
|
||||
{
|
||||
beatmap.Dispose();
|
||||
store.Delete(beatmap.BeatmapSetInfo);
|
||||
manager.Delete(beatmap.BeatmapSetInfo);
|
||||
},
|
||||
},
|
||||
new PopupDialogCancelButton
|
||||
|
@ -28,7 +28,7 @@ namespace osu.Game.Screens.Select
|
||||
public abstract class SongSelect : OsuScreen
|
||||
{
|
||||
private readonly Bindable<RulesetInfo> ruleset = new Bindable<RulesetInfo>();
|
||||
private BeatmapStore store;
|
||||
private BeatmapManager manager;
|
||||
protected override BackgroundScreen CreateBackground() => new BackgroundScreenBeatmap();
|
||||
|
||||
private readonly BeatmapCarousel carousel;
|
||||
@ -154,7 +154,7 @@ namespace osu.Game.Screens.Select
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader(permitNulls: true)]
|
||||
private void load(BeatmapStore beatmaps, AudioManager audio, DialogOverlay dialog, OsuGame osu, OsuColour colours, UserInputManager input)
|
||||
private void load(BeatmapManager beatmaps, AudioManager audio, DialogOverlay dialog, OsuGame osu, OsuColour colours, UserInputManager input)
|
||||
{
|
||||
if (Footer != null)
|
||||
{
|
||||
@ -164,14 +164,14 @@ namespace osu.Game.Screens.Select
|
||||
BeatmapOptions.AddButton(@"Delete", @"Beatmap", FontAwesome.fa_trash, colours.Pink, promptDelete, Key.Number4, float.MaxValue);
|
||||
}
|
||||
|
||||
if (store == null)
|
||||
store = beatmaps;
|
||||
if (manager == null)
|
||||
manager = beatmaps;
|
||||
|
||||
if (osu != null)
|
||||
ruleset.BindTo(osu.Ruleset);
|
||||
|
||||
store.BeatmapSetAdded += onBeatmapSetAdded;
|
||||
store.BeatmapSetRemoved += onBeatmapSetRemoved;
|
||||
manager.BeatmapSetAdded += onBeatmapSetAdded;
|
||||
manager.BeatmapSetRemoved += onBeatmapSetRemoved;
|
||||
|
||||
dialogOverlay = dialog;
|
||||
|
||||
@ -180,7 +180,7 @@ namespace osu.Game.Screens.Select
|
||||
|
||||
initialAddSetsTask = new CancellationTokenSource();
|
||||
|
||||
carousel.Beatmaps = store.GetAllUsableBeatmapSets();
|
||||
carousel.Beatmaps = manager.GetAllUsableBeatmapSets();
|
||||
|
||||
Beatmap.ValueChanged += beatmap_ValueChanged;
|
||||
|
||||
@ -230,7 +230,7 @@ namespace osu.Game.Screens.Select
|
||||
{
|
||||
bool preview = beatmap?.BeatmapSetInfoID != Beatmap.Value.BeatmapInfo.BeatmapSetInfoID;
|
||||
|
||||
Beatmap.Value = store.GetWorkingBeatmap(beatmap, Beatmap);
|
||||
Beatmap.Value = manager.GetWorkingBeatmap(beatmap, Beatmap);
|
||||
ensurePlayingSelected(preview);
|
||||
}
|
||||
|
||||
@ -341,10 +341,10 @@ namespace osu.Game.Screens.Select
|
||||
{
|
||||
base.Dispose(isDisposing);
|
||||
|
||||
if (store != null)
|
||||
if (manager != null)
|
||||
{
|
||||
store.BeatmapSetAdded -= onBeatmapSetAdded;
|
||||
store.BeatmapSetRemoved -= onBeatmapSetRemoved;
|
||||
manager.BeatmapSetAdded -= onBeatmapSetAdded;
|
||||
manager.BeatmapSetRemoved -= onBeatmapSetRemoved;
|
||||
}
|
||||
|
||||
initialAddSetsTask?.Cancel();
|
||||
|
Reference in New Issue
Block a user