mirror of
https://github.com/Ryubing/Ryujinx.git
synced 2025-03-10 09:04:23 +00:00
misc: chore: Collapse HLE swkbd character validation utils into a single class
This commit is contained in:
parent
38ef65aae0
commit
ad9d6588e8
@ -1,9 +0,0 @@
|
|||||||
using Ryujinx.Common.Helper;
|
|
||||||
|
|
||||||
namespace Ryujinx.HLE.HOS.Applets.SoftwareKeyboard
|
|
||||||
{
|
|
||||||
public static class CJKCharacterValidation
|
|
||||||
{
|
|
||||||
public static bool IsCJK(char value) => Patterns.CJK.IsMatch(value.ToString());
|
|
||||||
}
|
|
||||||
}
|
|
@ -2,8 +2,9 @@ using Ryujinx.Common.Helper;
|
|||||||
|
|
||||||
namespace Ryujinx.HLE.HOS.Applets.SoftwareKeyboard
|
namespace Ryujinx.HLE.HOS.Applets.SoftwareKeyboard
|
||||||
{
|
{
|
||||||
public static class NumericCharacterValidation
|
public static class CharacterValidation
|
||||||
{
|
{
|
||||||
public static bool IsNumeric(char value) => Patterns.Numeric.IsMatch(value.ToString());
|
public static bool IsNumeric(char value) => Patterns.Numeric.IsMatch(value.ToString());
|
||||||
|
public static bool IsCJK(char value) => Patterns.CJK.IsMatch(value.ToString());
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -144,12 +144,12 @@ namespace Ryujinx.Ava.UI.Controls
|
|||||||
case KeyboardMode.Numeric:
|
case KeyboardMode.Numeric:
|
||||||
localeText = LocaleManager.Instance.UpdateAndGetDynamicValue(LocaleKeys.SoftwareKeyboardModeNumeric);
|
localeText = LocaleManager.Instance.UpdateAndGetDynamicValue(LocaleKeys.SoftwareKeyboardModeNumeric);
|
||||||
validationInfoText = string.IsNullOrEmpty(validationInfoText) ? localeText : string.Join("\n", validationInfoText, localeText);
|
validationInfoText = string.IsNullOrEmpty(validationInfoText) ? localeText : string.Join("\n", validationInfoText, localeText);
|
||||||
_checkInput = text => text.All(NumericCharacterValidation.IsNumeric);
|
_checkInput = text => text.All(CharacterValidation.IsNumeric);
|
||||||
break;
|
break;
|
||||||
case KeyboardMode.Alphabet:
|
case KeyboardMode.Alphabet:
|
||||||
localeText = LocaleManager.Instance.UpdateAndGetDynamicValue(LocaleKeys.SoftwareKeyboardModeAlphabet);
|
localeText = LocaleManager.Instance.UpdateAndGetDynamicValue(LocaleKeys.SoftwareKeyboardModeAlphabet);
|
||||||
validationInfoText = string.IsNullOrEmpty(validationInfoText) ? localeText : string.Join("\n", validationInfoText, localeText);
|
validationInfoText = string.IsNullOrEmpty(validationInfoText) ? localeText : string.Join("\n", validationInfoText, localeText);
|
||||||
_checkInput = text => text.All(value => !CJKCharacterValidation.IsCJK(value));
|
_checkInput = text => text.All(value => !CharacterValidation.IsCJK(value));
|
||||||
break;
|
break;
|
||||||
case KeyboardMode.ASCII:
|
case KeyboardMode.ASCII:
|
||||||
localeText = LocaleManager.Instance.UpdateAndGetDynamicValue(LocaleKeys.SoftwareKeyboardModeASCII);
|
localeText = LocaleManager.Instance.UpdateAndGetDynamicValue(LocaleKeys.SoftwareKeyboardModeASCII);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user