aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/moe/nea/firmament/gui
diff options
context:
space:
mode:
authornea <nea@nea.moe>2023-09-09 03:41:11 +0200
committernea <nea@nea.moe>2023-09-09 03:41:11 +0200
commitdd974fcb79014452e6109dbeb008d5413819b73d (patch)
tree0fbe37beffa6bcee4cbf71fe7ad4db4840aced1b /src/main/kotlin/moe/nea/firmament/gui
parent255e4f5899642e099e7ec7b1a7fe1e0c32ebbc20 (diff)
downloadfirmament-dd974fcb79014452e6109dbeb008d5413819b73d.tar.gz
firmament-dd974fcb79014452e6109dbeb008d5413819b73d.tar.bz2
firmament-dd974fcb79014452e6109dbeb008d5413819b73d.zip
Fix key bindings not being updated until gui switch
[no changelog]
Diffstat (limited to 'src/main/kotlin/moe/nea/firmament/gui')
-rw-r--r--src/main/kotlin/moe/nea/firmament/gui/config/KeyBindingHandler.kt3
1 files changed, 2 insertions, 1 deletions
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<SavedKeyBinding> {
+class KeyBindingHandler(name: String, val managedConfig: ManagedConfig) : ManagedConfig.OptionHandler<SavedKeyBinding> {
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()