summaryrefslogtreecommitdiff
path: root/src/gui/gui.cpp
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <bjorn@lindeijer.nl>2025-01-21 09:25:46 +0100
committerThorbjørn Lindeijer <bjorn@lindeijer.nl>2025-01-21 09:29:23 +0100
commite224a015dbb69db35a9403f40ede7fc397d549fc (patch)
tree97bb25d8302ef3cc60077383abd3076753f34b71 /src/gui/gui.cpp
parentdb9b9f316d7bdcb9504092908bb18e82fc21de2f (diff)
downloadmana-e224a015dbb69db35a9403f40ede7fc397d549fc.tar.gz
mana-e224a015dbb69db35a9403f40ede7fc397d549fc.tar.bz2
mana-e224a015dbb69db35a9403f40ede7fc397d549fc.tar.xz
mana-e224a015dbb69db35a9403f40ede7fc397d549fc.zip
Fixed ConfigOptionChanged events
With the statically typed config we no longer get an event for each changed config value. Where relevant, this is now done through `setConfigValue`. The `Event` now uses a `std::any`, which for `ConfigOptionChanged` events is set to the changed `Config` member. This allows for a type-safe check on which config value was changed.
Diffstat (limited to 'src/gui/gui.cpp')
-rw-r--r--src/gui/gui.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp
index 39314fcf..a59242dc 100644
--- a/src/gui/gui.cpp
+++ b/src/gui/gui.cpp
@@ -177,7 +177,7 @@ void Gui::event(Event::Channel channel, const Event &event)
if (channel == Event::ConfigChannel)
{
if (event.getType() == Event::ConfigOptionChanged &&
- event.getString("option") == "customcursor")
+ event.hasValue(&Config::customCursor))
{
setUseCustomCursor(config.customCursor);
}