mirror of
https://github.com/ppy/osu.git
synced 2025-02-15 18:13:09 +08:00
Fixes following recent updates upstream
This commit is contained in:
parent
417933b7ec
commit
f3c5c1f0b8
@ -33,6 +33,8 @@ namespace osu.Game.Beatmaps.Drawables
|
||||
|
||||
public BeatmapSetInfo BeatmapSet;
|
||||
|
||||
public bool Hidden;
|
||||
|
||||
public BeatmapGroupState State
|
||||
{
|
||||
get { return state; }
|
||||
|
@ -99,7 +99,7 @@ namespace osu.Game.Screens.Menu
|
||||
{
|
||||
Action = onOsuLogo,
|
||||
Origin = Anchor.Centre,
|
||||
Anchor = Anchor.Centre
|
||||
Anchor = Anchor.Centre,
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -101,7 +101,7 @@ namespace osu.Game.Screens.Select
|
||||
yPositions.Add(currentY);
|
||||
panel.MoveToY(currentY, 750, EasingTypes.OutExpo);
|
||||
|
||||
if (advance && panel.IsVisible)
|
||||
if (advance)
|
||||
currentY += panel.DrawHeight + 5;
|
||||
}
|
||||
|
||||
@ -118,7 +118,7 @@ namespace osu.Game.Screens.Select
|
||||
|
||||
foreach (BeatmapGroup group in groups)
|
||||
{
|
||||
movePanel(group.Header, true, ref currentY);
|
||||
movePanel(group.Header, !group.Hidden, ref currentY);
|
||||
|
||||
if (group.State == BeatmapGroupState.Expanded)
|
||||
{
|
||||
@ -133,10 +133,10 @@ namespace osu.Game.Screens.Select
|
||||
panel.MoveToX(-50, 500, EasingTypes.OutExpo);
|
||||
|
||||
//on first display we want to begin hidden under our group's header.
|
||||
if (panel.Alpha == 0)
|
||||
if (panel.Alpha == 0 && !group.Hidden)
|
||||
panel.MoveToY(headerY);
|
||||
|
||||
movePanel(panel, true, ref currentY);
|
||||
movePanel(panel, !group.Hidden, ref currentY);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -32,6 +32,7 @@ using osu.Framework.Input;
|
||||
using OpenTK.Input;
|
||||
using osu.Game.Graphics;
|
||||
using System.Collections.Generic;
|
||||
using osu.Framework.Threading;
|
||||
|
||||
namespace osu.Game.Screens.Select
|
||||
{
|
||||
@ -209,39 +210,50 @@ namespace osu.Game.Screens.Select
|
||||
Task.Factory.StartNew(() => addBeatmapSets(game, initialAddSetsTask.Token), initialAddSetsTask.Token);
|
||||
}
|
||||
|
||||
private ScheduledDelegate filterTask;
|
||||
|
||||
private void filterChanged()
|
||||
{
|
||||
var search = filter.Search;
|
||||
BeatmapGroup newSelection = null;
|
||||
bool changed = false;
|
||||
foreach (var beatmapGroup in carousel)
|
||||
if (filterTask != null)
|
||||
filterTask.Cancel();
|
||||
filterTask = Scheduler.AddDelayed(() =>
|
||||
{
|
||||
var set = beatmapGroup.BeatmapSet;
|
||||
if (set == null)
|
||||
continue;
|
||||
bool match = string.IsNullOrEmpty(search)
|
||||
|| (set.Metadata.Artist ?? "").IndexOf(search, StringComparison.InvariantCultureIgnoreCase) != -1
|
||||
|| (set.Metadata.ArtistUnicode ?? "").IndexOf(search, StringComparison.InvariantCultureIgnoreCase) != -1
|
||||
|| (set.Metadata.Title ?? "").IndexOf(search, StringComparison.InvariantCultureIgnoreCase) != -1
|
||||
|| (set.Metadata.TitleUnicode ?? "").IndexOf(search, StringComparison.InvariantCultureIgnoreCase) != -1;
|
||||
if (match)
|
||||
filterTask = null;
|
||||
var search = filter.Search;
|
||||
BeatmapGroup newSelection = null;
|
||||
bool changed = false;
|
||||
foreach (var beatmapGroup in carousel)
|
||||
{
|
||||
changed = changed && beatmapGroup.Header.Alpha == 1;
|
||||
beatmapGroup.Header.Alpha = 1;
|
||||
if (newSelection == null || beatmapGroup.BeatmapSet.OnlineBeatmapSetID == Beatmap.BeatmapSetInfo.OnlineBeatmapSetID)
|
||||
newSelection = beatmapGroup;
|
||||
var set = beatmapGroup.BeatmapSet;
|
||||
if (set == null)
|
||||
continue;
|
||||
bool match = string.IsNullOrEmpty(search)
|
||||
|| (set.Metadata.Artist ?? "").IndexOf(search, StringComparison.InvariantCultureIgnoreCase) != -1
|
||||
|| (set.Metadata.ArtistUnicode ?? "").IndexOf(search, StringComparison.InvariantCultureIgnoreCase) != -1
|
||||
|| (set.Metadata.Title ?? "").IndexOf(search, StringComparison.InvariantCultureIgnoreCase) != -1
|
||||
|| (set.Metadata.TitleUnicode ?? "").IndexOf(search, StringComparison.InvariantCultureIgnoreCase) != -1;
|
||||
if (match)
|
||||
{
|
||||
changed = changed && !beatmapGroup.Hidden;
|
||||
beatmapGroup.Hidden = false;
|
||||
beatmapGroup.Header.Alpha = 1;
|
||||
if (newSelection == null || beatmapGroup.BeatmapSet.OnlineBeatmapSetID == Beatmap.BeatmapSetInfo.OnlineBeatmapSetID)
|
||||
newSelection = beatmapGroup;
|
||||
}
|
||||
else
|
||||
{
|
||||
changed = changed && beatmapGroup.Hidden;
|
||||
beatmapGroup.Hidden = true;
|
||||
beatmapGroup.Header.Alpha = 0;
|
||||
beatmapGroup.Header.Masking = false;
|
||||
beatmapGroup.State = BeatmapGroupState.Collapsed;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
changed = changed && beatmapGroup.Header.Alpha == 0;
|
||||
beatmapGroup.Header.Alpha = 0;
|
||||
beatmapGroup.State = BeatmapGroupState.Collapsed;
|
||||
}
|
||||
}
|
||||
if (newSelection != null)
|
||||
selectBeatmap(newSelection.BeatmapSet.Beatmaps[0]);
|
||||
if (changed)
|
||||
carousel.InvalidateVisible();
|
||||
if (newSelection != null)
|
||||
selectBeatmap(newSelection.BeatmapSet.Beatmaps[0]);
|
||||
if (changed || true)
|
||||
carousel.InvalidateVisible();
|
||||
}, 250);
|
||||
}
|
||||
|
||||
private void onDatabaseOnBeatmapSetAdded(BeatmapSetInfo s)
|
||||
|
Loading…
Reference in New Issue
Block a user