1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 13:37:25 +08:00

Move logic to framework and update all usages

This commit is contained in:
Susko3 2021-12-15 07:13:24 +01:00
parent 0b0ff36154
commit b326ccc196
2 changed files with 5 additions and 2 deletions

View File

@ -1,10 +1,12 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Extensions;
namespace osu.Game.Graphics.UserInterface
{
public class OsuNumberBox : OsuTextBox
{
protected override bool CanAddCharacter(char character) => char.IsNumber(character);
protected override bool CanAddCharacter(char character) => character.IsAsciiDigit();
}
}

View File

@ -2,6 +2,7 @@
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Bindables;
using osu.Framework.Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.UserInterface;
@ -67,7 +68,7 @@ namespace osu.Game.Overlays.Settings
private class OutlinedNumberBox : OutlinedTextBox
{
protected override bool CanAddCharacter(char character) => character >= '0' && character <= '9';
protected override bool CanAddCharacter(char character) => character.IsAsciiDigit();
public new void NotifyInputError() => base.NotifyInputError();
}