#pragma once namespace mods::hud { // Installs the Direct3D device hooks the HUD layout needs (once per device). void OnDevice(void* device); // Horizontal offset of the moved window whose render or event method runs on // the current thread (0 outside): polled mouse positions are reduced by it. int CursorOffsetX(); // Horizontal offset the current thread's UI drawing is shifted by (the // outermost hooked window's; 0 outside). int DrawOffsetX(); // The mouse cursor object as the current thread should see it: inside a moved // window, a private copy with x shifted by CursorOffsetX(). void* CursorFor(void* cursor); // Tooltips that are dialogs of their own (e.g. quest dialogs: they became // visible while no moved window was under the cursor) and are visible now. int VisibleDialogTooltips(void** out, int max); // For mods that hook a centred window themselves: run body(context) as the // HUD layer runs the window's render method (drawing shifted, the cursor seen // shifted) or event handler (mouse position shifted by the window's offset). int RenderCentred(void* window, int (*body)(void* context), void* context); int HandleCentred(void* event, int (*body)(void* context), void* context); } // namespace mods::hud