From dd974fcb79014452e6109dbeb008d5413819b73d Mon Sep 17 00:00:00 2001 From: nea Date: Sat, 9 Sep 2023 03:41:11 +0200 Subject: Fix key bindings not being updated until gui switch [no changelog] --- src/main/kotlin/moe/nea/firmament/gui/config/KeyBindingHandler.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/moe/nea/firmament/gui/config/KeyBindingHandler.kt b/src/main/kotlin/moe/nea/firmament/gui/config/KeyBindingHandler.kt index 42cf66c..a9d5a2e 100644 --- a/src/main/kotlin/moe/nea/firmament/gui/config/KeyBindingHandler.kt +++ b/src/main/kotlin/moe/nea/firmament/gui/config/KeyBindingHandler.kt @@ -19,7 +19,7 @@ import net.minecraft.util.Formatting import moe.nea.firmament.keybindings.FirmamentKeyBindings import moe.nea.firmament.keybindings.SavedKeyBinding -class KeyBindingHandler(name: String, managedConfig: ManagedConfig) : ManagedConfig.OptionHandler { +class KeyBindingHandler(name: String, val managedConfig: ManagedConfig) : ManagedConfig.OptionHandler { init { FirmamentKeyBindings.registerKeyBinding(name, managedConfig) } @@ -106,6 +106,7 @@ class KeyBindingHandler(name: String, managedConfig: ManagedConfig) : ManagedCon if (editing) stroke.styled { it.withColor(Formatting.YELLOW) } button.setLabel(stroke) + managedConfig.save() } updateButton = ::updateLabel updateButton() -- cgit