From e00c21b2ade870c94b2641d24bf75ca15f81b044 Mon Sep 17 00:00:00 2001 From: Linnea Gräf Date: Sun, 17 Nov 2024 17:45:29 +0100 Subject: fix: MoulConfig options sometimes not saving --- src/main/kotlin/gui/config/KeyBindingHandler.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/main') diff --git a/src/main/kotlin/gui/config/KeyBindingHandler.kt b/src/main/kotlin/gui/config/KeyBindingHandler.kt index 0cf0c46..d7d0b47 100644 --- a/src/main/kotlin/gui/config/KeyBindingHandler.kt +++ b/src/main/kotlin/gui/config/KeyBindingHandler.kt @@ -6,7 +6,6 @@ import io.github.notenoughupdates.moulconfig.deps.libninepatch.NinePatch import io.github.notenoughupdates.moulconfig.gui.GuiImmediateContext import io.github.notenoughupdates.moulconfig.gui.KeyboardEvent import io.github.notenoughupdates.moulconfig.gui.component.TextComponent -import org.lwjgl.glfw.GLFW import kotlinx.serialization.json.Json import kotlinx.serialization.json.JsonElement import kotlinx.serialization.json.decodeFromJsonElement @@ -34,7 +33,10 @@ class KeyBindingHandler(val name: String, val managedConfig: ManagedConfig) : lateinit var button: FirmButtonComponent val sm = KeyBindingStateManager( { opt.value }, - { opt.value = it }, + { + opt.value = it + opt.element.save() + }, { button.blur() }, { button.requestFocus() } ) -- cgit