aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/com/dulkirfabric/features/InventoryScale.kt
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin/com/dulkirfabric/features/InventoryScale.kt')
-rw-r--r--src/main/kotlin/com/dulkirfabric/features/InventoryScale.kt10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/main/kotlin/com/dulkirfabric/features/InventoryScale.kt b/src/main/kotlin/com/dulkirfabric/features/InventoryScale.kt
index eccfb2c..80442c3 100644
--- a/src/main/kotlin/com/dulkirfabric/features/InventoryScale.kt
+++ b/src/main/kotlin/com/dulkirfabric/features/InventoryScale.kt
@@ -9,12 +9,14 @@ import net.minecraft.client.MinecraftClient
import net.minecraft.client.gui.screen.ingame.HandledScreen
import net.minecraft.client.util.InputUtil
import org.lwjgl.glfw.GLFW
+import kotlin.math.max
object InventoryScale {
- private var scaleBuffer = DulkirConfig.configOptions.inventoryScale
- private var prevTickScale = DulkirConfig.configOptions.inventoryScale
- private var tickScale = DulkirConfig.configOptions.inventoryScale
+ var scaleBuffer = DulkirConfig.configOptions.inventoryScale
+ var prevTickScale = DulkirConfig.configOptions.inventoryScale
+ var tickScale = DulkirConfig.configOptions.inventoryScale
+ var frameScale = DulkirConfig.configOptions.inventoryScale
/**
@@ -35,7 +37,7 @@ object InventoryScale {
if (event.verticalScrollAmount == 0.0) return
val handle = MinecraftClient.getInstance().window.handle
if (InputUtil.isKeyPressed(handle, GLFW.GLFW_KEY_LEFT_CONTROL) && InputUtil.isKeyPressed(handle, GLFW.GLFW_KEY_LEFT_ALT))
- scaleBuffer += (.05 * event.verticalScrollAmount).toFloat()
+ scaleBuffer = max(scaleBuffer + (.05 * event.verticalScrollAmount).toFloat(), .1f)
}
@EventHandler