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 /src | |
| 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
Diffstat (limited to 'src')
| -rw-r--r-- | src/main/kotlin/features/inventory/SlotLocking.kt | 3 |
1 files changed, 3 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) |
