From 7ef0fa07dd70a9c7be7ece84cb5e67e0ebac3ba5 Mon Sep 17 00:00:00 2001 From: A-Games <62186163+iwantpizza10@users.noreply.github.com> Date: Wed, 31 Jul 2024 17:30:29 -0400 Subject: [PATCH] Update settings.md to add Geode/loader/SettingEvent.hpp includes --- mods/settings.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mods/settings.md b/mods/settings.md index be337b4..8a02d4f 100644 --- a/mods/settings.md +++ b/mods/settings.md @@ -49,6 +49,8 @@ auto value = Mod::get()->getSettingValue("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 + $execute { listenForSettingChanges("my-float-setting", +[](double value) { // do something with the value