Message Hooks

版本 v2.0.0·更新於 2025-06-10

Provides hooks inside Message_Update and Message_DrawMain.

模組介紹 作者原文

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) {...

}

安裝與使用 安裝:按包內說明操作

  1. 解壓本站下載的壓縮包,先讀包內的 readme / 說明檔案。
  2. 多數模組依賴遊戲的模組載入器:常見做法是用社群模組管理器(如 r2modman)選中本遊戲安裝,由管理器自動處理載入器與依賴。
  3. 手動安裝時,把模組檔案放進遊戲目錄下對應的 Mod / plugins 資料夾。
  4. 啟動遊戲確認載入成功;帶「前置依賴」的模組需要把依賴一併安裝。

不同模組的安裝位置差異較大,包內說明是最可靠的依據。

檔案與校驗

檔案名稱
Message_Hooks-2.0.0.zip
檔案大小
125.8 KiB