diff options
-rw-r--r-- | Nickname-your-Pokémon-from-the-party-menu.md | 142 |
1 files changed, 142 insertions, 0 deletions
diff --git a/Nickname-your-Pokémon-from-the-party-menu.md b/Nickname-your-Pokémon-from-the-party-menu.md new file mode 100644 index 0000000..bbb5451 --- /dev/null +++ b/Nickname-your-Pokémon-from-the-party-menu.md @@ -0,0 +1,142 @@ +###### In Pokémon Let's Go, Pikachu/Eevee, you can nickname your Pokémon from the party menu. Let's implement that feature into pokeemerald! + + + +In **[include/strings.h](https://github.com/pret/pokeemerald/blob/master/include/strings.h)**: + +```diff + extern const u8 gText_Speed[]; + extern const u8 gText_Dash[]; + extern const u8 gText_Plus[]; ++ extern const u8 gText_Nickname[]; + + //pokedex text + extern const u8 gText_CryOf[]; +``` +In **[src/data/party_menu.h](https://github.com/pret/pokeemerald/blob/master/src/data/party_menu.h)**: + +```diff +enum +{ + MENU_SUMMARY, ++ MENU_NICKNAME, + MENU_SWITCH, + MENU_CANCEL1, + MENU_ITEM, +``` + +```diff +} static const sCursorOptions[] = +{ + [MENU_SUMMARY] = {gText_Summary5, CursorCb_Summary}, ++ [MENU_NICKNAME] = {gText_Nickname, CursorCb_Nickname}, + [MENU_SWITCH] = {gText_Switch2, CursorCb_Switch}, + [MENU_CANCEL1] = {gText_Cancel2, CursorCb_Cancel1}, + [MENU_ITEM] = {gText_Item, CursorCb_Item}, +``` + +In **[src/party_menu.c](https://github.com/pret/pokeemerald/blob/master/src/party_menu.c)**: + +```diff + static void BlitBitmapToPartyWindow_LeftColumn(u8, u8, u8, u8, u8, u8); + static void BlitBitmapToPartyWindow_RightColumn(u8, u8, u8, u8, u8, u8); + static void CursorCb_Summary(u8); ++ static void CursorCb_Nickname(u8); + static void CursorCb_Switch(u8); + static void CursorCb_Cancel1(u8); + static void CursorCb_Item(u8); +``` +```diff +sPartyMenuInternal->numActions = 0; + AppendToList(sPartyMenuInternal->actions, &sPartyMenuInternal->numActions, MENU_SUMMARY); ++ AppendToList(sPartyMenuInternal->actions, &sPartyMenuInternal->numActions, MENU_NICKNAME); + + // Add field moves to action list + for (i = 0; i < MAX_MON_MOVES; i++) +``` +```diff + Task_ClosePartyMenu(taskId); +} + ++ void ChangePokemonNickname(void); ++ static void CursorCb_Nickname(u8 taskId) ++ { ++ PlaySE(SE_SELECT); ++ gSpecialVar_0x8004 = gPartyMenu.slotId; ++ sPartyMenuInternal->exitCallback = ChangePokemonNickname; ++ Task_ClosePartyMenu(taskId); ++ } ++ +static void CB2_ShowPokemonSummaryScreen(void) +{ + if (gPartyMenu.menuType == PARTY_MENU_TYPE_IN_BATTLE) +``` + +In **[src/party_menu.c](https://github.com/pret/pokeemerald/blob/master/src/party_menu.c)**: + +Around Line 125: + +```diff +- u8 actions[8]; ++ u8 actions [9]; +``` + +Finally, in [src/strings.c](https://github.com/pret/pokeemerald/blob/master/src/strings.c): + +```diff +const u8 gText_PokeBalls[] = _("POKé BALLS"); +const u8 gText_Berry[] = _("BERRY"); +const u8 gText_Berries[] = _("BERRIES"); ++ const u8 gText_Nickname[] = _("NICKNAME"); ++ +``` + + +## Optional additions: + +Technically, you could stop here. But there are a few changes you can make to this feature that will make it better: + +# Make it exit to the party screen + +This is a pretty simple change, and it makes the experience way better. + +In [src/party_menu.c](https://github.com/pret/pokeemerald/blob/master/src/party_menu.c): + +```diff + #include "constants/party_menu.h" + #include "constants/rgb.h" + #include "constants/songs.h" ++#include "naming_screen.h" + + + #define PARTY_PAL_SELECTED (1 << 0) + #define PARTY_PAL_FAINTED (1 << 1) +``` +```diff + Task_ClosePartyMenu(taskId); + } + +-void ChangePokemonNickname(void); ++static void ChangePokemonNicknamePartyScreen_CB(void) ++{ ++ SetMonData(&gPlayerParty[gSpecialVar_0x8004], MON_DATA_NICKNAME, gStringVar2); ++ CB2_ReturnToPartyMenuFromSummaryScreen(); ++} ++ ++static void ChangePokemonNicknamePartyScreen(void) ++{ ++ GetMonData(&gPlayerParty[gSpecialVar_0x8004], MON_DATA_NICKNAME, gStringVar3); ++ GetMonData(&gPlayerParty[gSpecialVar_0x8004], MON_DATA_NICKNAME, gStringVar2); ++ DoNamingScreen(NAMING_SCREEN_NICKNAME, gStringVar2, GetMonData(&gPlayerParty[gSpecialVar_0x8004], MON_DATA_SPECIES, NULL), GetMonGender(&gPlayerParty[gSpecialVar_0x8004]), GetMonData(&gPlayerParty[gSpecialVar_0x8004], MON_DATA_PERSONALITY, NULL), ChangePokemonNicknamePartyScreen_CB); ++} ++ + static void CursorCb_Nickname(u8 taskId) + { + PlaySE(SE_SELECT); + gSpecialVar_0x8004 = gPartyMenu.slotId; +- sPartyMenuInternal->exitCallback = ChangePokemonNickname; ++ sPartyMenuInternal->exitCallback = ChangePokemonNicknamePartyScreen; + Task_ClosePartyMenu(taskId); + } +``` +
\ No newline at end of file |