Skip to content

Add HOOK_ON_PLAY_MODE_UPDATE and HOOK_BEFORE_PLAY_MODE_UPDATE#1160

Open
EmeraldLoc wants to merge 3 commits intocoop-deluxe:devfrom
EmeraldLoc:playmode
Open

Add HOOK_ON_PLAY_MODE_UPDATE and HOOK_BEFORE_PLAY_MODE_UPDATE#1160
EmeraldLoc wants to merge 3 commits intocoop-deluxe:devfrom
EmeraldLoc:playmode

Conversation

@EmeraldLoc
Copy link
Contributor

  • HOOK_ON_PLAY_MODE_UPDATE (hook 66) is called after a play mode is ran in update_current_play_mode, and allows you to override the change level.
  • HOOK_BEFORE_PLAY_MODE_UPDATE (hook 67) is called right before, and allows you to override the current play mode.

What this pr allows for is:

  • Fully pausing the game in Lua, including time freeze
  • Provide a convenient hook for settings values in Expose gHudDisplay #1158
  • Setting Mario's model even if the game is fully paused or frozen with time stop

Also, while messing around with the system, I found some crashes, so I fixed them here. If I need to revert it, lmk.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant