diff options
author | GriffinR <griffin.g.richards@gmail.com> | 2021-07-31 13:30:40 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-31 13:30:40 -0400 |
commit | 3e60a7840653e50845abf10bb02cd1b519dcd80f (patch) | |
tree | cb4a0d227a238ebdeb3b6cb9fdb92781bcc4f5e7 /src/scrcmd.c | |
parent | 602855ea99d8015ef5b7709f6fb1e9fd167239e2 (diff) | |
parent | d391486247cc9f29d85787d6711f7cb993cf6585 (diff) |
Merge branch 'master' into doc-frontierpass2
Diffstat (limited to 'src/scrcmd.c')
-rw-r--r-- | src/scrcmd.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/src/scrcmd.c b/src/scrcmd.c index 7caaa194b..f53483978 100644 --- a/src/scrcmd.c +++ b/src/scrcmd.c @@ -1203,6 +1203,8 @@ bool8 ScrCmd_turnvobject(struct ScriptContext *ctx) return FALSE; } +// lockall freezes all object events except the player immediately. +// The player is frozen after waiting for their current movement to finish. bool8 ScrCmd_lockall(struct ScriptContext *ctx) { if (IsUpdateLinkStateCBActive()) @@ -1211,12 +1213,14 @@ bool8 ScrCmd_lockall(struct ScriptContext *ctx) } else { - ScriptFreezeObjectEvents(); + FreezeObjects_WaitForPlayer(); SetupNativeScript(ctx, IsFreezePlayerFinished); return TRUE; } } +// lock freezes all object events except the player and the selected object immediately. +// The player and selected object are frozen after waiting for their current movement to finish. bool8 ScrCmd_lock(struct ScriptContext *ctx) { if (IsUpdateLinkStateCBActive()) @@ -1227,12 +1231,12 @@ bool8 ScrCmd_lock(struct ScriptContext *ctx) { if (gObjectEvents[gSelectedObjectEvent].active) { - LockSelectedObjectEvent(); + FreezeObjects_WaitForPlayerAndSelected(); SetupNativeScript(ctx, IsFreezeSelectedObjectAndPlayerFinished); } else { - ScriptFreezeObjectEvents(); + FreezeObjects_WaitForPlayer(); SetupNativeScript(ctx, IsFreezePlayerFinished); } return TRUE; @@ -1358,7 +1362,7 @@ bool8 ScrCmd_multichoice(struct ScriptContext *ctx) u8 left = ScriptReadByte(ctx); u8 top = ScriptReadByte(ctx); u8 multichoiceId = ScriptReadByte(ctx); - u8 ignoreBPress = ScriptReadByte(ctx); + bool8 ignoreBPress = ScriptReadByte(ctx); if (ScriptMenu_Multichoice(left, top, multichoiceId, ignoreBPress) == TRUE) { @@ -1377,7 +1381,7 @@ bool8 ScrCmd_multichoicedefault(struct ScriptContext *ctx) u8 top = ScriptReadByte(ctx); u8 multichoiceId = ScriptReadByte(ctx); u8 defaultChoice = ScriptReadByte(ctx); - u8 ignoreBPress = ScriptReadByte(ctx); + bool8 ignoreBPress = ScriptReadByte(ctx); if (ScriptMenu_MultichoiceWithDefault(left, top, multichoiceId, ignoreBPress, defaultChoice) == TRUE) { @@ -1407,7 +1411,7 @@ bool8 ScrCmd_multichoicegrid(struct ScriptContext *ctx) u8 top = ScriptReadByte(ctx); u8 multichoiceId = ScriptReadByte(ctx); u8 numColumns = ScriptReadByte(ctx); - u8 ignoreBPress = ScriptReadByte(ctx); + bool8 ignoreBPress = ScriptReadByte(ctx); if (ScriptMenu_MultichoiceGrid(left, top, multichoiceId, ignoreBPress, numColumns) == TRUE) { @@ -1427,7 +1431,7 @@ bool8 ScrCmd_erasebox(struct ScriptContext *ctx) u8 right = ScriptReadByte(ctx); u8 bottom = ScriptReadByte(ctx); - // MenuZeroFillWindowRect(left, top, right, bottom); + // Menu_EraseWindowRect(left, top, right, bottom); return FALSE; } @@ -1436,7 +1440,7 @@ bool8 ScrCmd_drawboxtext(struct ScriptContext *ctx) u8 left = ScriptReadByte(ctx); u8 top = ScriptReadByte(ctx); u8 multichoiceId = ScriptReadByte(ctx); - u8 ignoreBPress = ScriptReadByte(ctx); + bool8 ignoreBPress = ScriptReadByte(ctx); /*if (Multichoice(left, top, multichoiceId, ignoreBPress) == TRUE) { @@ -1466,15 +1470,15 @@ bool8 ScrCmd_hidemonpic(struct ScriptContext *ctx) return TRUE; } -bool8 ScrCmd_showcontestwinner(struct ScriptContext *ctx) +bool8 ScrCmd_showcontestpainting(struct ScriptContext *ctx) { u8 contestWinnerId = ScriptReadByte(ctx); - // Don't save artist's painting yet + // Artist's painting is temporary and already has its data loaded if (contestWinnerId != CONTEST_WINNER_ARTIST) SetContestWinnerForPainting(contestWinnerId); - ShowContestWinnerPainting(); + ShowContestPainting(); ScriptContext1_Stop(); return TRUE; } |