GearLoader 1.1.0
Mod loader for GGXXACPR
Loading...
Searching...
No Matches
BaseMod::HookApi Class Reference
Inheritance diagram for BaseMod::HookApi:
BaseMod::ApiWrapper< BaseMod_HookApi >

Public Member Functions

uint32_t RemoveHook (HookId id)
 Removes a hook from the registry.
HookId AfterPeekMessage (BaseMod_PeekMessageHook hookFn, void *userData)
 Registers a hook to the PeekMessage hook.
template<typename T>
HookId AfterPeekMessage (PeekMessageHook< T > hookFn, T *userData)
 Registers a hook to the PeekMessage hook.
HookId BeforeGameUpdate (BaseMod_GameUpdateHook hookFn, void *userData)
 Registers a hook to run before the game state updates.
template<typename T>
HookId BeforeGameUpdate (GameUpdateHook< T > hookFn, T *userData)
 Registers a hook to run before the game state updates.
HookId AfterGameUpdate (BaseMod_GameUpdateHook hookFn, void *userData)
 Registers a hook to run after the game state updates.
template<typename T>
HookId AfterGameUpdate (GameUpdateHook< T > hookFn, T *userData)
 Registers a hook to run after the game state updates.
HookId BeforeEndScene (BaseMod_DrawHook hookFn, void *userData)
 Registers a hook to run before the call to IDirect3DDevice9::EndScene.
template<typename T>
HookId BeforeEndScene (DrawHook< T > hookFn, T *userData)
 Registers a hook to run before the call to IDirect3DDevice9::EndScene.
HookId BeforePresent (BaseMod_DrawHook hookFn, void *userData)
 Registers a hook to run before the call to IDirect3DDevice9::Present.
template<typename T>
HookId BeforePresent (DrawHook< T > hookFn, T *userData)
 Registers a hook to run before the call to IDirect3DDevice9::Present.
HookId AfterSaveGame (BaseMod_SaveGameHook hookFn, void *userData)
 Registers a hook to run when the game saves such as on "Saving..." auto saving screens Or when selecting the menu option: "Main Menu > HELP & OPTIONS > SAVE / LOAD > SAVE".
template<typename T>
HookId AfterSaveGame (SaveGameHook< T > hookFn, T *userData)
 Registers a hook to run when the game saves such as on "Saving..." auto saving screens Or when selecting the menu option: "Main Menu > HELP & OPTIONS > SAVE / LOAD > SAVE".
Public Member Functions inherited from BaseMod::ApiWrapper< BaseMod_HookApi >
bool VersionError ()
bool IsValid ()
const BaseMod_HookApiGetCApi ()

Additional Inherited Members

Protected Attributes inherited from BaseMod::ApiWrapper< BaseMod_HookApi >
const BaseMod_HookApi_ref

Member Function Documentation

◆ AfterGameUpdate() [1/2]

HookId BaseMod::HookApi::AfterGameUpdate ( BaseMod_GameUpdateHook hookFn,
void * userData )
inline

Registers a hook to run after the game state updates.

Use this to read game state as soon as it updates or to overwrite the game state right after the game updates it.

Parameters
hookFnThe callback function, see type BaseMod_GameUpdateHook.
userDataA generic pointer to state data that will be forwarded to hookFn.
Returns
A hook id value that can be passed to RemoveHook.
509 {
510 return _ref->AfterGameUpdate(hookFn, userData);
511 }

◆ AfterGameUpdate() [2/2]

template<typename T>
HookId BaseMod::HookApi::AfterGameUpdate ( GameUpdateHook< T > hookFn,
T * userData )
inline

Registers a hook to run after the game state updates.

Use this to read game state as soon as it updates or to overwrite the game state right after the game updates it. Template version for type safety on the userData pointer.

