aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/gui/config/KeyBindingHandler.kt
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2024-11-17 17:45:29 +0100
committerLinnea Gräf <nea@nea.moe>2024-11-17 17:45:29 +0100
commite00c21b2ade870c94b2641d24bf75ca15f81b044 (patch)
treecdf8e5564027891ad62b299aaf1b71628af75b9d /src/main/kotlin/gui/config/KeyBindingHandler.kt
parent7c4205a07cd720af7660672c129607d2dcf1b1e7 (diff)
downloadFirmament-e00c21b2ade870c94b2641d24bf75ca15f81b044.tar.gz
Firmament-e00c21b2ade870c94b2641d24bf75ca15f81b044.tar.bz2
Firmament-e00c21b2ade870c94b2641d24bf75ca15f81b044.zip
fix: MoulConfig options sometimes not saving
Diffstat (limited to 'src/main/kotlin/gui/config/KeyBindingHandler.kt')
-rw-r--r--src/main/kotlin/gui/config/KeyBindingHandler.kt6
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() }
)