Fix key bindings not being updated until gui switch

[no changelog]
This commit is contained in:
nea
2023-09-09 03:41:11 +02:00
parent 255e4f5899
commit dd974fcb79

View File

@@ -19,7 +19,7 @@ import net.minecraft.util.Formatting
import moe.nea.firmament.keybindings.FirmamentKeyBindings import moe.nea.firmament.keybindings.FirmamentKeyBindings
import moe.nea.firmament.keybindings.SavedKeyBinding 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 { init {
FirmamentKeyBindings.registerKeyBinding(name, managedConfig) FirmamentKeyBindings.registerKeyBinding(name, managedConfig)
} }
@@ -106,6 +106,7 @@ class KeyBindingHandler(name: String, managedConfig: ManagedConfig) : ManagedCon
if (editing) if (editing)
stroke.styled { it.withColor(Formatting.YELLOW) } stroke.styled { it.withColor(Formatting.YELLOW) }
button.setLabel(stroke) button.setLabel(stroke)
managedConfig.save()
} }
updateButton = ::updateLabel updateButton = ::updateLabel
updateButton() updateButton()