Add AUTO_LOWERCASE_KEYBOARD (#4976)

* Added SwapKeyboardToLowerAfterFirstCapitalLetter and AUTO_LOWERCASE_KEYBOARD

* Fixed tabs and spacing per https://github.com/rh-hideout/pokeemerald-expansion/pull/4976/files\#r1677868397

* Removed semicolon found by https://github.com/rh-hideout/pokeemerald-expansion/pull/4976\#discussion_r1678105502
This commit is contained in:
psf 2024-07-15 10:06:01 -07:00 committed by GitHub
parent 0d0100d8f8
commit 7b3b635c67
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 20 additions and 0 deletions

View file

@ -80,4 +80,7 @@
#define UNITS UNITS_IMPERIAL
#define CHAR_DEC_SEPARATOR CHAR_PERIOD // CHAR_PERIOD is used as a decimal separator only in the UK and the US. The rest of the world uses CHAR_COMMA.
// Naming Screen
#define AUTO_LOWERCASE_KEYBOARD GEN_LATEST // Starting in GEN_6, after entering the first uppercase character, the keyboard switches to lowercase letters.
#endif // GUARD_CONFIG_GENERAL_H

View file

@ -1436,6 +1436,7 @@ static void NamingScreen_CreateWaldaDadIcon(void)
//--------------------------------------------------
static bool8 KeyboardKeyHandler_Character(u8);
static void SwapKeyboardToLowerAfterFirstCapitalLetter(void);
static bool8 KeyboardKeyHandler_Page(u8);
static bool8 KeyboardKeyHandler_Backspace(u8);
static bool8 KeyboardKeyHandler_OK(u8);
@ -1480,6 +1481,8 @@ static bool8 KeyboardKeyHandler_Character(u8 input)
{
bool8 textFull = AddTextCharacter();
SwapKeyboardToLowerAfterFirstCapitalLetter();
SquishCursor();
if (textFull)
{
@ -1490,6 +1493,20 @@ static bool8 KeyboardKeyHandler_Character(u8 input)
return FALSE;
}
static void SwapKeyboardToLowerAfterFirstCapitalLetter(void)
{
if (AUTO_LOWERCASE_KEYBOARD < GEN_6)
return;
if (sNamingScreen->currentPage != KBPAGE_LETTERS_UPPER)
return;
if (GetTextEntryPosition() != 1)
return;
MainState_StartPageSwap();
}
static bool8 KeyboardKeyHandler_Page(u8 input)
{
TryStartButtonFlash(BUTTON_PAGE, TRUE, FALSE);