mirror of
https://github.com/ppy/osu.git
synced 2025-01-18 10:02:54 +08:00
Update textbox usage in line with framework changes
This commit is contained in:
parent
2c57cd59a5
commit
904a08af26
@ -1,14 +1,16 @@
|
||||
// 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.Input;
|
||||
|
||||
namespace osu.Game.Graphics.UserInterface
|
||||
{
|
||||
public partial class OsuNumberBox : OsuTextBox
|
||||
{
|
||||
protected override bool AllowIme => false;
|
||||
|
||||
public OsuNumberBox()
|
||||
{
|
||||
InputProperties = new TextInputProperties(TextInputType.Number, false);
|
||||
|
||||
SelectAllOnFocus = true;
|
||||
}
|
||||
|
||||
|
@ -18,7 +18,7 @@ using osu.Game.Localisation;
|
||||
|
||||
namespace osu.Game.Graphics.UserInterface
|
||||
{
|
||||
public partial class OsuPasswordTextBox : OsuTextBox, ISuppressKeyEventLogging
|
||||
public partial class OsuPasswordTextBox : OsuTextBox
|
||||
{
|
||||
protected override Drawable GetDrawableCharacter(char c) => new FallingDownContainer
|
||||
{
|
||||
@ -32,8 +32,6 @@ namespace osu.Game.Graphics.UserInterface
|
||||
|
||||
protected override bool AllowWordNavigation => false;
|
||||
|
||||
protected override bool AllowIme => false;
|
||||
|
||||
private readonly CapsWarning warning;
|
||||
|
||||
[Resolved]
|
||||
@ -41,6 +39,8 @@ namespace osu.Game.Graphics.UserInterface
|
||||
|
||||
public OsuPasswordTextBox()
|
||||
{
|
||||
InputProperties = new TextInputProperties(TextInputType.Password, false);
|
||||
|
||||
Add(warning = new CapsWarning
|
||||
{
|
||||
Size = new Vector2(20),
|
||||
|
@ -5,6 +5,7 @@ using osu.Framework.Bindables;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.UserInterface;
|
||||
using osu.Framework.Input;
|
||||
|
||||
namespace osu.Game.Overlays.Settings
|
||||
{
|
||||
@ -66,7 +67,10 @@ namespace osu.Game.Overlays.Settings
|
||||
|
||||
private partial class OutlinedNumberBox : OutlinedTextBox
|
||||
{
|
||||
protected override bool AllowIme => false;
|
||||
public OutlinedNumberBox()
|
||||
{
|
||||
InputProperties = new TextInputProperties(TextInputType.Number, false);
|
||||
}
|
||||
|
||||
protected override bool CanAddCharacter(char character) => char.IsAsciiDigit(character);
|
||||
|
||||
|
@ -4,6 +4,7 @@
|
||||
using System.Linq;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics.UserInterface;
|
||||
using osu.Framework.Input;
|
||||
using osu.Framework.Localisation;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Graphics.UserInterfaceV2;
|
||||
@ -136,7 +137,10 @@ namespace osu.Game.Screens.Edit.Setup
|
||||
|
||||
private partial class RomanisedTextBox : InnerTextBox
|
||||
{
|
||||
protected override bool AllowIme => false;
|
||||
public RomanisedTextBox()
|
||||
{
|
||||
InputProperties = new TextInputProperties(TextInputType.Text, false);
|
||||
}
|
||||
|
||||
protected override bool CanAddCharacter(char character)
|
||||
=> MetadataUtils.IsRomanised(character);
|
||||
|
Loading…
Reference in New Issue
Block a user