pc acccess

This commit is contained in:
ghoulslash 2022-03-18 13:30:08 -04:00
parent f4448d05e2
commit 0036a4dc36
4 changed files with 35 additions and 17 deletions

View file

@ -46,7 +46,7 @@
#define FLAG_SYS_NO_TRAINER_SEE 0x22 // Unused Flag //DEBUG #define FLAG_SYS_NO_TRAINER_SEE 0x22 // Unused Flag //DEBUG
#define FLAG_SYS_NO_BAG_USE 0x23 // Unused Flag //DEBUG #define FLAG_SYS_NO_BAG_USE 0x23 // Unused Flag //DEBUG
#define FLAG_SYS_NO_CATCHING 0x24 // Unused Flag //DEBUG #define FLAG_SYS_NO_CATCHING 0x24 // Unused Flag //DEBUG
#define FLAG_UNUSED_0x025 0x25 // Unused Flag #define FLAG_SYS_PC_FROM_DEBUG_MENU 0x25 // Unused Flag //DEBUG
#define FLAG_UNUSED_0x026 0x26 // Unused Flag #define FLAG_UNUSED_0x026 0x26 // Unused Flag
#define FLAG_UNUSED_0x027 0x27 // Unused Flag #define FLAG_UNUSED_0x027 0x27 // Unused Flag
#define FLAG_UNUSED_0x028 0x28 // Unused Flag #define FLAG_UNUSED_0x028 0x28 // Unused Flag

View file

@ -72,4 +72,6 @@ u8 *GetWaldaPhrasePtr(void);
void SetWaldaPhrase(const u8 *src); void SetWaldaPhrase(const u8 *src);
bool32 IsWaldaPhraseEmpty(void); bool32 IsWaldaPhraseEmpty(void);
void EnterPokeStorage(u8 boxOption);
#endif // GUARD_POKEMON_STORAGE_SYSTEM_H #endif // GUARD_POKEMON_STORAGE_SYSTEM_H

View file

