1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 15:47:26 +08:00

Move OsuSettingsNumberBox into SettingsNumberBox

This commit is contained in:
Pasi4K5 2021-06-12 17:57:40 +02:00
parent c728f673d6
commit b79d57b68c
3 changed files with 8 additions and 9 deletions

View File

@ -2,16 +2,20 @@
// 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.Graphics; using osu.Framework.Graphics;
using osu.Game.Graphics.UserInterface;
namespace osu.Game.Overlays.Settings namespace osu.Game.Overlays.Settings
{ {
public class SettingsNumberBox : SettingsItem<string> public class SettingsNumberBox : SettingsItem<string>
{ {
protected override Drawable CreateControl() => new OsuNumberBox protected override Drawable CreateControl() => new OsuSettingsNumberBox
{ {
Margin = new MarginPadding { Top = 5 }, Margin = new MarginPadding { Top = 5 },
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
}; };
public class OsuSettingsNumberBox : SettingsTextBox.OsuSettingsTextBox
{
protected override bool CanAddCharacter(char character) => char.IsNumber(character);
}
} }
} }

View File

@ -56,10 +56,5 @@ namespace osu.Game.Overlays.Settings
BorderColour = HasFocus ? borderColourFocused : borderColourUnfocused; BorderColour = HasFocus ? borderColourFocused : borderColourUnfocused;
} }
} }
public class OsuSettingsNumberBox : OsuSettingsTextBox
{
protected override bool CanAddCharacter(char character) => char.IsNumber(character);
}
} }
} }

View File

@ -49,7 +49,7 @@ namespace osu.Game.Rulesets.Mods
} }
} }
private readonly SettingsTextBox.OsuSettingsNumberBox seedNumberBox; private readonly SettingsNumberBox.OsuSettingsNumberBox seedNumberBox;
public SeedControl() public SeedControl()
{ {
@ -75,7 +75,7 @@ namespace osu.Game.Rulesets.Mods
{ {
new Drawable[] new Drawable[]
{ {
seedNumberBox = new SettingsTextBox.OsuSettingsNumberBox seedNumberBox = new SettingsNumberBox.OsuSettingsNumberBox
{ {
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
CommitOnFocusLost = true CommitOnFocusLost = true