mirror of
https://github.com/ppy/osu.git
synced 2025-01-14 02:22:56 +08:00
Make DefaultBeatmap private get.
This commit is contained in:
parent
c8593a38c8
commit
35157ca6b8
@ -31,7 +31,7 @@ namespace osu.Game.Database
|
||||
/// <summary>
|
||||
/// A default representation of a WorkingBeatmap to use when no beatmap is available.
|
||||
/// </summary>
|
||||
public WorkingBeatmap DefaultBeatmap { get; set; }
|
||||
public WorkingBeatmap DefaultBeatmap { private get; set; }
|
||||
|
||||
public BeatmapDatabase(Storage storage, SQLiteConnection connection, RulesetDatabase rulesets, IIpcHost importHost = null) : base(storage, connection)
|
||||
{
|
||||
@ -273,7 +273,7 @@ namespace osu.Game.Database
|
||||
|
||||
public WorkingBeatmap GetWorkingBeatmap(BeatmapInfo beatmapInfo, WorkingBeatmap previous = null, bool withStoryboard = false)
|
||||
{
|
||||
if (beatmapInfo == DefaultBeatmap?.BeatmapInfo)
|
||||
if (beatmapInfo == null || beatmapInfo == DefaultBeatmap?.BeatmapInfo)
|
||||
return DefaultBeatmap;
|
||||
|
||||
if (beatmapInfo.BeatmapSet == null || beatmapInfo.Ruleset == null)
|
||||
|
@ -137,7 +137,7 @@ namespace osu.Game.Screens.Select
|
||||
{
|
||||
selectedGroup = null;
|
||||
selectedPanel = null;
|
||||
SelectionChanged?.Invoke(database.DefaultBeatmap.BeatmapInfo);
|
||||
SelectionChanged?.Invoke(null);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -219,31 +219,40 @@ namespace osu.Game.Screens.Select
|
||||
/// </summary>
|
||||
private void carouselSelectionChanged(BeatmapInfo beatmap)
|
||||
{
|
||||
selectionChangedDebounce?.Cancel();
|
||||
|
||||
if (beatmap.Equals(beatmapNoDebounce))
|
||||
return;
|
||||
|
||||
bool preview = beatmap.BeatmapSetInfoID != Beatmap.Value.BeatmapInfo.BeatmapSetInfoID;
|
||||
|
||||
if (beatmap.BeatmapSetInfoID == beatmapNoDebounce?.BeatmapSetInfoID)
|
||||
sampleChangeDifficulty.Play();
|
||||
else
|
||||
sampleChangeBeatmap.Play();
|
||||
|
||||
beatmapNoDebounce = beatmap;
|
||||
|
||||
Action performLoad = delegate
|
||||
{
|
||||
bool preview = beatmap?.BeatmapSetInfoID != Beatmap.Value.BeatmapInfo.BeatmapSetInfoID;
|
||||
|
||||
Beatmap.Value = database.GetWorkingBeatmap(beatmap, Beatmap);
|
||||
|
||||
ensurePlayingSelected(preview);
|
||||
changeBackground(Beatmap.Value);
|
||||
};
|
||||
|
||||
if (beatmap == Beatmap.Value.BeatmapInfo)
|
||||
performLoad();
|
||||
if (beatmap == null)
|
||||
{
|
||||
if (!Beatmap.IsDefault)
|
||||
performLoad();
|
||||
}
|
||||
else
|
||||
selectionChangedDebounce = Scheduler.AddDelayed(performLoad, 100);
|
||||
{
|
||||
selectionChangedDebounce?.Cancel();
|
||||
|
||||
if (beatmap.Equals(beatmapNoDebounce))
|
||||
return;
|
||||
|
||||
if (beatmap.BeatmapSetInfoID == beatmapNoDebounce?.BeatmapSetInfoID)
|
||||
sampleChangeDifficulty.Play();
|
||||
else
|
||||
sampleChangeBeatmap.Play();
|
||||
|
||||
beatmapNoDebounce = beatmap;
|
||||
|
||||
if (beatmap == Beatmap.Value.BeatmapInfo)
|
||||
performLoad();
|
||||
else
|
||||
selectionChangedDebounce = Scheduler.AddDelayed(performLoad, 100);
|
||||
}
|
||||
}
|
||||
|
||||
private void triggerRandom(UserInputManager input)
|
||||
|
Loading…
Reference in New Issue
Block a user