@ -31,6 +31,7 @@
#include "naming_screen.h" #include "naming_screen.h"
#include "new_game.h" #include "new_game.h"
#include "overworld.h" #include "overworld.h"
#include "palette.h"
#include "pokedex.h" #include "pokedex.h"
#include "pokemon.h" #include "pokemon.h"
#include "pokemon_icon.h" #include "pokemon_icon.h"
@ -48,6 +49,7 @@
#include "constants/flags.h" #include "constants/flags.h"
#include "constants/items.h" #include "constants/items.h"
#include "constants/map_groups.h" #include "constants/map_groups.h"
#include "constants/rgb.h"
#include "constants/songs.h" #include "constants/songs.h"
#include "constants/species.h" #include "constants/species.h"
@ -61,6 +63,7 @@ enum { // Main
DEBUG_MENU_ITEM_VARS, DEBUG_MENU_ITEM_VARS,
DEBUG_MENU_ITEM_GIVE, DEBUG_MENU_ITEM_GIVE,
DEBUG_MENU_ITEM_SOUND, DEBUG_MENU_ITEM_SOUND,
DEBUG_MENU_ITEM_ACCESS_PC,
DEBUG_MENU_ITEM_CANCEL DEBUG_MENU_ITEM_CANCEL
}; };
enum { // Util enum { // Util
@ -115,7 +118,6 @@ enum { // Give
DEBUG_GIVE_MENU_ITEM_DAYCARE_EGG, DEBUG_GIVE_MENU_ITEM_DAYCARE_EGG,
DEBUG_GIVE_MENU_ITEM_FILL_PC, DEBUG_GIVE_MENU_ITEM_FILL_PC,
DEBUG_GIVE_MENU_ITEM_CHEAT, DEBUG_GIVE_MENU_ITEM_CHEAT,
//DEBUG_MENU_ITEM_ACCESS_PC,
}; };
enum { //Sound enum { //Sound
DEBUG_SOUND_MENU_ITEM_SE, DEBUG_SOUND_MENU_ITEM_SE,
@ -374,7 +376,7 @@ static const u8 gDebugText_Give_MaxCoins[] = _("Max Coins");
static const u8 gDebugText_Give_DaycareEgg[] = _("Daycare Egg"); static const u8 gDebugText_Give_DaycareEgg[] = _("Daycare Egg");
static const u8 gDebugText_Give_FillPc[] = _("Fill Pc"); static const u8 gDebugText_Give_FillPc[] = _("Fill Pc");
static const u8 gDebugText_Give_GiveCHEAT[] = _("CHEAT Start"); static const u8 gDebugText_Give_GiveCHEAT[] = _("CHEAT Start");
// static const u8 gDebugText_Give_AccessPC[] = _("Access PC"); static const u8 gDebugText_AccessPC[] = _("Access PC");
// Sound Mneu // Sound Mneu
static const u8 gDebugText_Sound_SE[] = _("Effects"); static const u8 gDebugText_Sound_SE[] = _("Effects");
static const u8 gDebugText_Sound_SE_ID[] = _("Sound Id: {STR_VAR_3}\n{STR_VAR_1} \n{STR_VAR_2}"); static const u8 gDebugText_Sound_SE_ID[] = _("Sound Id: {STR_VAR_3}\n{STR_VAR_1} \n{STR_VAR_2}");
@ -425,6 +427,7 @@ static const struct ListMenuItem sDebugMenu_Items_Main[] =
[DEBUG_MENU_ITEM_VARS] = {gDebugText_Vars, DEBUG_MENU_ITEM_VARS}, [DEBUG_MENU_ITEM_VARS] = {gDebugText_Vars, DEBUG_MENU_ITEM_VARS},
[DEBUG_MENU_ITEM_GIVE] = {gDebugText_Give, DEBUG_MENU_ITEM_GIVE}, [DEBUG_MENU_ITEM_GIVE] = {gDebugText_Give, DEBUG_MENU_ITEM_GIVE},
[DEBUG_MENU_ITEM_SOUND] = {gDebugText_Sound, DEBUG_MENU_ITEM_SOUND}, [DEBUG_MENU_ITEM_SOUND] = {gDebugText_Sound, DEBUG_MENU_ITEM_SOUND},
[DEBUG_MENU_ITEM_ACCESS_PC] = {gDebugText_AccessPC, DEBUG_MENU_ITEM_ACCESS_PC},
[DEBUG_MENU_ITEM_CANCEL] = {gDebugText_Cancel, DEBUG_MENU_ITEM_CANCEL} [DEBUG_MENU_ITEM_CANCEL] = {gDebugText_Cancel, DEBUG_MENU_ITEM_CANCEL}
}; };
static const struct ListMenuItem sDebugMenu_Items_Utilities[] = static const struct ListMenuItem sDebugMenu_Items_Utilities[] =
@ -484,7 +487,6 @@ static const struct ListMenuItem sDebugMenu_Items_Give[] =
[DEBUG_GIVE_MENU_ITEM_DAYCARE_EGG] = {gDebugText_Give_DaycareEgg, DEBUG_GIVE_MENU_ITEM_DAYCARE_EGG}, [DEBUG_GIVE_MENU_ITEM_DAYCARE_EGG] = {gDebugText_Give_DaycareEgg, DEBUG_GIVE_MENU_ITEM_DAYCARE_EGG},
[DEBUG_GIVE_MENU_ITEM_FILL_PC] = {gDebugText_Give_FillPc, DEBUG_GIVE_MENU_ITEM_FILL_PC}, [DEBUG_GIVE_MENU_ITEM_FILL_PC] = {gDebugText_Give_FillPc, DEBUG_GIVE_MENU_ITEM_FILL_PC},
[DEBUG_GIVE_MENU_ITEM_CHEAT] = {gDebugText_Give_GiveCHEAT, DEBUG_GIVE_MENU_ITEM_CHEAT}, [DEBUG_GIVE_MENU_ITEM_CHEAT] = {gDebugText_Give_GiveCHEAT, DEBUG_GIVE_MENU_ITEM_CHEAT},
//[DEBUG_MENU_ITEM_ACCESS_PC] = {gDebugText_AccessPC, DEBUG_MENU_ITEM_ACCESS_PC},
}; };
static const struct ListMenuItem sDebugMenu_Items_Sound[] = static const struct ListMenuItem sDebugMenu_Items_Sound[] =
{ {
@ -502,6 +504,7 @@ static void (*const sDebugMenu_Actions_Main[])(u8) =
[DEBUG_MENU_ITEM_VARS] = DebugAction_OpenVariablesMenu, [DEBUG_MENU_ITEM_VARS] = DebugAction_OpenVariablesMenu,
[DEBUG_MENU_ITEM_GIVE] = DebugAction_OpenGiveMenu, [DEBUG_MENU_ITEM_GIVE] = DebugAction_OpenGiveMenu,
[DEBUG_MENU_ITEM_SOUND] = DebugAction_OpenSoundMenu, [DEBUG_MENU_ITEM_SOUND] = DebugAction_OpenSoundMenu,
[DEBUG_MENU_ITEM_ACCESS_PC] = DebugAction_AccessPC,
[DEBUG_MENU_ITEM_CANCEL] = DebugAction_Cancel [DEBUG_MENU_ITEM_CANCEL] = DebugAction_Cancel
}; };
static void (*const sDebugMenu_Actions_Utilities[])(u8) = static void (*const sDebugMenu_Actions_Utilities[])(u8) =
@ -561,7 +564,6 @@ static void (*const sDebugMenu_Actions_Give[])(u8) =
[DEBUG_GIVE_MENU_ITEM_DAYCARE_EGG] = DebugAction_Give_DayCareEgg, [DEBUG_GIVE_MENU_ITEM_DAYCARE_EGG] = DebugAction_Give_DayCareEgg,
[DEBUG_GIVE_MENU_ITEM_FILL_PC] = DebugAction_Give_FillPC, [DEBUG_GIVE_MENU_ITEM_FILL_PC] = DebugAction_Give_FillPC,
[DEBUG_GIVE_MENU_ITEM_CHEAT] = DebugAction_Give_CHEAT, [DEBUG_GIVE_MENU_ITEM_CHEAT] = DebugAction_Give_CHEAT,
//[DEBUG_MENU_ITEM_ACCESS_PC] = DebugAction_AccessPC,
}; };
static void (*const sDebugMenu_Actions_Sound[])(u8) = static void (*const sDebugMenu_Actions_Sound[])(u8) =
{ {
@ -2690,12 +2692,23 @@ static void DebugAction_Give_CHEAT(u8 taskId)
ScriptContext1_SetupScript(Debug_CheatStart); ScriptContext1_SetupScript(Debug_CheatStart);
} }
// static void DebugAction_AccessPC(u8 taskId) static void Task_WaitFadeAccessPC(u8 taskId)
// { {
// Debug_DestroyMenu(taskId); if (!gPaletteFade.active)
// PlaySE(SE_PC_ON); {
// ScriptContext1_SetupScript(EventScript_PC); DestroyTask(taskId);
// } FlagSet(FLAG_SYS_PC_FROM_DEBUG_MENU);
EnterPokeStorage(2);
}
}
static void DebugAction_AccessPC(u8 taskId)
{
Debug_DestroyMenu(taskId);
CleanupOverworldWindowsAndTilemaps();
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK);
CreateTask(Task_WaitFadeAccessPC, 0);
}
// ******************************* // *******************************

