Skip to content

Song select filtering#299

Merged
peppy merged 45 commits intoppy:masterfrom
ddevault:song-select-filtering
Feb 3, 2017
Merged

Song select filtering#299
peppy merged 45 commits intoppy:masterfrom
ddevault:song-select-filtering

Conversation

@ddevault
Copy link
Copy Markdown
Contributor

Includes basic sorting+grouping UI, implementation to come separately.

Comment thread osu.Desktop/Program.cs Outdated
if (!importer.Import(Path.GetFullPath(file)).Wait(3000))
throw new TimeoutException(@"IPC took too long to send");
Console.WriteLine(@"Sent import requests to running instance");
Thread.Sleep(500);

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

Comment thread osu.Desktop/Program.cs
{
var importer = new BeatmapImporter(host);

Directory.SetCurrentDirectory(cwd);

This comment was marked as off-topic.

This comment was marked as off-topic.

Comment thread osu.Desktop/Program.cs Outdated
{
LegacyFilesystemReader.Register();

var cwd = Directory.GetCurrentDirectory();

This comment was marked as off-topic.

This comment was marked as off-topic.

set
{
state = value;
public bool Hidden;

This comment was marked as off-topic.

This comment was marked as off-topic.

{
Beatmap = beatmap;
if (beatmap == null)
Add(background = new Background(@"Backgrounds/bg1"));

This comment was marked as off-topic.

}
}

public void InvalidateVisible()

This comment was marked as off-topic.

This comment was marked as off-topic.

{
public class FilterControl : Container
{
public enum SortMode

This comment was marked as off-topic.


public Action FilterChanged;

public string Search { get; private set; } = string.Empty;

This comment was marked as off-topic.


private void filterChanged()
{
if (filterTask != null)

This comment was marked as off-topic.

foreach (var beatmapGroup in carousel)
{
var set = beatmapGroup.BeatmapSet;
if (set == null)

This comment was marked as off-topic.

This comment was marked as off-topic.

|| (set.Metadata.TitleUnicode ?? "").IndexOf(search, StringComparison.InvariantCultureIgnoreCase) != -1;
if (match)
{
changed = changed && !beatmapGroup.Hidden;

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

{
changed = changed && !beatmapGroup.Hidden;
beatmapGroup.Hidden = false;
beatmapGroup.Header.Alpha = 1;

This comment was marked as off-topic.

{
changed = changed && beatmapGroup.Hidden;
beatmapGroup.Hidden = true;
beatmapGroup.Header.Alpha = 0;

This comment was marked as off-topic.

@peppy
Copy link
Copy Markdown
Member

peppy commented Jan 28, 2017

  • Escape key doesn't work at song select any more.
  • Consider making the Hidden thing a state of BeatmapGroupState rather than this bool Hidden poop.

@ddevault
Copy link
Copy Markdown
Contributor Author

Consider making the Hidden thing a state of BeatmapGroupState rather than this bool Hidden poop.

I did consider that, but it complicates things, imo a bit too much.


private BeatmapGroupState state;

This comment was marked as off-topic.

break;
case BeatmapGroupState.Collapsed:
case BeatmapGroupState.Hidden:
if (state == BeatmapGroupState.Hidden && state != value)

This comment was marked as off-topic.

{
base.OnEntering(last);

(Background as BackgroundModeBeatmap)?.BlurTo(Vector2.Zero, 1000);

This comment was marked as off-topic.


//on first display we want to begin hidden under our group's header.
if (panel.Alpha == 0)
if (panel.Alpha == 0 && group.State != BeatmapGroupState.Hidden)

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

panel.MoveToY(headerY);

movePanel(panel, true, ref currentY);
movePanel(panel, group.State != BeatmapGroupState.Hidden, ref currentY);

This comment was marked as off-topic.

SelectGroup(group, panel);
}

public IEnumerator<BeatmapGroup> GetEnumerator()

This comment was marked as off-topic.

return groups.GetEnumerator();
}

IEnumerator IEnumerable.GetEnumerator()

This comment was marked as off-topic.

ddevault and others added 9 commits February 1, 2017 19:12
OnCommit only gets fired when focus is lost
Frustratingly, this does not fix the problem of ghost groups
I had earlier thought that removing this would solve the weirdness with
starting the beatmap on any but the first difficulty, and forgot to
replace it when I found the actual cause.
@peppy
Copy link
Copy Markdown
Member

peppy commented Feb 2, 2017

Posted fixes for remaining issues at ddevault#1.

Fixes inconsistencies and shortcomings of filtering.
{
Background newBackground = new BeatmapBackground(beatmap);
Background newBackground;
if (beatmap == null)

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

@ddevault ddevault force-pushed the song-select-filtering branch from cd0725d to 437cc83 Compare February 2, 2017 17:23
|| (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)

This comment was marked as off-topic.

This comment was marked as off-topic.

@ddevault ddevault force-pushed the song-select-filtering branch from 8c1eb6f to 52fb345 Compare February 3, 2017 01:37
@peppy peppy merged commit e0868d2 into ppy:master Feb 3, 2017
@ddevault ddevault deleted the song-select-filtering branch February 3, 2017 04:37
@Tom94 Tom94 mentioned this pull request Feb 5, 2017
35 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants