6#include "gearLoader/ggxxacpr.hpp"
10using HookId = BaseMod_HookId;
11using HookContext = BaseMod_HookContext;
12using PeakMessageArgs = BaseMod_PeekMessageArgs;
13using PeekMessageInfo = BaseMod_PeekMessageInfo;
14using GameUpdateInfo = BaseMod_GameUpdateInfo;
15using DrawInfo = BaseMod_DrawInfo;
16using SaveGameInfo = BaseMod_SaveGameInfo;
18enum class PushboxDimensionArrayType : int32_t {
19 STANDING_WIDTH = BM_PD_STANDING_WIDTH,
20 STANDING_HEIGHT_AC = BM_PD_STANDING_HEIGHT_AC,
21 STANDING_HEIGHT_PR = BM_PD_STANDING_HEIGHT_PR,
22 CROUCHING_WIDTH = BM_PD_CROUCHING_WIDTH,
23 CROUCHING_HEIGHT = BM_PD_CROUCHING_HEIGHT,
24 AIRBORNE_WIDTH = BM_PD_AIRBORNE_WIDTH,
25 AIRBORNE_HEIGHT = BM_PD_AIRBORNE_HEIGHT,
27enum class ThrowRangeArrayType : int32_t {
28 GROUND_AC = BM_TR_GROUND_AC,
29 GROUND_PR = BM_TR_GROUND_PR,
30 AIR_HORIZONTAL_AC = BM_TR_AIR_HORIZONTAL_AC,
31 AIR_HORIZONTAL_PR = BM_TR_AIR_HORIZONTAL_PR,
32 AIR_UPPER = BM_TR_AIR_UPPER,
33 AIR_LOWER = BM_TR_AIR_LOWER,
35enum class DrawArrowSpriteDirection : uint32_t {
37 RIGHT = BM_DASD_RIGHT,
40 UP_LEFT = BM_DASD_UP_LEFT,
41 UP_RIGHT = BM_DASD_UP_RIGHT,
42 DOWN_LEFT = BM_DASD_DOWN_LEFT,
43 DOWN_RIGHT = BM_DASD_DOWN_RIGHT,
45enum class DrawScrollArrowFlags : int32_t {
56 ApiWrapper() : _ref(
nullptr) {}
57 ApiWrapper(
const T* ref) : _ref(ref) {}
59 return (BASEMOD_API_VERSION_NUM & 0xFF0000) !=
60 (
reinterpret_cast<CApiBase*
>(_ref)->version & 0xFF0000);
62 bool IsValid() {
return _ref !=
nullptr; }
63 const T* GetCApi() {
return _ref; }
97 _ref->RenderCockpitFontText(text.c_str(), x, y, z, alpha, size);
119 void RenderMenuText(
const char* text, int32_t x, int32_t y,
float z,
float alpha,
120 int32_t* animCounter, int32_t animSpeed,
bool ignoreSpriteMask, uint32_t color
122 _ref->RenderMenuText(text, x, y, z, alpha, animCounter, animSpeed, ignoreSpriteMask, color);
140 float z,
float alpha, uint32_t color,
bool ignoreSpriteMask
142 _ref->RenderMenuTextCenterAligned(text, x, y, z, alpha, color, ignoreSpriteMask);
151 _ref->RenderPopUpText(playerIndex, text.c_str());
165 return _ref->PlayCommonSoundEffect(
id);
178 _ref->DrawSprite(params, ignoreSpriteMask ? 1 : 0);
190 void DrawArrowSprite(DrawArrowSpriteDirection direction, int32_t x, int32_t y, int32_t z, uint32_t alpha) {
191 _ref->DrawArrowSprite(
static_cast<uint32_t
>(direction), x, y, z, alpha);
203 void DrawTriStrip(ggxxacpr::ColorVertex* vertices, uint32_t numVertices) {
204 _ref->DrawTriStrip(vertices, numVertices);
222 void DrawQuad(int32_t left, int32_t top, int32_t right, int32_t bottom, int32_t z, uint32_t color) {
223 _ref->DrawQuad(left, top, right, bottom, z, color);
243 _ref->RegisterSprites(spriteId, textureDataArray, count);
251 return _ref->GetActiveCommandGrabId(player.
getRaw());
265 return _ref->GetPushboxDimensionArray(
static_cast<int32_t
>(type));
277 return _ref->GetPushboxAirborneOffsetArray(
static_cast<int32_t
>(gameVer));
287 return _ref->GetThrowRangeArray(
static_cast<int32_t
>(type));
295 return _ref->GetCommandGrabRangeArray();
299class GameDataApi :
public ApiWrapper<BaseMod_GameDataApi> {
324 return _ref->GetPlayer(playerIndex);
338 return _ref->GetCamera();
348 ggxxacpr::JobMode
GetJobMode() {
return static_cast<ggxxacpr::JobMode
>(_ref->GetJobMode()); }
352 ggxxacpr::GameModeFeatureFlags
GetGameModeFeatureFlags() {
return static_cast<ggxxacpr::GameModeFeatureFlags
>(_ref->GetGameModeFeatureFlags()); }
359 ggxxacpr::MenuItem
GetMainMenuSelection() {
return static_cast<ggxxacpr::MenuItem
>(_ref->GetMainMenuSelection()); }
372 ggxxacpr::GameVersion
GetGameVersion() {
return static_cast<ggxxacpr::GameVersion
>(_ref->GetGameVersion()); }
411using PeekMessageHook = void (BASEMOD_CALL *)(T* userData,
const HookContext* ctx,
const PeekMessageInfo* info);
413using GameUpdateHook = void(BASEMOD_CALL *)(T* userData,
const HookContext* ctx,
const GameUpdateInfo* info);
415using DrawHook = void(BASEMOD_CALL *)(T* userData,
const HookContext* ctx,
const DrawInfo* info);
417using SaveGameHook = void(BASEMOD_CALL *)(T* userData,
const HookContext* ctx,
const SaveGameInfo* info);
419class HookApi :
public ApiWrapper<BaseMod_HookApi> {
428 return _ref->RemoveHook(
id);
445 return _ref->AfterPeekMessage(hookFn, userData);
464 return _ref->AfterPeekMessage(
465 reinterpret_cast<BaseMod_PeekMessageHook
>(hookFn),
479 return _ref->BeforeGameUpdate(hookFn, userData);
494 return _ref->BeforeGameUpdate(
495 reinterpret_cast<BaseMod_GameUpdateHook
>(hookFn),
510 return _ref->AfterGameUpdate(hookFn, userData);
526 return _ref->AfterGameUpdate(
527 reinterpret_cast<BaseMod_GameUpdateHook
>(hookFn),
541 return _ref->BeforeEndScene(hookFn, userData);
556 return _ref->BeforeEndScene(
557 reinterpret_cast<BaseMod_DrawHook
>(hookFn),
572 return _ref->BeforePresent(hookFn, userData);
588 return _ref->BeforePresent(
589 reinterpret_cast<BaseMod_DrawHook
>(hookFn),
604 return _ref->AfterSaveGame(hookFn, userData);
619 return _ref->AfterSaveGame(
620 reinterpret_cast<BaseMod_SaveGameHook
>(hookFn),
626using MenuAction = BM_MenuAction;
627using ValueChangeCallback = BM_ValueChangeCallback;
628using CustomMenuHandler = BM_CustomMenuHandler;
645 return _ref->SelectionHandler(currentSelection, totalEntries);
656 return _ref->HoldDirectionInputHandler(
static_cast<uint32_t
>(input));
670 _ref->DrawEnumSettingUI(label, xOffset, y, isSelected);
684 _ref->DrawGaugeSettingUI(currentValue, y, isSelected, maxValue);
694 _ref->DrawScrollArrow(
static_cast<int32_t
>(flags));
703 _ref->SwitchToMainFiber();
707class ModMenuApi :
public ApiWrapper<BaseMod_ModMenuApi> {
711 HelperFunctions() { }
724 auto dim = _ref->GetDrawableAreaDimensions();
725 return {dim->left, dim->top, dim->right, dim->bottom};
735 uint32_t
RegisterMenuTab(
const char* title,
const ModMenuEntry* entries, uint32_t numEntries) {
736 return _ref->RegisterMenuTab(title, entries, numEntries);
749 return _ref->RegisterCustomMenuTab(title, handler);
753class Api :
public ApiWrapper<BaseMod_Api> {
ModMenuApi ModMenu
Add options to mod menu.
Definition baseMod.hpp:775
HookApi Hooks
Function hooking manager.
Definition baseMod.hpp:773
NativeFunctionsApi NativeFunctions
API for invoking native game functions.
Definition baseMod.hpp:769
GameDataApi GameData
Access to notable game data.
Definition baseMod.hpp:771
Definition baseMod.hpp:255
int16_t * GetThrowRangeArray(ThrowRangeArrayType type)
Returns a pointer to the throw range array specified by the type parameter.
Definition baseMod.hpp:286
int16_t * GetPushboxAirborneOffsetArray(ggxxacpr::GameVersion gameVer)
Returns a pointer to the game's airborne pushbox offset array.
Definition baseMod.hpp:276
uint16_t * GetCommandGrabRangeArray()
Returns a pointer to the command throw range array.
Definition baseMod.hpp:294
uint16_t * GetPushboxDimensionArray(PushboxDimensionArrayType type)
Returns a pointer to the push box array specified by the type parameter.
Definition baseMod.hpp:264
Definition baseMod.hpp:299
int32_t GetPauseDisplayState()
Returns the pause display state.
Definition baseMod.hpp:403
ggxxacpr::Entity GetRootEntity()
Returns a pointer to the root entity.
Definition baseMod.hpp:387
uint32_t GetViewWidth()
Returns the current view width.
Definition baseMod.hpp:376
uint32_t GetGlobalThrowFlags()
Gets raw throw detection info.
Definition baseMod.hpp:391
ggxxacpr::LocaleState * GetLocaleState()
Gets a pointer to the game's locale state. see GGXXACPR_LocaleState.
Definition baseMod.hpp:407
int32_t GetPauseState()
Returns the pause state.
Definition baseMod.hpp:397
ggxxacpr::JobMode GetJobMode()
Returns the current job mode, see enum GGXXACPR_JobMode. This variable determines what scene the game...
Definition baseMod.hpp:348
ggxxacpr::MenuItem GetMainMenuSelection()
Returns the item selected from the main menu.
Definition baseMod.hpp:359
void * GetD3D9Device()
Returns the D3D9 device pointer.
Definition baseMod.hpp:366
ggxxacpr::GameVersion GetGameVersion()
Gets the current game version.
Definition baseMod.hpp:372
uint32_t GetViewHeight()
Returns the current view height.
Definition baseMod.hpp:380
ggxxacpr::GameModeFeatureFlags GetGameModeFeatureFlags()
Returns the current game mode feature flags.
Definition baseMod.hpp:352
ggxxacpr::PlayerInput * GetPlayerInputStructArr()
Gets a pointer to the player input struct array. See GGXXACPR_PlayerInput.
Definition baseMod.hpp:333
ggxxacpr::Camera GetCamera()
Gets camera data.
Definition baseMod.hpp:337
CharDataApi CharacterData
API for accessing static character data.
Definition baseMod.hpp:311
bool IsInGame()
returns a non-zero value if the game is on the battle screen.
Definition baseMod.hpp:343
ggxxacpr::Player GetPlayer(int playerIndex)
Gets player data.
Definition baseMod.hpp:323
Definition baseMod.hpp:419
HookId AfterPeekMessage(PeekMessageHook< T > hookFn, T *userData)
Registers a hook to the PeekMessage hook.
Definition baseMod.hpp:463
HookId AfterGameUpdate(GameUpdateHook< T > hookFn, T *userData)
Registers a hook to run after the game state updates.
Definition baseMod.hpp:525
HookId BeforePresent(DrawHook< T > hookFn, T *userData)
Registers a hook to run before the call to IDirect3DDevice9::Present.
Definition baseMod.hpp:587
HookId AfterPeekMessage(BaseMod_PeekMessageHook hookFn, void *userData)
Registers a hook to the PeekMessage hook.
Definition baseMod.hpp:444
HookId AfterGameUpdate(BaseMod_GameUpdateHook hookFn, void *userData)
Registers a hook to run after the game state updates.
Definition baseMod.hpp:509
HookId BeforePresent(BaseMod_DrawHook hookFn, void *userData)
Registers a hook to run before the call to IDirect3DDevice9::Present.
Definition baseMod.hpp:571
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 select...
Definition baseMod.hpp:603
HookId BeforeGameUpdate(GameUpdateHook< T > hookFn, T *userData)
Registers a hook to run before the game state updates.
Definition baseMod.hpp:493
HookId BeforeEndScene(BaseMod_DrawHook hookFn, void *userData)
Registers a hook to run before the call to IDirect3DDevice9::EndScene.
Definition baseMod.hpp:540
uint32_t RemoveHook(HookId id)
Removes a hook from the registry.
Definition baseMod.hpp:427
HookId BeforeGameUpdate(BaseMod_GameUpdateHook hookFn, void *userData)
Registers a hook to run before the game state updates.
Definition baseMod.hpp:478
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 select...
Definition baseMod.hpp:618
HookId BeforeEndScene(DrawHook< T > hookFn, T *userData)
Registers a hook to run before the call to IDirect3DDevice9::EndScene.
Definition baseMod.hpp:555
Definition baseMod.hpp:74
void 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.hpp:242
void RenderMenuText(const char *text, int32_t x, int32_t y, float z, float alpha, int32_t *animCounter, int32_t animSpeed, bool ignoreSpriteMask, uint32_t color)
Draws text to the screen such as the text seen in pause menus.
Definition baseMod.hpp:119
void DrawSprite(GGXXACPR_DrawSpriteParams *params, bool ignoreSpriteMask)
Draws a sprite to the screen.
Definition baseMod.hpp:177
void DrawTriStrip(ggxxacpr::ColorVertex *vertices, uint32_t numVertices)
Draws a triangle strip primitive.
Definition baseMod.hpp:203
void RenderCockpitFontText(std::string text, int32_t x, int32_t y, float z, uint8_t alpha, float size)
Draws text to the screen during battle using the game's text glyph system.
Definition baseMod.hpp:96
void DrawArrowSprite(DrawArrowSpriteDirection direction, int32_t x, int32_t y, int32_t z, uint32_t alpha)
DrawSprite wrapper function that draws an arrow sprite.
Definition baseMod.hpp:190
bool PlayCommonSoundEffect(uint32_t id)
Plays a sound effect.
Definition baseMod.hpp:164
void DrawQuad(int32_t left, int32_t top, int32_t right, int32_t bottom, int32_t z, uint32_t color)
Draws a quad to the screen.
Definition baseMod.hpp:222
uint32_t GetActiveCommandGrabId(ggxxacpr::Player player)
If the given player currently has an active command grab, returns its command grab id,...
Definition baseMod.hpp:250
void RenderMenuTextCenterAligned(const char *text, int32_t x, int32_t y, float z, float alpha, uint32_t color, bool ignoreSpriteMask)
Draws centered aligned text to the screen.
Definition baseMod.hpp:139
void RenderPopUpText(int32_t playerIndex, std::string text)
A higher level text rendering function that triggers a text popup animation in-game (e....
Definition baseMod.hpp:150
Definition ggxxacpr.hpp:605
Wraps a GGXXACPR_Entity struct pointer and provides conversions and generic entity-oriented interpret...
Definition ggxxacpr.hpp:843
Wraps a GGXXACPR_Entity struct pointer and provides conversions and interpretations of its data.
Definition ggxxacpr.hpp:667
GGXXACPR_Entity * getRaw()
Returns the underlying GGXXACPR_Entity struct pointer.
Definition ggxxacpr.hpp:681
Root struct for the base mod API.
Definition baseMod_c.h:698
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
const struct BaseMod_HookApi * Hooks
Function hooking manager.
Definition baseMod_c.h:715
Definition baseMod_c.h:266
const struct BaseMod_CharDataApi * CharacterData
API for accessing static character data.
Definition baseMod_c.h:275
Definition ggxxacpr_c.h:1245