Class SettingV3

#include <Geode/loader/SettingV3.hpp>
No description provided
Examples0
Public static methods0
Public member functions16
std::stringgetKey()const

Get the key of this setting

std::stringgetModID()const

Get the mod ID this setting is for

geode::Mod*getMod()const

Get the mod this setting is for. Note that this may return null while the mod is still being initialized

std::optional<std::string>getName()const

Get the name of this setting

std::stringgetDisplayName()const

Get the name of this setting, or its key if it has no name

std::optional<std::string>getDescription()const

Get the description of this setting

std::optional<std::string>getEnableIf()const

Get the “enable-if” scheme for this setting

boolshouldEnable()const

Check if this setting should be enabled based on the “enable-if” scheme

std::optional<std::string>getEnableIfDescription()const
No description provided
boolrequiresRestart()const

Whether this setting requires a restart on change

std::vector<geode::PlatformID>getPlatforms()const

Get the platforms this setting is available on

virtualboolload()=0
No description provided
virtualboolsave()const=0
No description provided
virtualgeode::SettingNodeV3*createNode(
floatwidth
)
=0
No description provided
virtualboolisDefaultValue()const=0
No description provided
virtualvoidreset()=0

Reset this setting’s value back to its original value

Fields0
Protected member functions8
voidinit(,,)

Only call this function if you aren’t going to call parseBaseProperties, which will call it for you! If you don’t want to call parseBaseProperties, at the very least you must call this! Select which properties you want to parse using the parseX functions

Parameters

key

The setting's key as defined in `mod.json`

modID

The ID of the mod this settings is being parsed for

json

The current JSON checking instance being used. This should be the JSON object that defines the setting. If you aren't using Geode's JSON checking utilities, you can use the other overload of `init`
voidinit(,)

Only call this function if you aren’t going to call parseBaseProperties, which will call it for you! If you don’t want to call parseBaseProperties, at the very least you must call this! Select which properties you want to parse using the parseX functions

Parameters

key

The setting's key as defined in `mod.json`

modID

The ID of the mod this settings is being parsed for

ℹ If you are using Geode's JSON checking utilities (`checkJson` / `JsonExpectedValue`), you should be using the other overload that takes a `JsonExpectedValue&`!

voidparseNameAndDescription()

Parses the "name" and "description" keys from the setting’s definition in mod.json (if they exist), so their values can be accessed via getName and getDescription.

Parameters

json

The current JSON checking instance being used. This should be the JSON object that defines the setting

⚠️ In most cases, you should be using `parseBaseProperties` instead to do all of this in one go! If you do need the fine-grained control however, make sure to call `init` before calling these parsing functions!

voidparseEnableIf()

Parses the "enable-if" and "enable-if-description" keys from the setting’s definition in mod.json (if they exist), so shouldEnable and getEnableIfDescription work.

Parameters

json

The current JSON checking instance being used. This should be the JSON object that defines the setting

⚠️ In most cases, you should be using `parseBaseProperties` instead to do all of this in one go! If you do need the fine-grained control however, make sure to call `init` before calling these parsing functions!

voidparseValueProperties()

Parses the "requires-restart" key from the setting’s definition in mod.json (if they exist), so requiresRestart works.

Parameters

json

The current JSON checking instance being used. This should be the JSON object that defines the setting

⚠️ In most cases, you should be using `parseBaseProperties` instead to do all of this in one go! If you do need the fine-grained control however, make sure to call `init` before calling these parsing functions!

voidparseBaseProperties(,,)

Parse all of the base properties such as "name" and "description" for this setting

Parameters

key

The setting's key as defined in `mod.json`

modID

The ID of the mod this settings is being parsed for

json

The current JSON checking instance being used. If you aren't using Geode's JSON checking utilities, use the other overload of this function

ℹ If you don't want to parse some of the base properties, such as `"requires-restart"` (because you're doing a cosmetic setting), then you can call `init` instead and then the specific `parseX` functions

geode::Result<>parseBaseProperties(,,)

Parse all of the base properties such as "name" and "description" for this setting

Parameters

key

The setting's key as defined in `mod.json`

modID

The ID of the mod this settings is being parsed for

json

The JSON value. If you are using Geode's JSON checking utilities (`checkJson` / `JsonExpectedValue`), you should use the other overload directly!

ℹ If you don't want to parse some of the base properties, such as `"requires-restart"` (because you're doing a cosmetic setting), then you can call `init` instead and then the specific `parseX` functions

voidmarkChanged()

Mark that the value of this setting has changed. This should be ALWAYS called on every setter that can modify the setting’s state!

Protected fields0