Parameters
hookFnThe callback function, see type GameUpdateHook<T>.
userDataA generic pointer to state data that will be forwarded to hookFn.
Returns
A hook id value that can be passed to RemoveHook.
525 {
526 return _ref->AfterGameUpdate(
527 reinterpret_cast<BaseMod_GameUpdateHook>(hookFn),
528 userData);
529 }

◆ AfterPeekMessage() [1/2]

HookId BaseMod::HookApi::AfterPeekMessage ( BaseMod_PeekMessageHook hookFn,
void * userData )
inline

Registers a hook to the PeekMessage hook.

Use this to read windows message such as low level keyboard inputs. This hook is a call replacement and not a direct PeekMessage hook so callbacks are only called for messages retrieved by the game window. The parameters used to call PeekMessage are provided in the BaseMod_PeekMessageInfo parameter of BaseMod_PeekMessageHook.

Parameters
hookFnThe callback function, see type BaseMod_PeekMessageHook.
userDataA generic pointer to state data that will be forwarded to hookFn.
Returns
A hook id value that can be passed to RemoveHook.
444 {
445 return _ref->AfterPeekMessage(hookFn, userData);
446 }

◆ AfterPeekMessage() [2/2]

template<typename T>
HookId BaseMod::HookApi::AfterPeekMessage ( PeekMessageHook< T > hookFn,
T * userData )
inline

Registers a hook to the PeekMessage hook.

Use this to read windows message such as low level keyboard inputs. This hook is a call replacement and not a direct PeekMessage hook so callbacks are only called for messages retrieved by the game window. The parameters used to call PeekMessage are provided in the BaseMod_PeekMessageInfo parameter of BaseMod::PeekMessageHook<T>. Template version for type safety on the userData pointer.

Parameters
hookFnThe callback function, see type PeekMessageHook<T>.
userDataA generic pointer to state data that will be forwarded to hookFn.
Returns
A hook id value that can be passed to RemoveHook.
463 {
464 return _ref->AfterPeekMessage(
465 reinterpret_cast<BaseMod_PeekMessageHook>(hookFn),
466 userData);
467 }

◆ AfterSaveGame() [1/2]

HookId BaseMod::HookApi::AfterSaveGame ( BaseMod_SaveGameHook hookFn,
void * userData )
inline

Registers a hook to run when the game saves such as on "Saving..." auto saving screens Or when selecting the menu option: "Main Menu > HELP & OPTIONS > SAVE / LOAD > SAVE".

Use this hook to trigger saving mod data.

Parameters
hookFnThe callback function, see type BaseMod_SaveGameHook.
userDataA generic pointer to state data that will be forwarded to hookFn.
Returns
A hook id value that can be passed to RemoveHook.
603 {
604 return _ref->AfterSaveGame(hookFn, userData);
605 }

◆ AfterSaveGame() [2/2]

template<typename T>
HookId BaseMod::HookApi::AfterSaveGame ( SaveGameHook< T > hookFn,
T * userData )
inline

Registers a hook to run when the game saves such as on "Saving..." auto saving screens Or when selecting the menu option: "Main Menu > HELP & OPTIONS > SAVE / LOAD > SAVE".

Use this hook to trigger saving mod data.

Parameters
hookFnThe callback function, see type SaveGameHook<T>.
userDataA generic pointer to state data that will be forwarded to hookFn.
Returns
A hook id value that can be passed to RemoveHook.
618 {
619 return _ref->AfterSaveGame(
620 reinterpret_cast<BaseMod_SaveGameHook>(hookFn),
621 userData
622 );
623 }

◆ BeforeEndScene() [1/2]

HookId BaseMod::HookApi::BeforeEndScene ( BaseMod_DrawHook hookFn,
void * userData )
inline

Registers a hook to run before the call to IDirect3DDevice9::EndScene.

Use this to add additional graphics logic to the game's main scene.

Parameters
hookFnThe callback function, see type BaseMod_DrawHook.
userDataA generic pointer to state data that will be forwarded to hookFn.
Returns
A hook id value that can be passed to RemoveHook.
540 {
541 return _ref->BeforeEndScene(hookFn, userData);
542 }

