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:
@@ -562,7 +562,7 @@ void ShowStartMenu(void)
|
||||
StopPlayerAvatar();
|
||||
}
|
||||
CreateStartMenuTask(Task_ShowStartMenu);
|
||||
ScriptContext2_Enable();
|
||||
LockPlayerFieldControls();
|
||||
}
|
||||
|
||||
static bool8 HandleStartMenuInput(void)
|
||||
@@ -763,7 +763,7 @@ void ShowBattlePyramidStartMenu(void)
|
||||
ClearDialogWindowAndFrameToTransparent(0, FALSE);
|
||||
ScriptUnfreezeObjectEvents();
|
||||
CreateStartMenuTask(Task_ShowStartMenu);
|
||||
ScriptContext2_Enable();
|
||||
LockPlayerFieldControls();
|
||||
}
|
||||
|
||||
static bool8 StartMenuBattlePyramidBagCallback(void)
|
||||
@@ -804,7 +804,7 @@ static bool8 SaveCallback(void)
|
||||
case SAVE_ERROR: // Close start menu
|
||||
ClearDialogWindowAndFrameToTransparent(0, TRUE);
|
||||
ScriptUnfreezeObjectEvents();
|
||||
ScriptContext2_Disable();
|
||||
UnlockPlayerFieldControls();
|
||||
SoftResetInBattlePyramid();
|
||||
return TRUE;
|
||||
}
|
||||
@@ -841,8 +841,8 @@ static bool8 BattlePyramidRetireCallback(void)
|
||||
case SAVE_CANCELED: // Yes (Retire from battle pyramid)
|
||||
ClearDialogWindowAndFrameToTransparent(0, TRUE);
|
||||
ScriptUnfreezeObjectEvents();
|
||||
ScriptContext2_Disable();
|
||||
ScriptContext1_SetupScript(BattlePyramid_Retire);
|
||||
UnlockPlayerFieldControls();
|
||||
ScriptContext_SetupScript(BattlePyramid_Retire);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -901,7 +901,7 @@ static void SaveGameTask(u8 taskId)
|
||||
}
|
||||
|
||||
DestroyTask(taskId);
|
||||
EnableBothScriptContexts();
|
||||
ScriptContext_Enable();
|
||||
}
|
||||
|
||||
static void HideSaveMessageWindow(void)
|
||||
@@ -1378,7 +1378,7 @@ static void Task_WaitForBattleTowerLinkSave(u8 taskId)
|
||||
if (!FuncIsActiveTask(Task_LinkFullSave))
|
||||
{
|
||||
DestroyTask(taskId);
|
||||
EnableBothScriptContexts();
|
||||
ScriptContext_Enable();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1398,7 +1398,7 @@ static void HideStartMenuWindow(void)
|
||||
ClearStdWindowAndFrame(GetStartMenuWindowId(), TRUE);
|
||||
RemoveStartMenuWindow();
|
||||
ScriptUnfreezeObjectEvents();
|
||||
ScriptContext2_Disable();
|
||||
UnlockPlayerFieldControls();
|
||||
}
|
||||
|
||||
void HideStartMenu(void)
|
||||
|
||||
Reference in New Issue
Block a user