Merge pull request #1513 from GriffinRichards/fix-keyboarchars

Convert sKeyboardChars to 3D array
This commit is contained in:
GriffinR
2021-10-11 11:47:30 -04:00
committed by GitHub
+21 -14
View File
@@ -286,19 +286,26 @@ static const struct WindowTemplate sWindowTemplates[WIN_COUNT + 1] =
// This handles what characters get inserted when a key is pressed // This handles what characters get inserted when a key is pressed
// The keys shown on the keyboard are handled separately by sNamingScreenKeyboardText // The keys shown on the keyboard are handled separately by sNamingScreenKeyboardText
static const u8 sKeyboardChars[KBPAGE_COUNT * KBROW_COUNT * KBCOL_COUNT] = __( static const u8 sKeyboardChars[KBPAGE_COUNT][KBROW_COUNT][KBCOL_COUNT] = {
"abcdef ." [KEYBOARD_LETTERS_LOWER] = {
"ghijkl ," __("abcdef ."),
"mnopqrs " __("ghijkl ,"),
"tuvwxyz " __("mnopqrs "),
"ABCDEF ." __("tuvwxyz "),
"GHIJKL ," },
"MNOPQRS " [KEYBOARD_LETTERS_UPPER] = {
"TUVWXYZ " __("ABCDEF ."),
"01234 " __("GHIJKL ,"),
"56789 " __("MNOPQRS "),
"!?♂♀/- " __("TUVWXYZ "),
"…“”‘' "); },
[KEYBOARD_SYMBOLS] = {
__("01234 "),
__("56789 "),
__("!?♂♀/- "),
__("…“”‘' "),
}
};
static const u8 sPageColumnCounts[KBPAGE_COUNT] = { static const u8 sPageColumnCounts[KBPAGE_COUNT] = {
[KEYBOARD_LETTERS_LOWER] = KBCOL_COUNT, [KEYBOARD_LETTERS_LOWER] = KBCOL_COUNT,
@@ -1780,7 +1787,7 @@ static void DrawGenderIcon(void)
static u8 GetCharAtKeyboardPos(s16 x, s16 y) static u8 GetCharAtKeyboardPos(s16 x, s16 y)
{ {
return sKeyboardChars[x + y * KBCOL_COUNT + CurrentPageToKeyboardId() * KBCOL_COUNT * KBROW_COUNT]; return sKeyboardChars[CurrentPageToKeyboardId()][y][x];
} }