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
+4 -4
View File
@@ -86,7 +86,7 @@ void DoBrailleDigEffect(void)
DrawWholeMapView();
PlaySE(SE_BANG);
FlagSet(FLAG_SYS_BRAILLE_DIG);
ScriptContext2_Disable();
UnlockPlayerFieldControls();
}
bool8 CheckRelicanthWailord(void)
@@ -152,7 +152,7 @@ static void Task_SealedChamberShakingEffect(u8 taskId)
if (task->tShakeCounter == task->tNumShakes)
{
DestroyTask(taskId);
EnableBothScriptContexts();
ScriptContext_Enable();
InstallCameraPanAheadCallback();
}
}
@@ -213,7 +213,7 @@ static void DoBrailleRegirockEffect(void)
DrawWholeMapView();
PlaySE(SE_BANG);
FlagSet(FLAG_SYS_REGIROCK_PUZZLE_COMPLETED);
ScriptContext2_Disable();
UnlockPlayerFieldControls();
}
bool8 ShouldDoBrailleRegisteelEffect(void)
@@ -252,7 +252,7 @@ static void DoBrailleRegisteelEffect(void)
DrawWholeMapView();
PlaySE(SE_BANG);
FlagSet(FLAG_SYS_REGISTEEL_PUZZLE_COMPLETED);
ScriptContext2_Disable();
UnlockPlayerFieldControls();
}
// theory: another commented out DoBrailleWait and Task_BrailleWait.