diff options
author | Linnea Gräf <nea@nea.moe> | 2024-11-17 17:45:29 +0100 |
---|---|---|
committer | Linnea Gräf <nea@nea.moe> | 2024-11-17 17:45:29 +0100 |
commit | e00c21b2ade870c94b2641d24bf75ca15f81b044 (patch) | |
tree | cdf8e5564027891ad62b299aaf1b71628af75b9d /src/main | |
parent | 7c4205a07cd720af7660672c129607d2dcf1b1e7 (diff) | |
download | Firmament-e00c21b2ade870c94b2641d24bf75ca15f81b044.tar.gz Firmament-e00c21b2ade870c94b2641d24bf75ca15f81b044.tar.bz2 Firmament-e00c21b2ade870c94b2641d24bf75ca15f81b044.zip |
fix: MoulConfig options sometimes not saving
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/kotlin/gui/config/KeyBindingHandler.kt | 6 |
1 files changed, 4 insertions, 2 deletions
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() } ) |