mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 16:29:58 +09:00
Move logic to framework and update all usages
This commit is contained in:
@ -1,10 +1,12 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using osu.Framework.Extensions;
|
||||||
|
|
||||||
namespace osu.Game.Graphics.UserInterface
|
namespace osu.Game.Graphics.UserInterface
|
||||||
{
|
{
|
||||||
public class OsuNumberBox : OsuTextBox
|
public class OsuNumberBox : OsuTextBox
|
||||||
{
|
{
|
||||||
protected override bool CanAddCharacter(char character) => char.IsNumber(character);
|
protected override bool CanAddCharacter(char character) => character.IsAsciiDigit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
|
using osu.Framework.Extensions;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.UserInterface;
|
using osu.Framework.Graphics.UserInterface;
|
||||||
@ -67,7 +68,7 @@ namespace osu.Game.Overlays.Settings
|
|||||||
|
|
||||||
private class OutlinedNumberBox : OutlinedTextBox
|
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();
|
public new void NotifyInputError() => base.NotifyInputError();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user