-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change to lowercase after first letter in naming screen
- Loading branch information
Showing
15 changed files
with
196 additions
and
40 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
#pragma once | ||
|
||
#include "main.h" | ||
|
||
#define KBEVENT_NONE 0 | ||
#define KBEVENT_PRESSED_A 5 | ||
#define KBEVENT_PRESSED_B 6 | ||
#define KBEVENT_PRESSED_SELECT 8 | ||
#define KBEVENT_PRESSED_START 9 | ||
|
||
enum | ||
{ | ||
PAGE_UPPER, | ||
PAGE_LOWER, | ||
PAGE_OTHERS, | ||
}; | ||
|
||
enum | ||
{ | ||
MAIN_STATE_BEGIN_FADE_IN, | ||
MAIN_STATE_WAIT_FADE_IN, | ||
MAIN_STATE_HANDLE_INPUT, | ||
MAIN_STATE_MOVE_TO_OK_BUTTON, | ||
MAIN_STATE_START_PAGE_SWAP, | ||
MAIN_STATE_WAIT_PAGE_SWAP, | ||
MAIN_STATE_6, | ||
MAIN_STATE_UPDATE_SENT_TO_PC_MESSAGE, | ||
MAIN_STATE_BEGIN_FADE_OUT, | ||
}; | ||
|
||
enum | ||
{ | ||
INPUT_STATE_DISABLED, | ||
INPUT_STATE_ENABLED, | ||
}; | ||
|
||
struct NamingScreen | ||
{ | ||
/*0x00*/ u8 state; | ||
/*0x01*/ u8 templateNum; | ||
/*0x02*/ u16 nameLeftOffset; | ||
/*0x04*/ u16 bg1vOffset; | ||
/*0x06*/ u16 bg2vOffset; | ||
/*0x08*/ u16 bg1Priority; | ||
/*0x0A*/ u16 bg2Priority; | ||
/*0x0C*/ u8 bgToReveal; | ||
/*0x0D*/ u8 bgToHide; | ||
/*0x0E*/ u8 currentPage; | ||
/*0x0F*/ u8 cursorSpriteId; | ||
/*0x10*/ u8 pageIndicatorSpriteId; | ||
/*0x11*/ u8 textBuffer[0x10]; | ||
/*0x21*/ u8 filler21[0x13]; | ||
/*0x34*/ const struct NamingScreenTemplate *template; | ||
/*0x38*/ u8 *destBuffer; | ||
/*0x3C*/ u16 keyRepeatStartDelayCopy; | ||
/*0x3E*/ u16 speciesOrPlayerGender; | ||
/*0x40*/ u16 monGender; | ||
/*0x42*/ u32 monPersonality; | ||
/*0x46*/ MainCallback returnCallback; | ||
}; | ||
|
||
void LONG_CALL TryStartButtonFlash(u8, u8, u8); | ||
bool8 LONG_CALL AddTextCharacter(void); | ||
void LONG_CALL SquishCursor(void); | ||
void LONG_CALL SetInputState(u8); | ||
void LONG_CALL MainState_StartPageSwap(void); | ||
u8 LONG_CALL GetTextEntryPosition(void); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.if AUTOCASE | ||
.org 0x83ce240 | ||
.word (KeyboardKeyHandler_Character | 1) | ||
.endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#include "types.h" | ||
#include "naming_screen.h" | ||
|
||
extern struct NamingScreen *const gNamingScreenPtr; | ||
|
||
u8 KeyboardKeyHandler_Character(u8 event) | ||
{ | ||
TryStartButtonFlash(3, 0, 0); | ||
if (event == KBEVENT_PRESSED_A) | ||
{ | ||
u8 textFull = AddTextCharacter(); | ||
|
||
if (gNamingScreenPtr ->currentPage == PAGE_UPPER && GetTextEntryPosition() == 1) | ||
MainState_StartPageSwap(); | ||
|
||
SquishCursor(); | ||
if (textFull) | ||
{ | ||
SetInputState(INPUT_STATE_DISABLED); | ||
gNamingScreenPtr->state = MAIN_STATE_MOVE_TO_OK_BUTTON; | ||
} | ||
} | ||
return FALSE; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters