Renaming Script Contexts

- 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.
This commit is contained in:
tustin2121
2022-08-15 15:18:12 -04:00
parent 3dc3dc847f
commit 1cb659df8c
65 changed files with 438 additions and 409 deletions
+6 -6
View File
@@ -6148,14 +6148,14 @@ static void Task_PartyMenuWaitForFade(u8 taskId)
if (IsWeatherNotFadingIn())
{
DestroyTask(taskId);
ScriptContext2_Disable();
EnableBothScriptContexts();
UnlockPlayerFieldControls();
ScriptContext_Enable();
}
}
void ChooseContestMon(void)
{
ScriptContext2_Enable();
LockPlayerFieldControls();
FadeScreen(FADE_TO_BLACK, 0);
CreateTask(Task_ChooseContestMon, 10);
}
@@ -6183,7 +6183,7 @@ static void CB2_ChooseContestMon(void)
// Used as a script special for showing a party mon to various npcs (e.g. in-game trades, move deleter)
void ChoosePartyMon(void)
{
ScriptContext2_Enable();
LockPlayerFieldControls();
FadeScreen(FADE_TO_BLACK, 0);
CreateTask(Task_ChoosePartyMon, 10);
}
@@ -6200,7 +6200,7 @@ static void Task_ChoosePartyMon(u8 taskId)
void ChooseMonForMoveRelearner(void)
{
ScriptContext2_Enable();
LockPlayerFieldControls();
FadeScreen(FADE_TO_BLACK, 0);
CreateTask(Task_ChooseMonForMoveRelearner, 10);
}
@@ -6245,7 +6245,7 @@ void DoBattlePyramidMonsHaveHeldItem(void)
// The player can then select to toss items from the bag or take/toss held items from the party
void BattlePyramidChooseMonHeldItems(void)
{
ScriptContext2_Enable();
LockPlayerFieldControls();
FadeScreen(FADE_TO_BLACK, 0);
CreateTask(Task_BattlePyramidChooseMonHeldItems, 10);
}