◆ BeforeEndScene() [2/2]

template<typename T>
HookId BaseMod::HookApi::BeforeEndScene ( DrawHook< T > hookFn,
T * userData )
inline

Registers a hook to run before the call to IDirect3DDevice9::EndScene.

Use this to add additional graphics logic to the game's main scene. Template version for type safety on the userData pointer.

Parameters
hookFnThe callback function, see type DrawHook<T>.
userDataA generic pointer to state data that will be forwarded to hookFn.
Returns
A hook id value that can be passed to RemoveHook.
555 {
556 return _ref->BeforeEndScene(
557 reinterpret_cast<BaseMod_DrawHook>(hookFn),
558 userData);
559 }

◆ BeforeGameUpdate() [1/2]

HookId BaseMod::HookApi::BeforeGameUpdate ( BaseMod_GameUpdateHook hookFn,
void * userData )
inline

Registers a hook to run before the game state updates.

Use this to apply changes to the game state right before it runs an update.

Parameters
hookFnThe callback function, see type BaseMod_GameUpdateHook.
userDataA generic pointer to state data that will be forwarded to hookFn.
Returns
A hook id value that can be passed to RemoveHook.
478 {
479 return _ref->BeforeGameUpdate(hookFn, userData);
480 }

◆ BeforeGameUpdate() [2/2]

template<typename T>
HookId BaseMod::HookApi::BeforeGameUpdate ( GameUpdateHook< T > hookFn,
T * userData )
inline

Registers a hook to run before the game state updates.

Use this to apply changes to the game state right before it runs an update. Template version for type safety on the userData pointer.

Parameters
hookFnThe callback function, see type GameUpdateHook<T>.
userDataA generic pointer to state data that will be forwarded to hookFn.
Returns
A hook id value that can be passed to RemoveHook.
493 {
494 return _ref->BeforeGameUpdate(
495 reinterpret_cast<BaseMod_GameUpdateHook>(hookFn),
496 userData);
497 }

◆ BeforePresent() [1/2]

HookId BaseMod::HookApi::BeforePresent ( BaseMod_DrawHook hookFn,
void * userData )
inline

Registers a hook to run before the call to IDirect3DDevice9::Present.

Use this to add a new scene to the current frame. Hooks registered must start and end their own scene with IDirect3DDevice9::BeginScene and IDirect3DDevice9::EndScene.

Parameters
hookFnThe callback function, see type BaseMod_DrawHook.
userDataA generic pointer to state data that will be forwarded to hookFn.
Returns
A hook id value that can be passed to RemoveHook.
571 {
572 return _ref->BeforePresent(hookFn, userData);
573 }

◆ BeforePresent() [2/2]

template<typename T>
HookId BaseMod::HookApi::BeforePresent ( DrawHook< T > hookFn,
T * userData )
inline

Registers a hook to run before the call to IDirect3DDevice9::Present.

Use this to add a new scene to the current frame. Hooks registered must start and end their own scene with IDirect3DDevice9::BeginScene and IDirect3DDevice9::EndScene. Template version for type safety on the userData pointer.

Parameters
hookFnThe callback function, see type DrawHook<T>.
userDataA generic pointer to state data that will be forwarded to hookFn.
Returns
A hook id value that can be passed to RemoveHook.
587 {
588 return _ref->BeforePresent(
589 reinterpret_cast<BaseMod_DrawHook>(hookFn),
590 userData);
591 }

◆ RemoveHook()

uint32_t BaseMod::HookApi::RemoveHook ( HookId id)
inline

Removes a hook from the registry.

Parameters
idThe BaseMod::HookId of the hook to be removed.
Returns
zero if no error occurred, otherwise returns the error code.
427 {
428 return _ref->RemoveHook(id);
429 }

The documentation for this class was generated from the following file: