1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 14:25:05 +08:00

Fix beatmap details source and tags not filtering on song select

This commit is contained in:
Salman Ahmed 2022-07-15 06:41:49 +03:00
parent eafa11555a
commit 97c3eea3aa
2 changed files with 23 additions and 13 deletions

View File

@ -40,6 +40,9 @@ namespace osu.Game.Screens.Select
[Resolved]
private IAPIProvider api { get; set; }
[Resolved(canBeNull: true)]
private SongSelect songSelect { get; set; }
private IBeatmapInfo beatmapInfo;
private APIFailTimes failTimes;
@ -140,9 +143,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 +178,12 @@ namespace osu.Game.Screens.Select
},
loading = new LoadingLayer(true)
};
void searchOnSongSelect(string text)
{
if (songSelect != null)
songSelect.FilterControl.SearchTextBox.Text = text;
}
}
private void updateStatistics()

View File

@ -39,7 +39,7 @@ namespace osu.Game.Screens.Select
public FilterCriteria CreateCriteria()
{
string query = searchTextBox.Text;
string query = SearchTextBox.Text;
var criteria = new FilterCriteria
{
@ -62,7 +62,8 @@ namespace osu.Game.Screens.Select
return criteria;
}
private SeekLimitedSearchTextBox searchTextBox;
public SeekLimitedSearchTextBox SearchTextBox { get; private set; }
private CollectionFilterDropdown collectionDropdown;
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) =>
@ -103,7 +104,7 @@ namespace osu.Game.Screens.Select
Height = 60,
Children = new Drawable[]
{
searchTextBox = new SeekLimitedSearchTextBox { RelativeSizeAxes = Axes.X },
SearchTextBox = new SeekLimitedSearchTextBox { RelativeSizeAxes = Axes.X },
new Box
{
RelativeSizeAxes = Axes.X,
@ -204,23 +205,23 @@ namespace osu.Game.Screens.Select
updateCriteria();
};
searchTextBox.Current.ValueChanged += _ => updateCriteria();
SearchTextBox.Current.ValueChanged += _ => updateCriteria();
updateCriteria();
}
public void Deactivate()
{
searchTextBox.ReadOnly = true;
searchTextBox.HoldFocus = false;
if (searchTextBox.HasFocus)
GetContainingInputManager().ChangeFocus(searchTextBox);
SearchTextBox.ReadOnly = true;
SearchTextBox.HoldFocus = false;
if (SearchTextBox.HasFocus)
GetContainingInputManager().ChangeFocus(SearchTextBox);
}
public void Activate()
{
searchTextBox.ReadOnly = false;
searchTextBox.HoldFocus = true;
SearchTextBox.ReadOnly = false;
SearchTextBox.HoldFocus = true;
}
private readonly IBindable<RulesetInfo> ruleset = new Bindable<RulesetInfo>();