mirror of
https://github.com/osukey/osukey.git
synced 2025-08-03 22:56:36 +09:00
Merge pull request #19124 from frenzibyte/song-select-metadata-search
Change clicking source/tags on song select to filter instead of searching online
This commit is contained in:
@ -1,8 +1,6 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
#nullable disable
|
||||
|
||||
using System.Linq;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Extensions.Color4Extensions;
|
||||
@ -38,15 +36,18 @@ namespace osu.Game.Screens.Select
|
||||
private readonly LoadingLayer loading;
|
||||
|
||||
[Resolved]
|
||||
private IAPIProvider api { get; set; }
|
||||
private IAPIProvider api { get; set; } = null!;
|
||||
|
||||
private IBeatmapInfo beatmapInfo;
|
||||
[Resolved]
|
||||
private SongSelect? songSelect { get; set; }
|
||||
|
||||
private APIFailTimes failTimes;
|
||||
private IBeatmapInfo? beatmapInfo;
|
||||
|
||||
private int[] ratings;
|
||||
private APIFailTimes? failTimes;
|
||||
|
||||
public IBeatmapInfo BeatmapInfo
|
||||
private int[]? ratings;
|
||||
|
||||
public IBeatmapInfo? BeatmapInfo
|
||||
{
|
||||
get => beatmapInfo;
|
||||
set
|
||||
@ -56,7 +57,7 @@ namespace osu.Game.Screens.Select
|
||||
beatmapInfo = value;
|
||||
|
||||
var onlineInfo = beatmapInfo as IBeatmapOnlineInfo;
|
||||
var onlineSetInfo = beatmapInfo.BeatmapSet as IBeatmapSetOnlineInfo;
|
||||
var onlineSetInfo = beatmapInfo?.BeatmapSet as IBeatmapSetOnlineInfo;
|
||||
|
||||
failTimes = onlineInfo?.FailTimes;
|
||||
ratings = onlineSetInfo?.Ratings;
|
||||
@ -140,9 +141,9 @@ namespace osu.Game.Screens.Select
|
||||
LayoutEasing = Easing.OutQuad,
|
||||
Children = new[]
|
||||
{
|
||||
description = new MetadataSection(MetadataType.Description),
|
||||
source = new MetadataSection(MetadataType.Source),
|
||||
tags = new MetadataSection(MetadataType.Tags),
|
||||
description = new MetadataSection(MetadataType.Description, searchOnSongSelect),
|
||||
source = new MetadataSection(MetadataType.Source, searchOnSongSelect),
|
||||
tags = new MetadataSection(MetadataType.Tags, searchOnSongSelect),
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -175,6 +176,12 @@ namespace osu.Game.Screens.Select
|
||||
},
|
||||
loading = new LoadingLayer(true)
|
||||
};
|
||||
|
||||
void searchOnSongSelect(string text)
|
||||
{
|
||||
if (songSelect != null)
|
||||
songSelect.FilterControl.CurrentTextSearch.Value = text;
|
||||
}
|
||||
}
|
||||
|
||||
private void updateStatistics()
|
||||
|
@ -31,6 +31,8 @@ namespace osu.Game.Screens.Select
|
||||
|
||||
public Action<FilterCriteria> FilterChanged;
|
||||
|
||||
public Bindable<string> CurrentTextSearch => searchTextBox.Current;
|
||||
|
||||
private OsuTabControl<SortMode> sortTabs;
|
||||
|
||||
private Bindable<SortMode> sortMode;
|
||||
@ -63,6 +65,7 @@ namespace osu.Game.Screens.Select
|
||||
}
|
||||
|
||||
private SeekLimitedSearchTextBox searchTextBox;
|
||||
|
||||
private CollectionFilterDropdown collectionDropdown;
|
||||
|
||||
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) =>
|
||||
|
Reference in New Issue
Block a user