Skip to content

Commit

Permalink
Merge pull request #47 from iwantpizza10/patch-1
Browse files Browse the repository at this point in the history
Update settings.md to add Geode/loader/SettingEvent.hpp includes
  • Loading branch information
qimiko authored Aug 17, 2024
2 parents 93566ac + 7ef0fa0 commit aaacf65
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mods/settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ auto value = Mod::get()->getSettingValue<int64_t>("my-int-setting");
You can detect whenever the value of a setting is changed by using the [listenForSettingChanges] function. In most situations, you should call this function in an `$execute` block, so it gets enabled immediately when your mod is loaded. **The function will not be called on startup**, only when the value is changed afterwards. Note that the type you get the value as must match the value type of the setting type - see [Supported setting types](#supported-setting-types) for more info.

```cpp
#include <Geode/loader/SettingEvent.hpp>

$execute {
listenForSettingChanges("my-float-setting", +[](double value) {
// do something with the value
Expand Down

0 comments on commit aaacf65

Please sign in to comment.