mirror of https://github.com/ppy/osu
Add ShowTag method
This commit is contained in:
parent
0bbc4abb35
commit
5a0b93bdb2
|
@ -24,6 +24,12 @@ public TestSceneBeatmapListingOverlay()
|
|||
Add(overlay = new BeatmapListingOverlay());
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestShowTag()
|
||||
{
|
||||
AddStep("Show Rem tag", () => overlay.ShowTag("Rem"));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestShow()
|
||||
{
|
||||
|
|
|
@ -158,6 +158,26 @@ protected override void LoadComplete()
|
|||
sortDirection.BindValueChanged(_ => queueUpdateSearch());
|
||||
}
|
||||
|
||||
public void ShowTag(string tag)
|
||||
{
|
||||
var currentQuery = searchSection.Query.Value;
|
||||
|
||||
if (currentQuery != tag)
|
||||
{
|
||||
setDefaultSearchValues();
|
||||
searchSection.Query.Value = tag;
|
||||
}
|
||||
|
||||
Show();
|
||||
}
|
||||
|
||||
private void setDefaultSearchValues()
|
||||
{
|
||||
searchSection.Query.Value = string.Empty;
|
||||
searchSection.Ruleset.Value = new RulesetInfo { Name = @"Any" };
|
||||
searchSection.Category.Value = BeatmapSearchCategory.Leaderboard;
|
||||
}
|
||||
|
||||
private ScheduledDelegate queryChangedDebounce;
|
||||
|
||||
private void queueUpdateSearch(bool queryTextChanged = false)
|
||||
|
|
Loading…
Reference in New Issue