diff options
| author | Linnea Gräf <nea@nea.moe> | 2025-09-06 01:05:24 +0200 |
|---|---|---|
| committer | Linnea Gräf <nea@nea.moe> | 2025-09-06 01:05:24 +0200 |
| commit | 0185430e56e33b897cd98843378957e0e049ef43 (patch) | |
| tree | 092d3e9a350de06226d35aedae7b33b1d702233c | |
| parent | 09316a5bc3d7c91de3a6e3c3b0d7ef3732fa5e01 (diff) | |
| download | Firmament-0185430e56e33b897cd98843378957e0e049ef43.tar.gz Firmament-0185430e56e33b897cd98843378957e0e049ef43.tar.bz2 Firmament-0185430e56e33b897cd98843378957e0e049ef43.zip | |
feat: allow disabling slot binding in chest
fixes https://github.com/nea89o/Firmament/issues/290
| -rw-r--r-- | src/main/kotlin/features/inventory/SlotLocking.kt | 3 | ||||
| -rw-r--r-- | translations/en_us.json | 2 |
2 files changed, 5 insertions, 0 deletions
diff --git a/src/main/kotlin/features/inventory/SlotLocking.kt b/src/main/kotlin/features/inventory/SlotLocking.kt index eefc6d1..0be9411 100644 --- a/src/main/kotlin/features/inventory/SlotLocking.kt +++ b/src/main/kotlin/features/inventory/SlotLocking.kt @@ -137,6 +137,7 @@ object SlotLocking : FirmamentFeature { val slotBind by keyBinding("bind") { GLFW.GLFW_KEY_L } val slotBindRequireShift by toggle("require-quick-move") { true } val slotRenderLines by choice("bind-render") { SlotRenderLinesMode.ONLY_BOXES } + val slotBindOnlyInInv by toggle("bind-only-in-inv") { false } val allowMultiBinding by toggle("multi-bind") { true } // TODO: filter based on this option val protectAllHuntingBoxes by toggle("hunting-box") { false } val allowDroppingInDungeons by toggle("drop-in-dungeons") { true } @@ -269,6 +270,8 @@ object SlotLocking : FirmamentFeature { it.actionType == SlotActionType.QUICK_MOVE || (it.actionType == SlotActionType.PICKUP && !TConfig.slotBindRequireShift) if (!isValidAction) return val handler = MC.handledScreen?.screenHandler ?: return + if (TConfig.slotBindOnlyInInv && handler.slots.any { it.inventory !is PlayerInventory }) + return val slot = it.slot if (slot != null && it.slot.inventory is PlayerInventory) { val matchingSlots = boundSlots.findMatchingSlots(slot.index) diff --git a/translations/en_us.json b/translations/en_us.json index feea7fc..56baae9 100644 --- a/translations/en_us.json +++ b/translations/en_us.json @@ -363,6 +363,8 @@ "firmament.config.save-cursor-position.tolerance.description": "Select how long your cursor position last between GUIs before resetting back to the middle of the screen.", "firmament.config.slot-locking": "Slot Locking", "firmament.config.slot-locking.bind": "Bind Slot", + "firmament.config.slot-locking.bind-only-in-inv": "Bind Only in Inventory", + "firmament.config.slot-locking.bind-only-in-inv.description": "Only allow using slot binds in the player inventory, not in chests, etc.", "firmament.config.slot-locking.bind-render": "Show Slot Bindings", "firmament.config.slot-locking.bind-render.choice.everything": "Always", "firmament.config.slot-locking.bind-render.choice.nothing": "Only when hovered", |
