diff options
author | Linnea Gräf <nea@nea.moe> | 2024-11-12 17:02:08 +0100 |
---|---|---|
committer | Linnea Gräf <nea@nea.moe> | 2024-11-12 17:02:08 +0100 |
commit | b774daef5bd961f955d365ce07bd5aa4acb161f4 (patch) | |
tree | 8e5f8f92593f8c594cc25592901342cc8923cee9 /src/main/kotlin/gui/config/KeyBindingHandler.kt | |
parent | 9763a4caa44fb6629aae92f3ad696487d962b0d9 (diff) | |
download | Firmament-b774daef5bd961f955d365ce07bd5aa4acb161f4.tar.gz Firmament-b774daef5bd961f955d365ce07bd5aa4acb161f4.tar.bz2 Firmament-b774daef5bd961f955d365ce07bd5aa4acb161f4.zip |
feat: MoulConfig config gui
Diffstat (limited to 'src/main/kotlin/gui/config/KeyBindingHandler.kt')
-rw-r--r-- | src/main/kotlin/gui/config/KeyBindingHandler.kt | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/main/kotlin/gui/config/KeyBindingHandler.kt b/src/main/kotlin/gui/config/KeyBindingHandler.kt index 7ec7e81..0cf0c46 100644 --- a/src/main/kotlin/gui/config/KeyBindingHandler.kt +++ b/src/main/kotlin/gui/config/KeyBindingHandler.kt @@ -30,7 +30,7 @@ class KeyBindingHandler(val name: String, val managedConfig: ManagedConfig) : return Json.decodeFromJsonElement(element) } - override fun emitGuiElements(opt: ManagedOption<SavedKeyBinding>, guiAppender: GuiAppender) { + fun createButtonComponent(opt: ManagedOption<SavedKeyBinding>): FirmButtonComponent { lateinit var button: FirmButtonComponent val sm = KeyBindingStateManager( { opt.value }, @@ -67,7 +67,11 @@ class KeyBindingHandler(val name: String, val managedConfig: ManagedConfig) : } } sm.updateLabel() - guiAppender.appendLabeledRow(opt.labelText, button) + return button + } + + override fun emitGuiElements(opt: ManagedOption<SavedKeyBinding>, guiAppender: GuiAppender) { + guiAppender.appendLabeledRow(opt.labelText, createButtonComponent(opt)) } } |