Class Mod

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

Represents a Mod ingame.

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

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

std::filesystem::pathgetResourcesDir()const

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

voidsetMetadata()
No description provided
std::vector<geode::Mod*>getDependants()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
geode::Result<>saveData()
No description provided
geode::Result<>loadData()
No description provided
std::filesystem::pathgetSaveDir()const

Get the mod’s save directory path

std::filesystem::pathgetConfigDir(
boolcreate
)
const

Get the mod’s config directory path

boolhasSettings()const
No description provided
std::vector<std::string>getSettingKeys()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(,)

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.

std::vector<std::string>getLaunchArgumentNames()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
geode::Result<geode::Hook*>hook(
void*address
,
void*detour
,,,)
No description provided
geode::Result<geode::Hook*>claimHook()

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.
geode::Result<>disownHook()

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.
std::vector<geode::Hook*>getHooks()const

Get all hooks owned by this Mod

Return value
Vector of hooks
geode::Result<geode::Patch*>patch(
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
geode::Result<geode::Patch*>claimPatch()

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.
geode::Result<>disownPatch()

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.
std::vector<geode::Patch*>getPatches()const

Get all patches owned by this Mod

Return value
Vector of patches
geode::Result<>enable()

Enable this mod

Return value
Successful result on success, errorful result with info on error
geode::Result<>disable()

Disable this mod

Return value
Successful result on success, errorful result with info on error
geode::Result<>uninstall(
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.
std::string_viewexpandSpriteName()
No description provided
geode::ModJsongetRuntimeInfo()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
std::vector<geode::LoadProblem>getAllProblems()const
No description provided
std::vector<geode::LoadProblem>getProblems()const
No description provided
std::vector<geode::LoadProblem>getRecommendations()const
No description provided
boolshouldLoad()const
No description provided
boolisCurrentlyLoading()const
No description provided
Fields0
Protected member functions0
Protected fields1
;
No description provided