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

Public Member Functions

int32_t SelectionHandler (int32_t currentSelection, uint32_t totalEntries)
 Handles updating the current menu selection.
bool HoldDirectionInputHandler (ggxxacpr::RawControllerInput input)
 Handles input repeating for held direction inputs.
void DrawEnumSettingUI (const char *label, int32_t xOffset, int32_t y, int32_t isSelected)
 Draws the enum setting UI.
void DrawGaugeSettingUI (int32_t currentValue, int32_t y, int32_t isSelected, int32_t maxValue)
 Draws the gauge setting UI.
void DrawScrollArrow (DrawScrollArrowFlags flags)
 Draws one or both of the menu scroll arrows.
void SwitchToMainFiber ()
 Yields control back to the main fiber. Use this to pause BaseMod::CustomMenuHandler execution until the next frame. Useful for sub-menus.
Public Member Functions inherited from BaseMod::ApiWrapper< BaseMod_ModMenu_HelperFunctionsApi >
bool VersionError ()
bool IsValid ()
const BaseMod_ModMenu_HelperFunctionsApiGetCApi ()

Additional Inherited Members

Protected Attributes inherited from BaseMod::ApiWrapper< BaseMod_ModMenu_HelperFunctionsApi >
const BaseMod_ModMenu_HelperFunctionsApi_ref

Member Function Documentation

◆ DrawEnumSettingUI()

void BaseMod::ModMenuHelperFunctionsApi::DrawEnumSettingUI ( const char * label,
int32_t xOffset,
int32_t y,
int32_t isSelected )
inline

Draws the enum setting UI.

Parameters
labelLabel of the current value. This label is drawn via the RenderCockpitFontText internal function. String format and character restrictions apply. see BaseMod::NativeFunctionsApi::RenderCockpitFontText for details.
xOffsetOffset from the default x position. Internal resolution screen-space coordinates.
yInternal resolution screen-space coordinate (640x480). Top edge is 0, bottom is 480.
isSelectedA 4-byte boolean that determines transparency. Opaque if param is non-zero, semi-transparent if zero.
669 {
670 _ref->DrawEnumSettingUI(label, xOffset, y, isSelected);
671 }

◆ DrawGaugeSettingUI()

void BaseMod::ModMenuHelperFunctionsApi::DrawGaugeSettingUI ( int32_t currentValue,
int32_t y,
int32_t isSelected,
int32_t maxValue )
inline

Draws the gauge setting UI.

The native function invoked here has a hard-coded x position.

Parameters
currentValueValue to display on the gauge.
yInternal resolution screen-space coordinate (640x480). Top edge is 0, bottom is 480.
isSelectedA 4-byte boolean that determines transparency. Opaque if param is non-zero, semi-transparent if zero.
maxValueMaximum value the gauge should display.
683 {
684 _ref->DrawGaugeSettingUI(currentValue, y, isSelected, maxValue);
685 }

◆ DrawScrollArrow()

void BaseMod::ModMenuHelperFunctionsApi::DrawScrollArrow ( DrawScrollArrowFlags flags)
inline

Draws one or both of the menu scroll arrows.

This is the same sprite as the scroll arrows in the training menu but with custom positions.

Parameters
flagscontrols which arrows are drawn.
693 {
694 _ref->DrawScrollArrow(static_cast<int32_t>(flags));
695 }

◆ HoldDirectionInputHandler()

bool BaseMod::ModMenuHelperFunctionsApi::HoldDirectionInputHandler ( ggxxacpr::RawControllerInput input)
inline

Handles input repeating for held direction inputs.

Uses this for left/right inputs in the menu or custom selection handling.

Parameters
inputThe direction to check
Returns
true if the input should be processed for a repeat
655 {
656 return _ref->HoldDirectionInputHandler(static_cast<uint32_t>(input));
657 }

◆ SelectionHandler()

int32_t BaseMod::ModMenuHelperFunctionsApi::SelectionHandler ( int32_t currentSelection,
uint32_t totalEntries )
inline

Handles updating the current menu selection.

Updates selection based on player input and implements hold-repeat functionality identically to native menus.

Parameters
currentSelectionThe selection value. 0 is the top menu item.
totalEntriesNumber of entries in the current menu (i.e. maximum value + 1). Needed for selection wrapping.
644 {
645 return _ref->SelectionHandler(currentSelection, totalEntries);
646 }

◆ SwitchToMainFiber()

void BaseMod::ModMenuHelperFunctionsApi::SwitchToMainFiber ( )
inline

Yields control back to the main fiber. Use this to pause BaseMod::CustomMenuHandler execution until the next frame. Useful for sub-menus.

See doc on Fibers.

702 {
703 _ref->SwitchToMainFiber();
704 }

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