feat: Add option to stop scrolling over items in storage overlay
This commit is contained in:
@@ -33,6 +33,7 @@ object StorageOverlay : FirmamentFeature {
|
||||
val inverseScroll by toggle("inverse-scroll") { false }
|
||||
val padding by integer("padding", 1, 20) { 5 }
|
||||
val margin by integer("margin", 1, 60) { 20 }
|
||||
val itemsBlockScrolling by toggle("block-item-scrolling") { true }
|
||||
}
|
||||
|
||||
fun adjustScrollSpeed(amount: Double): Double {
|
||||
|
||||
@@ -9,6 +9,7 @@ import net.minecraft.entity.player.PlayerInventory
|
||||
import net.minecraft.screen.slot.Slot
|
||||
import moe.nea.firmament.mixins.accessor.AccessorHandledScreen
|
||||
import moe.nea.firmament.util.customgui.CustomGui
|
||||
import moe.nea.firmament.util.focusedItemStack
|
||||
|
||||
class StorageOverlayCustom(
|
||||
val handler: StorageBackingHandle,
|
||||
@@ -113,6 +114,8 @@ class StorageOverlayCustom(
|
||||
horizontalAmount: Double,
|
||||
verticalAmount: Double
|
||||
): Boolean {
|
||||
if (screen.focusedItemStack != null && StorageOverlay.TConfig.itemsBlockScrolling)
|
||||
return false
|
||||
return overview.mouseScrolled(mouseX, mouseY, horizontalAmount, verticalAmount)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user