GearLoader 1.1.0
Mod loader for GGXXACPR
Loading...
Searching...
No Matches
baseMod_c.h
1#ifndef BASEMOD_H
2#define BASEMOD_H
3
4#define BASEMOD_NAME "baseMod"
5#define BASEMOD_API_VERSION "1.1.0"
6#define BASEMOD_API_VERSION_NUM 0x010100
7#define BASEMOD_CALL __stdcall
8
9#ifdef __cplusplus
10 #include <cstdint>
11#else
12 #include <stdint.h>
13#endif
14
15#include "gearLoader/ggxxacpr_c.h"
16
17#ifdef __cplusplus
18extern "C" {
19#endif
20
21
22typedef enum BM_DrawArrowSpriteDirection {
23 BM_DASD_LEFT = 0x01,
24 BM_DASD_RIGHT = 0x02,
25 BM_DASD_UP = 0x04,
26 BM_DASD_DOWN = 0x08,
27 BM_DASD_UP_LEFT = 0x10,
28 BM_DASD_UP_RIGHT = 0x20,
29 BM_DASD_DOWN_LEFT = 0x40,
30 BM_DASD_DOWN_RIGHT = 0x80,
31} BM_DrawArrowSpriteDirection;
32typedef enum BM_DrawScrollArrowFlags {
33 BM_DSAF_NONE = 0,
34 BM_DSAF_UP = 1,
35 BM_DSAF_DOWN = 2,
36 BM_DSAF_BOTH = 3,
37} BM_DrawScrollArrowFlags;
38
41 uint32_t size;
43 uint32_t version;
44
66 void BASEMOD_CALL (*RenderCockpitFontText)(const char* text, int32_t x, int32_t y, float z, uint8_t alpha, float size);
88 void BASEMOD_CALL (*RenderMenuText)(const char* text, int32_t x, int32_t y, float z,
89 float alpha, int32_t* animCounter, int32_t animSpeed, int32_t ignoreSpriteMask, uint32_t color);
106 void BASEMOD_CALL (*RenderMenuTextCenterAligned)(const char* text, int32_t x, int32_t y,
107 float z, float alpha, uint32_t color, int32_t ignoreSpriteMask);
114 void BASEMOD_CALL (*RenderPopUpText)(int32_t playerIndex, const char* text);
115
126 uint32_t BASEMOD_CALL (*PlayCommonSoundEffect)(uint32_t id);
127
137 void BASEMOD_CALL (*DrawSprite)(GGXXACPR_DrawSpriteParams* params, int32_t ignoreSpriteMask);
138
148 void BASEMOD_CALL (*DrawArrowSprite)(uint32_t directionFlag, int32_t x, int32_t y, int32_t z, uint32_t alpha);
149
159 void BASEMOD_CALL (*DrawTriStrip)(GGXXACPR_ColorVertex* vertices, uint32_t numVertices);
160
179 void BASEMOD_CALL (*DrawQuad)(int32_t left, int32_t top, int32_t right, int32_t bottom, int32_t z, uint32_t color);
180
198 uint32_t BASEMOD_CALL (*RegisterSprites)(uint32_t spriteId, void* textureDataArray, uint32_t count);
199
204 uint32_t BASEMOD_CALL (*GetActiveCommandGrabId)(GGXXACPR_Entity* player);
205};
206
207
208typedef enum BM_PushboxDimensionArrayType {
209 BM_PD_STANDING_WIDTH,
210 BM_PD_STANDING_HEIGHT_AC,
211 BM_PD_STANDING_HEIGHT_PR,
212 BM_PD_CROUCHING_WIDTH,
213 BM_PD_CROUCHING_HEIGHT,
214 BM_PD_AIRBORNE_WIDTH,
215 BM_PD_AIRBORNE_HEIGHT,
216} BM_PushboxDimensionArrayType;
217typedef enum BM_ThrowRangeArrayType {
218 BM_TR_GROUND_AC,
219 BM_TR_GROUND_PR,
220 BM_TR_AIR_HORIZONTAL_AC,
221 BM_TR_AIR_HORIZONTAL_PR,
222 BM_TR_AIR_UPPER,
223 BM_TR_AIR_LOWER,
224} BM_ThrowRangeArrayType;
225
228 uint32_t size;
230 uint32_t version;
231
239 uint16_t* BASEMOD_CALL (*GetPushboxDimensionArray)(int32_t type);
249 int16_t* BASEMOD_CALL (*GetPushboxAirborneOffsetArray)(int32_t gameVer);
257 int16_t* BASEMOD_CALL (*GetThrowRangeArray)(int32_t type);
263 uint16_t* BASEMOD_CALL (*GetCommandGrabRangeArray)();
264};
265
268 uint32_t size;
270 uint32_t version;
271
276
288 GGXXACPR_Entity* BASEMOD_CALL (*GetPlayer)(int playerIndex);
300 GGXXACPR_Camera* BASEMOD_CALL (*GetCamera)();
304 int32_t BASEMOD_CALL (*IsInGame)();
309 int32_t BASEMOD_CALL (*GetJobMode)();
313 uint32_t BASEMOD_CALL (*GetGameModeFeatureFlags)();
320 uint32_t BASEMOD_CALL (*GetMainMenuSelection)();
327 void* BASEMOD_CALL (*GetD3D9Device)();
333 uint32_t BASEMOD_CALL (*GetGameVersion)();
337 uint32_t BASEMOD_CALL (*GetViewWidth)();
341 uint32_t BASEMOD_CALL (*GetViewHeight)();
348 GGXXACPR_Entity* BASEMOD_CALL (*GetRootEntity)();
352 uint32_t BASEMOD_CALL (*GetGlobalThrowFlags)();
358 int32_t* BASEMOD_CALL (*GetPauseState)();
364 int32_t* BASEMOD_CALL (*GetPauseDisplayState)();
369};
370
371typedef uint32_t BaseMod_HookId;
372typedef struct BaseMod_HookContext BaseMod_HookContext;
373
375 void* lpMsg;
376 void* hWnd;
378 uint32_t wMsgFilterMax;
379 uint32_t wRemoveMsg;
383 int success;
385typedef void BASEMOD_CALL (*BaseMod_PeekMessageHook)(void* userData, const BaseMod_HookContext* ctx, const BaseMod_PeekMessageInfo* info);
386
388typedef struct BaseMod_GameUpdateInfo BaseMod_GameUpdateInfo;
390typedef void BASEMOD_CALL (*BaseMod_GameUpdateHook)(void* userData, const BaseMod_HookContext* ctx, const BaseMod_GameUpdateInfo* info);
391
392typedef struct BaseMod_DrawInfo {
394 void* device;
396typedef void BASEMOD_CALL (*BaseMod_DrawHook)(void* userData, const BaseMod_HookContext* ctx, const BaseMod_DrawInfo* info);
402typedef void BASEMOD_CALL (*BaseMod_SaveGameHook)(void* userData, const BaseMod_HookContext* ctx, const BaseMod_SaveGameInfo* info);
403
407 uint32_t size;
409 uint32_t version;
410
417 uint32_t BASEMOD_CALL (*RemoveHook)(BaseMod_HookId id);
432 BaseMod_HookId BASEMOD_CALL (*AfterPeekMessage)(BaseMod_PeekMessageHook hookFn, void* userData);
443 BaseMod_HookId BASEMOD_CALL (*BeforeGameUpdate)(BaseMod_GameUpdateHook hookFn, void* userData);
455 BaseMod_HookId BASEMOD_CALL (*AfterGameUpdate)(BaseMod_GameUpdateHook hookFn, void* userData);
466 BaseMod_HookId BASEMOD_CALL (*BeforeEndScene)(BaseMod_DrawHook hookFn, void* userData);
478 // Called outside the game's begin scene context before present is called.
479 BaseMod_HookId BASEMOD_CALL (*BeforePresent)(BaseMod_DrawHook hookFn, void* userData);
491 BaseMod_HookId BASEMOD_CALL (*AfterSaveGame)(BaseMod_SaveGameHook hookFn, void* userData);
492};
493
494
495typedef void (BASEMOD_CALL *BM_MenuAction)();
496typedef void (BASEMOD_CALL *BM_ValueChangeCallback)(int32_t value);
515typedef struct BaseMod_ModMenuEntry {
522 const char* Label;
528 int32_t* Value;
534 int32_t MinValue;
540 int32_t MaxValue;
547 const char** ValueLabels;
549 BM_MenuAction Command;
551 BM_ValueChangeCallback ValueChanged;
553
561 uint16_t left;
562 uint16_t top;
563 uint16_t right;
564 uint16_t bottom;
566
569 uint32_t size;
578 uint32_t version;
579
589 int32_t BASEMOD_CALL (*SelectionHandler)(int32_t currentSelection, uint32_t totalEntries);
590
598 int32_t BASEMOD_CALL (*HoldDirectionInputHandler)(uint32_t input);
599
611 void BASEMOD_CALL (*DrawEnumSettingUI)(const char* label, int32_t xOffset, int32_t y, int32_t isSelected);
612
624 void BASEMOD_CALL (*DrawGaugeSettingUI)(int32_t currentValue, int32_t y, int32_t isSelected, int32_t maxValue);
625
633 void BASEMOD_CALL (*DrawScrollArrow)(int32_t flags);
634
641 void BASEMOD_CALL (*SwitchToMainFiber)();
642
644typedef void (BASEMOD_CALL *BM_CustomMenuHandler)(GGXXACPR_PlayerInput* inputArr);
645
649 uint32_t size;
658 uint32_t version;
659
678 uint32_t BASEMOD_CALL (*RegisterMenuTab)(const char* title, const BaseMod_ModMenuEntry* entries, uint32_t numEntries);
690 uint32_t BASEMOD_CALL (*RegisterCustomMenuTab)(const char* title, BM_CustomMenuHandler handler);
691};
692
719
720#ifdef __cplusplus
721} // extern "C"
722#endif
723
724#endif
Root struct for the base mod API.
Definition baseMod_c.h:698
uint32_t size
The size of the struct in bytes.
Definition baseMod_c.h:700
const struct BaseMod_GameDataApi * GameData
Curated access to game data.
Definition baseMod_c.h:713
const struct BaseMod_NativeFunctionsApi * NativeFunctions
API for invoking native game functions.
Definition baseMod_c.h:711
const struct BaseMod_ModMenuApi * ModMenu
Add options to the mod menu.
Definition baseMod_c.h:717
uint32_t version
the API version.
Definition baseMod_c.h:709
const struct BaseMod_HookApi * Hooks
Function hooking manager.
Definition baseMod_c.h:715
Definition baseMod_c.h:226
uint16_t *BASEMOD_CALL(* GetPushboxDimensionArray)(int32_t type)
Returns a pointer to the push box array specified by the type parameter.
Definition baseMod_c.h:239
uint16_t *BASEMOD_CALL(* GetCommandGrabRangeArray)()
Returns a pointer to the command throw range array.
Definition baseMod_c.h:263
int16_t *BASEMOD_CALL(* GetPushboxAirborneOffsetArray)(int32_t gameVer)
Returns a pointer to the game's airborne pushbox offset array.
Definition baseMod_c.h:249
int16_t *BASEMOD_CALL(* GetThrowRangeArray)(int32_t type)
Returns a pointer to the throw range array specified by the type parameter.
Definition baseMod_c.h:257
uint32_t version
The API version.
Definition baseMod_c.h:230
uint32_t size
The size of the struct in bytes.
Definition baseMod_c.h:228
Definition baseMod_c.h:392
void * device
include d3d9.h and cast to IDirect3DDevice9*.
Definition baseMod_c.h:394
Definition baseMod_c.h:266
void *BASEMOD_CALL(* GetD3D9Device)()
Returns the D3D9 device pointer.
Definition baseMod_c.h:327
uint32_t size
The size of the struct in bytes.
Definition baseMod_c.h:268
const struct BaseMod_CharDataApi * CharacterData
API for accessing static character data.
Definition baseMod_c.h:275
uint32_t BASEMOD_CALL(* GetGlobalThrowFlags)()
Gets raw throw detection info.
Definition baseMod_c.h:352
int32_t BASEMOD_CALL(* GetJobMode)()
Returns the current job mode, see enum GGXXACPR_JobMode. This variable determines what scene the game...
Definition baseMod_c.h:309
uint32_t BASEMOD_CALL(* GetMainMenuSelection)()
Enum GGXXACPR_MainMenuItem. Returns the game mode selected from the main menu.
Definition baseMod_c.h:320
uint32_t BASEMOD_CALL(* GetViewWidth)()
Returns the current view width.
Definition baseMod_c.h:337
int32_t BASEMOD_CALL(* IsInGame)()
returns a non-zero value if the game is on the battle screen.
Definition baseMod_c.h:304
uint32_t version
The API version.
Definition baseMod_c.h:270
uint32_t BASEMOD_CALL(* GetGameModeFeatureFlags)()
See enum GGXXACPR_GameModeFeatureFlags. Returns the current game mode feature flags.
Definition baseMod_c.h:313
GGXXACPR_LocaleState *BASEMOD_CALL(* GetLocaleState)()
Gets a pointer to the game's locale state. see GGXXACPR_LocaleState.
Definition baseMod_c.h:368
GGXXACPR_Entity *BASEMOD_CALL(* GetPlayer)(int playerIndex)
Gets player data.
Definition baseMod_c.h:288
int32_t *BASEMOD_CALL(* GetPauseDisplayState)()
Gets a pointer to the pause display state global variable.
Definition baseMod_c.h:364
uint32_t BASEMOD_CALL(* GetViewHeight)()
Returns the current view height.
Definition baseMod_c.h:341
GGXXACPR_PlayerInput *BASEMOD_CALL(* GetPlayerInputStructArr)()
Gets a pointer to the player input struct array. See GGXXACPR_PlayerInput.
Definition baseMod_c.h:296
GGXXACPR_Camera *BASEMOD_CALL(* GetCamera)()
Gets camera data.
Definition baseMod_c.h:300
int32_t *BASEMOD_CALL(* GetPauseState)()
Gets a pointer to the pause state global variable.
Definition baseMod_c.h:358
uint32_t BASEMOD_CALL(* GetGameVersion)()
Gets the current game version. See enum GGXXACPR_GameVersion.
Definition baseMod_c.h:333
GGXXACPR_Entity *BASEMOD_CALL(* GetRootEntity)()
Returns a pointer to the root entity.
Definition baseMod_c.h:348
Adds callbacks to managed function hooks.
Definition baseMod_c.h:405
BaseMod_HookId BASEMOD_CALL(* BeforeEndScene)(BaseMod_DrawHook hookFn, void *userData)
Registers a hook to run before the call to IDirect3DDevice9::EndScene.
Definition baseMod_c.h:466
uint32_t version
The API version.
Definition baseMod_c.h:409
BaseMod_HookId BASEMOD_CALL(* BeforePresent)(BaseMod_DrawHook hookFn, void *userData)
Registers a hook to run after the call to IDirect3DDevice9::EndScene but before the call to IDirect3D...
Definition baseMod_c.h:479
uint32_t BASEMOD_CALL(* RemoveHook)(BaseMod_HookId id)
Removes a hook from the registry.
Definition baseMod_c.h:417
uint32_t size
The size of the struct in bytes.
Definition baseMod_c.h:407
BaseMod_HookId BASEMOD_CALL(* BeforeGameUpdate)(BaseMod_GameUpdateHook hookFn, void *userData)
Registers a hook to run before the game state updates.
Definition baseMod_c.h:443
BaseMod_HookId BASEMOD_CALL(* AfterGameUpdate)(BaseMod_GameUpdateHook hookFn, void *userData)
Registers a hook to run after the game state updates.
Definition baseMod_c.h:455
BaseMod_HookId BASEMOD_CALL(* AfterSaveGame)(BaseMod_SaveGameHook hookFn, void *userData)
Registers a hook to run when the game saves such as on "Saving..." auto saving screens Or when select...
Definition baseMod_c.h:491
BaseMod_HookId BASEMOD_CALL(* AfterPeekMessage)(BaseMod_PeekMessageHook hookFn, void *userData)
Registers a callback to the PeekMessage hook.
Definition baseMod_c.h:432
Rectangle dimensions bounding the drawable menu area given in internal resolution screen space coordi...
Definition baseMod_c.h:560
Definition baseMod_c.h:567
void BASEMOD_CALL(* DrawScrollArrow)(int32_t flags)
Draws one or both of the menu scroll arrows.
Definition baseMod_c.h:633
void BASEMOD_CALL(* DrawGaugeSettingUI)(int32_t currentValue, int32_t y, int32_t isSelected, int32_t maxValue)
Draws the gauge setting UI.
Definition baseMod_c.h:624
uint32_t version
the API version.
Definition baseMod_c.h:578
void BASEMOD_CALL(* DrawEnumSettingUI)(const char *label, int32_t xOffset, int32_t y, int32_t isSelected)
Draws the enum setting UI.
Definition baseMod_c.h:611
int32_t BASEMOD_CALL(* SelectionHandler)(int32_t currentSelection, uint32_t totalEntries)
Handles updating the current menu selection.
Definition baseMod_c.h:589
uint32_t size
The size of the struct in bytes.
Definition baseMod_c.h:569
void BASEMOD_CALL(* SwitchToMainFiber)()
Yields control back to the main fiber. Use this to pause BM_CustomMenuHandler execution until the nex...
Definition baseMod_c.h:641
int32_t BASEMOD_CALL(* HoldDirectionInputHandler)(uint32_t input)
Handles input repeating for held direction inputs.
Definition baseMod_c.h:598
Add options to mod menu.
Definition baseMod_c.h:647
uint32_t version
the API version.
Definition baseMod_c.h:658
uint32_t BASEMOD_CALL(* RegisterCustomMenuTab)(const char *title, BM_CustomMenuHandler handler)
Registers a custom menu handler function.
Definition baseMod_c.h:690
uint32_t BASEMOD_CALL(* RegisterMenuTab)(const char *title, const BaseMod_ModMenuEntry *entries, uint32_t numEntries)
Registers a menu tab definition with the mod menu.
Definition baseMod_c.h:678
uint32_t size
The size of the struct in bytes.
Definition baseMod_c.h:649
const BaseMod_MenuDimensions *BASEMOD_CALL(* GetDrawableAreaDimensions)()
Gets a pointer to a struct defining the bounds of the drawable menu area.
Definition baseMod_c.h:669
const BaseMod_ModMenu_HelperFunctionsApi * HelperFunctions
A collection of helper functions for implementing your own custom menu handler.
Definition baseMod_c.h:663
Represents a mod menu entry.
Definition baseMod_c.h:515
int32_t MaxValue
Maximum value for Number Line and maximum index for value labels (i.e. ValueLabel size - 1).
Definition baseMod_c.h:540
BM_ValueChangeCallback ValueChanged
Optional value changed callback. Can be used to update other values based on the entry Value.
Definition baseMod_c.h:551
const char * Label
Primary label.
Definition baseMod_c.h:522
int32_t * Value
Real value behind the setting.
Definition baseMod_c.h:528
BM_MenuAction Command
Optional command callback when entry is selected and pressed.
Definition baseMod_c.h:549
const char ** ValueLabels
A list of labels to assign to each value.
Definition baseMod_c.h:547
int32_t MinValue
Minimum value. Should almost always be 0. Inclusive.
Definition baseMod_c.h:534
Definition baseMod_c.h:39
uint32_t BASEMOD_CALL(* PlayCommonSoundEffect)(uint32_t id)
Plays a sound effect.
Definition baseMod_c.h:126
void BASEMOD_CALL(* RenderPopUpText)(int32_t playerIndex, const char *text)
A higher level text rendering function that triggers a text popup animation in-game (e....
Definition baseMod_c.h:114
uint32_t BASEMOD_CALL(* RegisterSprites)(uint32_t spriteId, void *textureDataArray, uint32_t count)
Registers sprite data to a spriteId to later be rendered with BaseMod_NativeFunctionsApi::DrawSprite.
Definition baseMod_c.h:198
void BASEMOD_CALL(* DrawArrowSprite)(uint32_t directionFlag, int32_t x, int32_t y, int32_t z, uint32_t alpha)
DrawSprite wrapper function that draws an arrow sprite.
Definition baseMod_c.h:148
void BASEMOD_CALL(* RenderMenuTextCenterAligned)(const char *text, int32_t x, int32_t y, float z, float alpha, uint32_t color, int32_t ignoreSpriteMask)
Draws centered aligned text to the screen.
Definition baseMod_c.h:106
uint32_t size
The size of the struct in bytes.
Definition baseMod_c.h:41
uint32_t version
The API version.
Definition baseMod_c.h:43
void BASEMOD_CALL(* DrawQuad)(int32_t left, int32_t top, int32_t right, int32_t bottom, int32_t z, uint32_t color)
Draws a rectangle to the screen.
Definition baseMod_c.h:179
void BASEMOD_CALL(* DrawSprite)(GGXXACPR_DrawSpriteParams *params, int32_t ignoreSpriteMask)
Draws a sprite to the screen.
Definition baseMod_c.h:137
void BASEMOD_CALL(* RenderMenuText)(const char *text, int32_t x, int32_t y, float z, float alpha, int32_t *animCounter, int32_t animSpeed, int32_t ignoreSpriteMask, uint32_t color)
Draws text to the screen such as the text seen in pause menus.
Definition baseMod_c.h:88
void BASEMOD_CALL(* RenderCockpitFontText)(const char *text, int32_t x, int32_t y, float z, uint8_t alpha, float size)
Draws cockpit font text to the screen.
Definition baseMod_c.h:66
void BASEMOD_CALL(* DrawTriStrip)(GGXXACPR_ColorVertex *vertices, uint32_t numVertices)
Draws a triangle strip primitive.
Definition baseMod_c.h:159
uint32_t BASEMOD_CALL(* GetActiveCommandGrabId)(GGXXACPR_Entity *player)
If the given player currently has an active command grab, returns its command grab id,...
Definition baseMod_c.h:204
Definition baseMod_c.h:374
uint32_t wMsgFilterMin
HWND from WinDef.h
Definition baseMod_c.h:377
void * hWnd
MSG from winuser.h
Definition baseMod_c.h:376
Definition baseMod_c.h:381
Reserved.
Definition baseMod_c.h:398
void * saveFileStruct
Pointer to an undocumented save file structure.
Definition baseMod_c.h:400
Definition ggxxacpr_c.h:593
Definition ggxxacpr_c.h:1237
Definition ggxxacpr_c.h:1245
Definition ggxxacpr_c.h:1045
Definition ggxxacpr_c.h:468
Definition ggxxacpr_c.h:489