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

Public Member Functions

 ModMenuApi (const BaseMod_ModMenuApi *ref)
MenuDimensions GetDrawableAreaDimensions ()
 Get's a pointer to a struct defining the bounds of the drawable menu area.
uint32_t RegisterMenuTab (const char *title, const ModMenuEntry *entries, uint32_t numEntries)
 Registers a menu tab definition with the mod menu.
uint32_t RegisterCustomMenuTab (const char *title, CustomMenuHandler handler)
 Registers a custom menu handler function.
Public Member Functions inherited from BaseMod::ApiWrapper< BaseMod_ModMenuApi >
bool VersionError ()
bool IsValid ()
const BaseMod_ModMenuApiGetCApi ()

Data Fields

ModMenuHelperFunctionsApi HelperFunctions

Additional Inherited Members

Protected Attributes inherited from BaseMod::ApiWrapper< BaseMod_ModMenuApi >
const BaseMod_ModMenuApi_ref

Constructor & Destructor Documentation

◆ ModMenuApi() [1/2]

BaseMod::ModMenuApi::ModMenuApi ( )
inline
709 :
710 ApiWrapper(),
711 HelperFunctions() { }

◆ ModMenuApi() [2/2]

BaseMod::ModMenuApi::ModMenuApi ( const BaseMod_ModMenuApi * ref)
inline
712 :
713 ApiWrapper(ref),
714 HelperFunctions(ref->HelperFunctions) {}
const BaseMod_ModMenu_HelperFunctionsApi * HelperFunctions
A collection of helper functions for implementing your own custom menu handler.
Definition baseMod_c.h:663

Member Function Documentation

◆ GetDrawableAreaDimensions()

MenuDimensions BaseMod::ModMenuApi::GetDrawableAreaDimensions ( )
inline

Get's a pointer to a struct defining the bounds of the drawable menu area.

Use these dimensions to future proof BM_CustomMenuHandler implementations.

723 {
724 auto dim = _ref->GetDrawableAreaDimensions();
725 return {dim->left, dim->top, dim->right, dim->bottom};
726 }

◆ RegisterCustomMenuTab()

uint32_t BaseMod::ModMenuApi::RegisterCustomMenuTab ( const char * title,
CustomMenuHandler handler )
inline

Registers a custom menu handler function.

Parameters
titleTab name. Character limitations are similar to BaseMod_NativeFunctionsApi::RenderCockpitFontText
handlerCustom menu handler function invoked by the Mod Menu Manager. This callback is invoked after the Mod Menu handles fiber switching, tab switching, and exiting the menu, so there is no need to implement that functionality in this callback. It's recommend to use the dimensions from GetDrawableAreaDimensions to future proof your implementation. Refer to the source code at source/baseMod/modMenu/modMenu.cpp::ModMenu() for an example of implementing your own handler.
748 {
749 return _ref->RegisterCustomMenuTab(title, handler);
750 }

◆ RegisterMenuTab()

uint32_t BaseMod::ModMenuApi::RegisterMenuTab ( const char * title,
const ModMenuEntry * entries,
uint32_t numEntries )
inline

Registers a menu tab definition with the mod menu.

Parameters
titleTab name. Character limitations are similar to BaseMod_NativeFunctionsApi::RenderCockpitFontText
entriesAn array of BaseMod_ModMenuEntry structures comprising the menu definition. See BaseMod_ModMenuEntry. Callers must maintain the lifetime of values in the declaration.
Returns
0 if no error, else an error code.
735 {
736 return _ref->RegisterMenuTab(title, entries, numEntries);
737 }

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