View file

@ -571,7 +571,6 @@ EWRAM_DATA static u8 sMovingMonOrigBoxPos = 0;
EWRAM_DATA static bool8 sAutoActionOn = 0; EWRAM_DATA static bool8 sAutoActionOn = 0;
// Main tasks // Main tasks
static void EnterPokeStorage(u8);
static void Task_InitPokeStorage(u8); static void Task_InitPokeStorage(u8);
static void Task_PlaceMon(u8); static void Task_PlaceMon(u8);
static void Task_ChangeScreen(u8); static void Task_ChangeScreen(u8);
@ -1676,10 +1675,14 @@ static void FieldTask_ReturnToPcMenu(void)
MainCallback vblankCb = gMain.vblankCallback; MainCallback vblankCb = gMain.vblankCallback;
SetVBlankCallback(NULL); SetVBlankCallback(NULL);
taskId = CreateTask(Task_PCMainMenu, 80); if (!FlagGet(FLAG_SYS_PC_FROM_DEBUG_MENU)) {
gTasks[taskId].tState = 0; taskId = CreateTask(Task_PCMainMenu, 80);
gTasks[taskId].tSelectedOption = sPreviousBoxOption; gTasks[taskId].tState = 0;
Task_PCMainMenu(taskId); gTasks[taskId].tSelectedOption = sPreviousBoxOption;
Task_PCMainMenu(taskId);
} else {
FlagClear(FLAG_SYS_PC_FROM_DEBUG_MENU);
}
SetVBlankCallback(vblankCb); SetVBlankCallback(vblankCb);
FadeInFromBlack(); FadeInFromBlack();
} }
@ -2009,7 +2012,7 @@ static void CB2_PokeStorage(void)
BuildOamBuffer(); BuildOamBuffer();
} }
static void EnterPokeStorage(u8 boxOption) void EnterPokeStorage(u8 boxOption)
{ {
ResetTasks(); ResetTasks();
sCurrentBoxOption = boxOption; sCurrentBoxOption = boxOption;