Message Hooks

v2.0.0·Updated 2025-06-10

Provides hooks inside Message_Update and Message_DrawMain.

About this mod Author’s original text

Message Hooks

This is a dependency mod. It provides hooks inside Message_Update and Message_DrawMain for use in other mods.

Features

Events

This mod provides events with following signatures:

mh_on_Message_Update_(PlayState* play)

mh_on_Message_DrawMain_(PlayState* play, Gfx** gfxP)

where is the name of a MessageMode value without the MSGMODE_` prefix.

Each of these events is called only when `play->msgCtx->msgMode matches it's.

For example, if you want to hook into `MSGMODE_TEXT_DONE in Message_Update's switch clause, you should make a callback to mh_on_Message_Update_TEXT_DONE`.

There are also universal events called no matter the `play->msgCtx->msgMode`'s value. Their syntax is the same but they don't have a suffix:

mh_on_Message_Update(PlayState* play)

mh_on_Message_DrawMain(PlayState* play, Gfx** gfxP)

However, they should be avoided unless necessary.

Early return

The mod provides an import for use inside the callbacks. It sets the flag that makes the vanilla function return early before it dives into it's switch clause:

void mh_set_return_flag(void);

Usage example

RECOMP_IMPORT("mm_recomp_message_hooks", void mh_set_return_flag(void));

RECOMP_CALLBACK("mm_recomp_message_hooks", mh_on_Message_Update_TEXT_DONE) void on_Message_Update(PlayState* play) {

if (...) {...

mh_set_return_flag();

}

}

RECOMP_CALLBACK("mm_recomp_message_hooks", mh_on_Message_DrawMain_TEXT_CLOSING) void on_Message_DrawMain(PlayState* play, Gfx** gfxP) {...

}

Install & use Install: follow the bundled instructions

  1. Unzip the archive from playbuff and read the bundled readme / instructions first.
  2. Most mods rely on the game's mod loader — the usual route is a community mod manager (such as r2modman): pick this game, install, and it handles the loader and dependencies.
  3. For a manual install, put the mod files into the matching Mod / plugins folder inside the game directory.
  4. Launch the game to confirm it loaded; mods with listed dependencies need those installed as well.

Install locations vary a lot between mods — the bundled readme is the most reliable guide.

File & checksum

Filename
Message_Hooks-2.0.0.zip
File size
125.8 KiB