mirror of
https://github.com/osukey/osukey.git
synced 2025-08-05 07:33:55 +09:00
Add ShowTag method
This commit is contained in:
@ -24,6 +24,12 @@ namespace osu.Game.Tests.Visual.Online
|
||||
Add(overlay = new BeatmapListingOverlay());
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestShowTag()
|
||||
{
|
||||
AddStep("Show Rem tag", () => overlay.ShowTag("Rem"));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestShow()
|
||||
{
|
||||
|
@ -158,6 +158,26 @@ namespace osu.Game.Overlays
|
||||
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)
|
||||
|
Reference in New Issue
Block a user