diff options
| author | Linnea Gräf <nea@nea.moe> | 2025-11-17 21:23:50 +0100 |
|---|---|---|
| committer | Linnea Gräf <nea@nea.moe> | 2025-11-17 21:23:50 +0100 |
| commit | c7669dc363716c63f987c29809997b2787349370 (patch) | |
| tree | 1430d2280d1faad6edf51f787554b14778faca76 /src/main/kotlin | |
| parent | dfe288cea0e5937eae218d1bc392066f18bf562f (diff) | |
| download | Firmament-c7669dc363716c63f987c29809997b2787349370.tar.gz Firmament-c7669dc363716c63f987c29809997b2787349370.tar.bz2 Firmament-c7669dc363716c63f987c29809997b2787349370.zip | |
fix: vanilly keybinding categories4.0.0+mc1.21.10
Diffstat (limited to 'src/main/kotlin')
| -rw-r--r-- | src/main/kotlin/keybindings/FirmamentKeyBindings.kt | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/main/kotlin/keybindings/FirmamentKeyBindings.kt b/src/main/kotlin/keybindings/FirmamentKeyBindings.kt index c0fe995..63b7232 100644 --- a/src/main/kotlin/keybindings/FirmamentKeyBindings.kt +++ b/src/main/kotlin/keybindings/FirmamentKeyBindings.kt @@ -6,15 +6,18 @@ import com.mojang.blaze3d.platform.InputConstants import moe.nea.firmament.Firmament import moe.nea.firmament.gui.config.ManagedOption import moe.nea.firmament.util.TestUtil +import moe.nea.firmament.util.data.ManagedConfig object FirmamentKeyBindings { - val cat = KeyMapping.Category(Firmament.identifier("category")) + val cats = mutableMapOf<ManagedConfig.Category, KeyMapping.Category>() + + fun registerKeyBinding(name: String, config: ManagedOption<SavedKeyBinding>) { val vanillaKeyBinding = KeyMapping( name, InputConstants.Type.KEYSYM, -1, - cat + cats.computeIfAbsent(config.element.category) { KeyMapping.Category(Firmament.identifier(it.name.lowercase())) } ) if (!TestUtil.isInTest) { KeyBindingHelper.registerKeyBinding(vanillaKeyBinding) |
