Song select filtering#299
Conversation
| 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.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| { | ||
| var importer = new BeatmapImporter(host); | ||
|
|
||
| Directory.SetCurrentDirectory(cwd); |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| { | ||
| LegacyFilesystemReader.Register(); | ||
|
|
||
| var cwd = Directory.GetCurrentDirectory(); |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| set | ||
| { | ||
| state = value; | ||
| public bool Hidden; |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| { | ||
| Beatmap = beatmap; | ||
| if (beatmap == null) | ||
| Add(background = new Background(@"Backgrounds/bg1")); |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| } | ||
| } | ||
|
|
||
| public void InvalidateVisible() |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| { | ||
| public class FilterControl : Container | ||
| { | ||
| public enum SortMode |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
|
||
| public Action FilterChanged; | ||
|
|
||
| public string Search { get; private set; } = string.Empty; |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
|
||
| private void filterChanged() | ||
| { | ||
| if (filterTask != null) |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| 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.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| || (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.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| { | ||
| changed = changed && !beatmapGroup.Hidden; | ||
| beatmapGroup.Hidden = false; | ||
| beatmapGroup.Header.Alpha = 1; |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| { | ||
| changed = changed && beatmapGroup.Hidden; | ||
| beatmapGroup.Hidden = true; | ||
| beatmapGroup.Header.Alpha = 0; |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
I did consider that, but it complicates things, imo a bit too much. |
|
|
||
| private BeatmapGroupState state; | ||
|
|
||
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| break; | ||
| case BeatmapGroupState.Collapsed: | ||
| case BeatmapGroupState.Hidden: | ||
| if (state == BeatmapGroupState.Hidden && state != value) |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| { | ||
| base.OnEntering(last); | ||
|
|
||
| (Background as BackgroundModeBeatmap)?.BlurTo(Vector2.Zero, 1000); |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
|
||
| //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.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| panel.MoveToY(headerY); | ||
|
|
||
| movePanel(panel, true, ref currentY); | ||
| movePanel(panel, group.State != BeatmapGroupState.Hidden, ref currentY); |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| SelectGroup(group, panel); | ||
| } | ||
|
|
||
| public IEnumerator<BeatmapGroup> GetEnumerator() |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| return groups.GetEnumerator(); | ||
| } | ||
|
|
||
| IEnumerator IEnumerable.GetEnumerator() |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
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.
|
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.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
cd0725d to
437cc83
Compare
| || (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.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
8c1eb6f to
52fb345
Compare
Includes basic sorting+grouping UI, implementation to come separately.