From fc27155b0e86a37cba5ba597eff4ac350ed4ed19 Mon Sep 17 00:00:00 2001 From: Marijn van der Werf Date: Sat, 24 Jun 2017 20:00:37 +0200 Subject: wip src --- src/naming_screen.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/naming_screen.c') diff --git a/src/naming_screen.c b/src/naming_screen.c index 88059e669..34c7bebb3 100644 --- a/src/naming_screen.c +++ b/src/naming_screen.c @@ -1929,6 +1929,7 @@ static const struct NamingScreenTemplate *const sNamingScreenTemplates[] = static const u8 sKeyboardCharacters[][4][20] = { +#if ENGLISH { _(" A B C D E F . "), _(" G H I J K L , "), @@ -1941,6 +1942,20 @@ static const u8 sKeyboardCharacters[][4][20] = _(" m n o p q r s "), _(" t u v w x y z "), }, +#elif GERMAN + { + _(" ABCD EFGH . "), + _(" IJKL MNOP , "), + _(" QRST UVWX "), + _(" YZ ÄÖÜ "), + }, + { + _(" abcd efgh . "), + _(" ijkl mnop , "), + _(" qrst uvwx "), + _(" yz äöü "), + }, +#endif { _(" 0 1 2 3 4 "), _(" 5 6 7 8 9 "), -- cgit v1.2.3 From f92d723e794a41766e3ef9f9eb3d046f1ec1ec79 Mon Sep 17 00:00:00 2001 From: Marijn van der Werf Date: Sat, 24 Jun 2017 21:26:07 +0200 Subject: wip src --- src/naming_screen.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'src/naming_screen.c') diff --git a/src/naming_screen.c b/src/naming_screen.c index 34c7bebb3..5ede3b04b 100644 --- a/src/naming_screen.c +++ b/src/naming_screen.c @@ -18,6 +18,12 @@ #include "trig.h" #include "util.h" +#ifdef ENGLISH +#define COLUMN_COUNT 9 +#elif GERMAN +#define COLUMN_COUNT 10 +#endif + extern u16 gKeyRepeatStartDelay; extern u8 unk_2000000[]; @@ -1003,11 +1009,16 @@ static void CursorInit(void) SetCursorPos(0, 0); } -static const u8 sKeyboardSymbolPositions[][9] = -{ +static const u8 sKeyboardSymbolPositions[][COLUMN_COUNT] = { +#if ENGLISH {1, 3, 5, 8, 10, 12, 14, 17, 19}, //Upper page {1, 3, 5, 8, 10, 12, 14, 17, 19}, //Lower page {1, 4, 7, 10, 13, 16, 16, 16, 19}, //Others page +#elif GERMAN + {2, 3, 4, 5, 9, 10, 11, 12, 16, 19}, //Upper page + {2, 3, 4, 5, 9, 10, 11, 12, 16, 19}, //Lower page + {1, 4, 7, 10, 13, 16, 16, 16, 16, 19}, //Others page +#endif }; static u8 CursorColToKeyboardCol(s16 x) @@ -1070,7 +1081,7 @@ static u8 GetKeyRoleAtCursorPos(void) s16 cursorY; GetCursorPos(&cursorX, &cursorY); - if (cursorX < 8) + if (cursorX < COLUMN_COUNT - 1) return KEY_ROLE_CHAR; else return keyRoles[cursorY]; @@ -1081,7 +1092,7 @@ void sub_80B6998(struct Sprite *sprite) if (sprite->animEnded) StartSpriteAnim(sprite, 0); sprite->invisible = (sprite->data4 & 0xFF); - if (sprite->data0 == 8) + if (sprite->data0 == COLUMN_COUNT - 1) sprite->invisible = TRUE; if (sprite->invisible || (sprite->data4 & 0xFF00) == 0 || sprite->data0 != sprite->data2 || sprite->data1 != sprite->data3) -- cgit v1.2.3 From a27f8d812db532c28699c2ce105f52c2ad8de918 Mon Sep 17 00:00:00 2001 From: Marijn van der Werf Date: Sat, 24 Jun 2017 21:28:47 +0200 Subject: wip src --- src/naming_screen.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/naming_screen.c') diff --git a/src/naming_screen.c b/src/naming_screen.c index 5ede3b04b..2c6a3e3af 100644 --- a/src/naming_screen.c +++ b/src/naming_screen.c @@ -751,8 +751,8 @@ static void HandleDpadMovement(struct Task *task) //Wrap cursor position in the X direction if (cursorX < 0) - cursorX = 8; - if (cursorX > 8) + cursorX = COLUMN_COUNT - 1; + if (cursorX > COLUMN_COUNT - 1) cursorX = 0; //Handle cursor movement in X direction @@ -762,18 +762,18 @@ static void HandleDpadMovement(struct Task *task) if (namingScreenData.currentPage == PAGE_OTHERS && (cursorX == 6 || cursorX == 7)) { if (sDpadDeltaX[dpadDir] > 0) - cursorX = 8; + cursorX = COLUMN_COUNT - 1; else cursorX = 5; } - if (cursorX == 8) + if (cursorX == COLUMN_COUNT - 1) { //We are now on the last column task->tKbFunctionKey = cursorY; cursorY = s4RowTo3RowTableY[cursorY]; } - else if (prevCursorX == 8) + else if (prevCursorX == COLUMN_COUNT - 1) { if (cursorY == 1) cursorY = task->tKbFunctionKey; @@ -782,7 +782,7 @@ static void HandleDpadMovement(struct Task *task) } } - if (cursorX == 8) + if (cursorX == COLUMN_COUNT - 1) { //There are only 3 keys on the last column, unlike the others, //so wrap Y accordingly @@ -1048,7 +1048,7 @@ static void GetCursorPos(s16 *x, s16 *y) static void MoveCursorToOKButton(void) { - SetCursorPos(8, 2); + SetCursorPos(COLUMN_COUNT - 1, 2); } static void sub_80B6888(u8 a) -- cgit v1.2.3 From ce569feb587e8d3cc0dca403de2d8614e8abb9ca Mon Sep 17 00:00:00 2001 From: Marijn van der Werf Date: Sat, 24 Jun 2017 22:22:33 +0200 Subject: finish src --- src/naming_screen.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/naming_screen.c') diff --git a/src/naming_screen.c b/src/naming_screen.c index 2c6a3e3af..6c107f022 100644 --- a/src/naming_screen.c +++ b/src/naming_screen.c @@ -473,8 +473,13 @@ static bool8 MainState_WaitPageSwap(struct Task *task) sub_80B77F8(); SetInputState(INPUT_STATE_ENABLED); GetCursorPos(&cursorX, &cursorY); +#if ENGLISH if (namingScreenData.currentPage == PAGE_OTHERS && (cursorX == 6 || cursorX == 7)) cursorX = 5; +#elif GERMAN + if (namingScreenData.currentPage == PAGE_OTHERS && (cursorX == 7 || cursorX == 8)) + cursorX = 6; +#endif SetCursorPos(cursorX, cursorY); sub_80B6888(0); } @@ -759,7 +764,11 @@ static void HandleDpadMovement(struct Task *task) if (sDpadDeltaX[dpadDir] != 0) { //The "others" page only has 5 columns +#if ENGLISH if (namingScreenData.currentPage == PAGE_OTHERS && (cursorX == 6 || cursorX == 7)) +#elif GERMAN + if (namingScreenData.currentPage == PAGE_OTHERS && (cursorX == 6 || cursorX == 7 || cursorX == 8)) +#endif { if (sDpadDeltaX[dpadDir] > 0) cursorX = COLUMN_COUNT - 1; -- cgit v1.2.3