mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-26 11:44:17 +01:00
1cb659df8c
- Determined how the various script contexts were used and renamed accordingly. - ScriptContext2_Enable/Disable => Lock/UnlockPlayerFieldControls - The sole purpose of the flag is to make sure the player can't move around in the overworld. It has nothing to do with script contexts. - ScriptContext1 => ScriptContext - It is the global script context used to set up scripts which run over many frames. - ScriptContext2_RunNewScript => RunScriptImmediately - ScriptContext2's sole purpose was to run scripts immediately and in a separate context, usually while the global context is waiting for things like map loads or screen changes.
41 lines
950 B
C
41 lines
950 B
C
#include "global.h"
|
|
#include "hall_of_fame.h"
|
|
#include "main.h"
|
|
#include "palette.h"
|
|
#include "overworld.h"
|
|
#include "script.h"
|
|
#include "script_menu.h"
|
|
#include "task.h"
|
|
#include "constants/rgb.h"
|
|
|
|
static void ReshowPCMenuAfterHallOfFamePC(void);
|
|
static void Task_WaitForPaletteFade(u8);
|
|
|
|
void AccessHallOfFamePC(void)
|
|
{
|
|
SetMainCallback2(CB2_DoHallOfFamePC);
|
|
LockPlayerFieldControls();
|
|
}
|
|
|
|
void ReturnFromHallOfFamePC(void)
|
|
{
|
|
SetMainCallback2(CB2_ReturnToField);
|
|
gFieldCallback = ReshowPCMenuAfterHallOfFamePC;
|
|
}
|
|
|
|
static void ReshowPCMenuAfterHallOfFamePC(void)
|
|
{
|
|
LockPlayerFieldControls();
|
|
Overworld_PlaySpecialMapMusic();
|
|
ScriptMenu_CreatePCMultichoice();
|
|
ScriptMenu_DisplayPCStartupPrompt();
|
|
BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_BLACK);
|
|
CreateTask(Task_WaitForPaletteFade, 10);
|
|
}
|
|
|
|
static void Task_WaitForPaletteFade(u8 taskId)
|
|
{
|
|
if (!gPaletteFade.active)
|
|
DestroyTask(taskId);
|
|
}
|