1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-14 05:47:20 +08:00

Add equals (=) query operator variants

This commit is contained in:
smoogipoo 2019-09-19 15:33:49 +09:00
parent 52e9043ee4
commit 80f46e02d8

View File

@ -183,7 +183,7 @@ namespace osu.Game.Screens.Select
private void updateCriteria() => FilterChanged?.Invoke(CreateCriteria());
private static readonly Regex query_syntax_regex = new Regex(
@"\b(?<key>stars|ar|dr|cs|divisor|length|objects|bpm|status)(?<op>[:><]+)(?<value>\S*)",
@"\b(?<key>stars|ar|dr|cs|divisor|length|objects|bpm|status)(?<op>[=:><]+)(?<value>\S*)",
RegexOptions.Compiled | RegexOptions.IgnoreCase);
private void applyQueries(FilterCriteria criteria, ref string query)
@ -246,6 +246,7 @@ namespace osu.Game.Screens.Select
default:
return;
case "=":
case ":":
range.IsInclusive = true;
range.Min = value - equalityToleration;
@ -257,6 +258,7 @@ namespace osu.Game.Screens.Select
range.Min = value;
break;
case ">=":
case ">:":
range.IsInclusive = true;
range.Min = value;
@ -267,6 +269,7 @@ namespace osu.Game.Screens.Select
range.Max = value;
break;
case "<=":
case "<:":
range.IsInclusive = true;
range.Max = value;