Class Mod

#include <Geode/loader/Mod.hpp>
classMod{ ... }

Represents a Mod ingame.

Examples0
Public static methods0
Public member functions60
geode::Modoperator=()
No description provided
std::stringgetID()const
No description provided
std::stringgetName()const
No description provided
std::stringgetDeveloper()const
No description provided
intgetDevelopers()const
No description provided
std::optional<std::string>getDescription()const
No description provided
std::optional<std::string>getDetails()const
No description provided
ghc::filesystem::pathgetPackagePath()const
No description provided
geode::VersionInfogetVersion()const
No description provided
boolisEnabled()const
No description provided
boolisInternal()const
No description provided
boolneedsEarlyLoad()const
No description provided
geode::ModMetadatagetMetadata()const
No description provided
ghc::filesystem::pathgetTempDir()const
No description provided
ghc::filesystem::pathgetBinaryPath()const

Get the path to the mod’s platform binary (.dll on Windows, .dylib on Mac & iOS, .so on Android)

ghc::filesystem::pathgetResourcesDir()const

Get the path to the mod’s runtime resources directory (contains all of its resources)

voidsetMetadata()
No description provided
intgetDependants()const
No description provided
std::optional<geode::VersionInfo>hasAvailableUpdate()const

Check if this Mod has updates available on the mods index. If you’re using this for automatic update checking, use [openInfoPopup](/functions/geode/openInfoPopup) or [openIndexPopup](/functions/geode/openIndexPopup) from the ui/GeodeUI.hpp header to open the Mod’s page to let the user install the update

Return value
The latest available version on the index if there are updates for this mod
intsaveData()
No description provided
intloadData()
No description provided
ghc::filesystem::pathgetSaveDir()const

Get the mod’s save directory path

ghc::filesystem::pathgetConfigDir(
boolcreate
)
const

Get the mod’s config directory path

boolhasSettings()const
No description provided
intgetSettingKeys()const
No description provided
boolhasSetting()const
No description provided
std::optional<geode::Setting>getSettingDefinition()const
No description provided
geode::SettingValue*getSetting()const
No description provided
voidregisterCustomSetting(,
intvalue
)

Register a custom setting’s value class. See Mod::addCustomSetting for a convenience wrapper that creates the value in-place to avoid code duplication. Also see the tutorial page for more information about custom settings

Parameters

key

The setting's key

value

The SettingValue class that shall handle this setting
std::stringgetLaunchArgumentName()const

Returns a prefixed launch argument name. See [Mod](/classes/geode/Mod)::getLaunchArgument for details about mod-specific launch arguments.

intgetLaunchArgumentNames()const

Returns the names of the available mod-specific launch arguments.

boolhasLaunchArgument()const

Equivalent to a prefixed [Loader](/classes/geode/Loader)::hasLaunchArgument call. See [Mod](/classes/geode/Mod)::getLaunchArgument for details about mod-specific launch arguments.

Parameters

name

The argument name
std::optional<std::string>getLaunchArgument()const

Get a mod-specific launch argument. This is equivalent to [Loader](/classes/geode/Loader)::getLaunchArgument with the argument name prefixed by the mod ID. For example, a launch argument named mod-arg for the mod author.test would be specified with --geode:author.test.mod-arg=value.

Parameters

name

The argument name
Return value
The value, if present
boolgetLaunchFlag()const

Equivalent to a prefixed [Loader](/classes/geode/Loader)::getLaunchFlag call. See [Mod](/classes/geode/Mod)::getLaunchArgument for details about mod-specific launch arguments.

Parameters

name

The argument name
matjson::Value&getSaveContainer()
No description provided
matjson::Value&getSavedSettingsData()
No description provided
boolhasSavedValue()
No description provided
inthook(
void*address
,
void*detour
,,,)
No description provided
intclaimHook(
inthook
)

Claims an existing hook object, marking this mod as its owner. If the hook has “auto enable” set, this will enable the hook.

Return value
Returns a pointer to the hook, or an error if the hook already has an owner, or was unable to enable the hook.
intdisownHook(
int*hook
)

Disowns a hook which this mod owns, making this mod no longer its owner. If the hook has “auto enable” set, this will disable the hook.

Return value
Returns an error if this mod doesn't own the hook, or if disabling the hook failed.
intgetHooks()const

Get all hooks owned by this Mod

Return value
Vector of hooks
intpatch(
void*address
,)

Write a patch at an address

Parameters

address

The address to write into

data

The data to write there
Return value
Successful result on success, errorful result with info on error
intclaimPatch(
intpatch
)

Claims an existing patch object, marking this mod as its owner. If the patch has “auto enable” set, this will enable the patch.

Return value
Returns a pointer to the patch, or an error if the patch already has an owner, or was unable to enable the patch.
intdisownPatch(
int*patch
)

Disowns a patch which this mod owns, making this mod no longer its owner. If the patch has “auto enable” set, this will disable the patch.

Return value
Returns an error if this mod doesn't own the patch, or if disabling the patch failed.
intgetPatches()const

Get all patches owned by this Mod

Return value
Vector of patches
intenable()

Enable this mod

Return value
Successful result on success, errorful result with info on error
intdisable()

Disable this mod

Return value
Successful result on success, errorful result with info on error
intuninstall(
booldeleteSaveData
)

Delete the mod’s .geode package.

Parameters

deleteSaveData

Whether should also delete the mod's save data
Return value
Successful result on success, errorful result with info on error
boolisUninstalled()const
No description provided
geode::ModRequestedActiongetRequestedAction()const
No description provided
booldepends()const

Check whether or not this Mod depends on another mod

boolhasUnresolvedDependencies()const

Check whether all the required dependencies for this mod have been loaded or not

Return value
True if the mod has unresolved dependencies, false if not.
boolhasUnresolvedIncompatibilities()const

Check whether none of the incompatibilities with this mod are loaded

Return value
True if the mod has unresolved incompatibilities, false if not.
charconst*expandSpriteName()
No description provided
intgetRuntimeInfo()const

Get info about the mod as JSON

ℹ For IPC

boolisLoggingEnabled()const
No description provided
voidsetLoggingEnabled(
boolenabled
)
No description provided
boolhasProblems()const
No description provided
boolshouldLoad()const
No description provided
boolisCurrentlyLoading()const
No description provided
Fields0
Protected member functions0
Protected fields1
intm_impl
;
No description provided