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:
+9
-9
@@ -166,7 +166,7 @@ static void Task_CloseCantUseKeyItemMessage(u8 taskId)
|
||||
ClearDialogWindowAndFrame(0, TRUE);
|
||||
DestroyTask(taskId);
|
||||
ScriptUnfreezeObjectEvents();
|
||||
ScriptContext2_Disable();
|
||||
UnlockPlayerFieldControls();
|
||||
}
|
||||
|
||||
u8 CheckIfItemIsTMHMOrEvolutionStone(u16 itemId)
|
||||
@@ -222,7 +222,7 @@ static void ItemUseOnFieldCB_Bike(u8 taskId)
|
||||
else // ACRO_BIKE
|
||||
GetOnOffBike(PLAYER_AVATAR_FLAG_ACRO_BIKE);
|
||||
ScriptUnfreezeObjectEvents();
|
||||
ScriptContext2_Disable();
|
||||
UnlockPlayerFieldControls();
|
||||
DestroyTask(taskId);
|
||||
}
|
||||
|
||||
@@ -337,7 +337,7 @@ static void Task_CloseItemfinderMessage(u8 taskId)
|
||||
{
|
||||
ClearDialogWindowAndFrame(0, TRUE);
|
||||
ScriptUnfreezeObjectEvents();
|
||||
ScriptContext2_Disable();
|
||||
UnlockPlayerFieldControls();
|
||||
DestroyTask(taskId);
|
||||
}
|
||||
|
||||
@@ -692,8 +692,8 @@ void ItemUseOutOfBattle_Berry(u8 taskId)
|
||||
static void ItemUseOnFieldCB_Berry(u8 taskId)
|
||||
{
|
||||
RemoveBagItem(gSpecialVar_ItemId, 1);
|
||||
ScriptContext2_Enable();
|
||||
ScriptContext1_SetupScript(BerryTree_EventScript_ItemUsePlantBerry);
|
||||
LockPlayerFieldControls();
|
||||
ScriptContext_SetupScript(BerryTree_EventScript_ItemUsePlantBerry);
|
||||
DestroyTask(taskId);
|
||||
}
|
||||
|
||||
@@ -717,8 +717,8 @@ void ItemUseOutOfBattle_WailmerPail(u8 taskId)
|
||||
|
||||
static void ItemUseOnFieldCB_WailmerPailBerry(u8 taskId)
|
||||
{
|
||||
ScriptContext2_Enable();
|
||||
ScriptContext1_SetupScript(BerryTree_EventScript_ItemUseWailmerPail);
|
||||
LockPlayerFieldControls();
|
||||
ScriptContext_SetupScript(BerryTree_EventScript_ItemUseWailmerPail);
|
||||
DestroyTask(taskId);
|
||||
}
|
||||
|
||||
@@ -738,8 +738,8 @@ static bool8 TryToWaterSudowoodo(void)
|
||||
|
||||
static void ItemUseOnFieldCB_WailmerPailSudowoodo(u8 taskId)
|
||||
{
|
||||
ScriptContext2_Enable();
|
||||
ScriptContext1_SetupScript(BattleFrontier_OutsideEast_EventScript_WaterSudowoodo);
|
||||
LockPlayerFieldControls();
|
||||
ScriptContext_SetupScript(BattleFrontier_OutsideEast_EventScript_WaterSudowoodo);
|
||||
DestroyTask(taskId);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user