A helper class for creating a basic setting with a simple value. Override the virtual function isValid
to
Class SettingBaseValueV3<T, V>
#include <Geode/loader/SettingV3.hpp>
T
V
Examples0
Public static methods0
Public member functions8
TgetDefaultValue()const
Get the default value for this setting
TgetValue()const
Get the current value of this setting
voidsetValue(Vvalue)
Set the value of this setting. This will broadcast a new SettingChangedEventV3, letting any listeners now the value has changed
value
virtualgeode::Result<>isValid(Vvalue)const
Check if a given value is valid for this setting. If not, an error describing why the value isn’t valid is returned
virtualboolisDefaultValue()const
virtualvoidreset()
virtualboolload()
virtualboolsave(matjson::Value&json)const
Fields0
Protected member functions4
voidparseDefaultValue()
Parses the "default"
key from the setting’s definition in mod.json
. The key may also be defined per-platform, i.e. "default": { "win": ..., "android": ... }
json
⚠️ 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(,std::stringconst&modID,)
Parse shared value, including the default value for this setting
key
modID
json
geode::Result<>parseBaseProperties(,std::stringconst&modID,)
Parse shared value, including the default value for this setting
key
modID
json