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:
+11
-11
@@ -563,7 +563,7 @@ static void AddDecorationActionsWindow(void)
|
||||
static void InitDecorationActionsWindow(void)
|
||||
{
|
||||
sDecorationActionsCursorPos = 0;
|
||||
ScriptContext2_Enable();
|
||||
LockPlayerFieldControls();
|
||||
AddDecorationActionsWindow();
|
||||
PrintCurMainMenuDescription();
|
||||
}
|
||||
@@ -670,7 +670,7 @@ static void DecorationMenuAction_Cancel(u8 taskId)
|
||||
RemoveDecorationWindow(WINDOW_MAIN_MENU);
|
||||
if (!sDecorationContext.isPlayerRoom)
|
||||
{
|
||||
ScriptContext1_SetupScript(SecretBase_EventScript_PCCancel);
|
||||
ScriptContext_SetupScript(SecretBase_EventScript_PCCancel);
|
||||
DestroyTask(taskId);
|
||||
}
|
||||
else
|
||||
@@ -1650,7 +1650,7 @@ static void PlaceDecoration(u8 taskId)
|
||||
{
|
||||
sCurDecorMapX = gTasks[taskId].tCursorX - MAP_OFFSET;
|
||||
sCurDecorMapY = gTasks[taskId].tCursorY - MAP_OFFSET;
|
||||
ScriptContext1_SetupScript(SecretBase_EventScript_SetDecoration);
|
||||
ScriptContext_SetupScript(SecretBase_EventScript_SetDecoration);
|
||||
}
|
||||
|
||||
gSprites[sDecor_CameraSpriteObjectIdx1].y += 2;
|
||||
@@ -1722,7 +1722,7 @@ static void c1_overworld_prev_quest(u8 taskId)
|
||||
switch (gTasks[taskId].tState)
|
||||
{
|
||||
case 0:
|
||||
ScriptContext2_Enable();
|
||||
LockPlayerFieldControls();
|
||||
if (!gPaletteFade.active)
|
||||
{
|
||||
WarpToInitialPosition(taskId);
|
||||
@@ -1749,11 +1749,11 @@ static void Task_InitDecorationItemsWindow(u8 taskId)
|
||||
tState++;
|
||||
break;
|
||||
case 1:
|
||||
ScriptContext1_SetupScript(SecretBase_EventScript_InitDecorations);
|
||||
ScriptContext_SetupScript(SecretBase_EventScript_InitDecorations);
|
||||
tState++;
|
||||
break;
|
||||
case 2:
|
||||
ScriptContext2_Enable();
|
||||
LockPlayerFieldControls();
|
||||
tState++;
|
||||
break;
|
||||
case 3:
|
||||
@@ -1767,7 +1767,7 @@ static void FieldCB_InitDecorationItemsWindow(void)
|
||||
{
|
||||
u8 taskId;
|
||||
|
||||
ScriptContext2_Enable();
|
||||
LockPlayerFieldControls();
|
||||
FadeInFromBlack();
|
||||
taskId = CreateTask(Task_InitDecorationItemsWindow, 8);
|
||||
AddDecorationItemsWindow(taskId);
|
||||
@@ -2246,13 +2246,13 @@ static void Task_PutAwayDecoration(u8 taskId)
|
||||
case 1:
|
||||
if (!gPaletteFade.active) {
|
||||
DrawWholeMapView();
|
||||
ScriptContext1_SetupScript(SecretBase_EventScript_PutAwayDecoration);
|
||||
ScriptContext_SetupScript(SecretBase_EventScript_PutAwayDecoration);
|
||||
ClearDialogWindowAndFrame(0, TRUE);
|
||||
gTasks[taskId].tState = 2;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
ScriptContext2_Enable();
|
||||
LockPlayerFieldControls();
|
||||
IdentifyOwnedDecorationsCurrentlyInUseInternal(taskId);
|
||||
FadeInFromBlack();
|
||||
gTasks[taskId].tState = 3;
|
||||
@@ -2645,11 +2645,11 @@ static void Task_ReinitializeDecorationMenuHandler(u8 taskId)
|
||||
tState++;
|
||||
break;
|
||||
case 1:
|
||||
ScriptContext1_SetupScript(SecretBase_EventScript_InitDecorations);
|
||||
ScriptContext_SetupScript(SecretBase_EventScript_InitDecorations);
|
||||
tState++;
|
||||
break;
|
||||
case 2:
|
||||
ScriptContext2_Enable();
|
||||
LockPlayerFieldControls();
|
||||
tState++;
|
||||
break;
|
||||
case 3:
|
||||
|
||||
Reference in New Issue
Block a user