From 0b0ff361542521ea066c06d2bad6955c2905873a Mon Sep 17 00:00:00 2001 From: Susko3 <16479013+Susko3@users.noreply.github.com> Date: Tue, 7 Dec 2021 20:06:22 +0100 Subject: [PATCH] Allow only number characters parseable by `int.TryParse` char.IsNumber() is too broad, allowing full width and other numbers. --- osu.Game/Overlays/Settings/SettingsNumberBox.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Overlays/Settings/SettingsNumberBox.cs b/osu.Game/Overlays/Settings/SettingsNumberBox.cs index cbe9f7fc64..0a4949f8b6 100644 --- a/osu.Game/Overlays/Settings/SettingsNumberBox.cs +++ b/osu.Game/Overlays/Settings/SettingsNumberBox.cs @@ -67,7 +67,7 @@ namespace osu.Game.Overlays.Settings private class OutlinedNumberBox : OutlinedTextBox { - protected override bool CanAddCharacter(char character) => char.IsNumber(character); + protected override bool CanAddCharacter(char character) => character >= '0' && character <= '9'; public new void NotifyInputError() => base.NotifyInputError(); }