Add ShowTag method

This commit is contained in:
Andrei Zavatski 2020-02-20 17:02:22 +03:00
parent 0bbc4abb35
commit 5a0b93bdb2
2 changed files with 26 additions and 0 deletions

View File

@ -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()
{

View File

@ -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)