1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-15 22:22:56 +08:00

Limit max participants field to only numbers.

This commit is contained in:
DrabWeb 2018-08-24 19:19:16 -03:00
parent c5f0b27544
commit 90e178821a

View File

@ -107,7 +107,7 @@ namespace osu.Game.Screens.Multi.Screens.Match.Settings
{
new Section("MAX PARTICIPANTS")
{
Child = MaxParticipantsField = new SettingsTextBox
Child = MaxParticipantsField = new SettingsNumberTextBox
{
RelativeSizeAxes = Axes.X,
TabbableContentContainer = this,
@ -199,6 +199,11 @@ namespace osu.Game.Screens.Multi.Screens.Match.Settings
protected override Color4 BackgroundFocused => Color4.Black;
}
private class SettingsNumberTextBox : SettingsTextBox
{
protected override bool CanAddCharacter(char character) => char.IsNumber(character);
}
private class SettingsPasswordTextBox : OsuPasswordTextBox
{
protected override Color4 BackgroundUnfocused => Color4.Black;