Skip to content

Commit c7669dc

Browse files
committed
fix: vanilly keybinding categories
1 parent dfe288c commit c7669dc

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/main/kotlin/keybindings/FirmamentKeyBindings.kt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,18 @@ import com.mojang.blaze3d.platform.InputConstants
66
import moe.nea.firmament.Firmament
77
import moe.nea.firmament.gui.config.ManagedOption
88
import moe.nea.firmament.util.TestUtil
9+
import moe.nea.firmament.util.data.ManagedConfig
910

1011
object FirmamentKeyBindings {
11-
val cat = KeyMapping.Category(Firmament.identifier("category"))
12+
val cats = mutableMapOf<ManagedConfig.Category, KeyMapping.Category>()
13+
14+
1215
fun registerKeyBinding(name: String, config: ManagedOption<SavedKeyBinding>) {
1316
val vanillaKeyBinding = KeyMapping(
1417
name,
1518
InputConstants.Type.KEYSYM,
1619
-1,
17-
cat
20+
cats.computeIfAbsent(config.element.category) { KeyMapping.Category(Firmament.identifier(it.name.lowercase())) }
1821
)
1922
if (!TestUtil.isInTest) {
2023
KeyBindingHelper.registerKeyBinding(vanillaKeyBinding)

translations/en_us.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -578,5 +578,10 @@
578578
"firmament.warp-util.mark-excluded": "Firmament: Tried to warp to %s, but it was not unlocked. I will avoid warping there again.",
579579
"firmament.warp-util.no-warp-found": "Could not find an unlocked warp in %s",
580580
"firmament.waypoint.temporary": "Temporary Waypoint: %s",
581+
"key.category.firmament.dev": "Firmament > Dev",
582+
"key.category.firmament.events": "Firmament > Events",
583+
"key.category.firmament.inventory": "Firmament > Inventory",
584+
"key.category.firmament.items": "Firmament > Items",
585+
"key.category.firmament.misc": "Firmament > Misc",
581586
"zzzzzzzzz.lastentry": "Here so every real firmament entry has a trailing ,"
582587
}

0 commit comments

Comments
 (0)