Skip to content

Hooking

ZSolarDev edited this page Nov 9, 2026 · 13 revisions

Hooking is the mechanism behind how you interact with the game at runtime. A developer is able to hook into different functions ran by the game, which are exposed by haxe.

Examples

TODO

Available Hooks

Mod "hooks"

The reason I put hooks in quotations was because the calls that will be listed aren't truly hooking into the game, they're simply called for us by Diva Mod Loader.

You can register/unregister these hooks via:

Diva.hookManager.registerModHook(hook);
Diva.hookManager.unregisterModHook(hook)

PreInit(Void -> Void)

This hook is run before the game's global variables are initialized. You may not need to use this one often.

Init(Void -> Void)

This hook is run after the game's global variables are initialized. Run most of your mod initialization here.

PostInit(Void -> Void)

This hook is run after all mod DLL's are fully loaded.

D3DInit((DxgiSwapChain, D3d11Device, D3d11DeviceContext) -> Void)

This hook is run when the game's Direct3D is initialized. You can use this in combination with the OnFrame() mod hook and ImGuiDx11 to render ImGui. Look at the ImGui page of the wiki.

OnFrame(DxgiSwapChain -> Void)

This hook is run every frame before the current frame is presented to the screen.

OnResize(DxgiSwapChain -> Void)

This hook is run every time the games buffers are resized, primarily during window resizing.

OnSwapChain(DxgiSwapChain -> Void)

This hook is run when the swap chain is changed.

Gameplay hooks

LIST HERE.

PV Select Menu Hooks

LIST HERE.

Clone this wiki locally