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:
@@ -251,7 +251,7 @@ static void Task_HandleTruckSequence(u8 taskId)
|
||||
DrawWholeMapView();
|
||||
PlaySE(SE_TRUCK_DOOR);
|
||||
DestroyTask(taskId);
|
||||
ScriptContext2_Disable();
|
||||
UnlockPlayerFieldControls();
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -263,7 +263,7 @@ void ExecuteTruckSequence(void)
|
||||
MapGridSetMetatileIdAt(4 + MAP_OFFSET, 2 + MAP_OFFSET, METATILE_InsideOfTruck_DoorClosedFloor_Mid);
|
||||
MapGridSetMetatileIdAt(4 + MAP_OFFSET, 3 + MAP_OFFSET, METATILE_InsideOfTruck_DoorClosedFloor_Bottom);
|
||||
DrawWholeMapView();
|
||||
ScriptContext2_Enable();
|
||||
LockPlayerFieldControls();
|
||||
CpuFastFill(0, gPlttBufferFaded, 0x400);
|
||||
CreateTask(Task_HandleTruckSequence, 0xA);
|
||||
}
|
||||
@@ -371,7 +371,7 @@ void FieldCB_ShowPortholeView(void)
|
||||
gObjectEvents[gPlayerAvatar.objectEventId].invisible = TRUE;
|
||||
FadeInFromBlack();
|
||||
CreateTask(Task_HandlePorthole, 80);
|
||||
ScriptContext2_Enable();
|
||||
LockPlayerFieldControls();
|
||||
}
|
||||
|
||||
void LookThroughPorthole(void)
|
||||
|
||||
Reference in New Issue
Block a user