From 5856e21ad1367ef23d9fb37545d5e97fdc6a0d38 Mon Sep 17 00:00:00 2001 From: isXander Date: Sun, 31 Jul 2022 19:05:57 +0100 Subject: [PATCH] fine tune scrolling Signed-off-by: isXander --- build.gradle.kts | 9 ++++----- changelogs/2.0.0.md | 2 +- gradle.properties | 2 +- src/main/kotlin/dev/isxander/zoomify/ZoomHelper.kt | 4 ++-- .../dev/isxander/zoomify/config/ZoomifySettings.kt | 2 +- src/main/resources/fabric.mod.json | 2 +- 6 files changed, 10 insertions(+), 11 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 24c658b..31b46ec 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -10,10 +10,10 @@ plugins { id("com.modrinth.minotaur") version "2.4.+" id("me.hypherionmc.cursegradle") version "2.+" - id("com.github.breadmoirai.github-release") version "2.+" + id("com.github.breadmoirai.github-release") version "2.4.+" `maven-publish` - id("io.github.p03w.machete") version "1.+" + id("io.github.p03w.machete") version "1.1.+" } group = "dev.isxander" @@ -21,11 +21,10 @@ version = "2.0.0" repositories { mavenCentral() - maven("https://repo.sk1er.club/repository/maven-public") + maven("https://maven.isxander.dev/releases") + maven("https://maven.shedaniel.me/") maven("https://maven.terraformersmc.com/releases") maven("https://jitpack.io") - maven("https://maven.shedaniel.me/") - maven("https://maven.isxander.dev/releases") } val minecraftVersion: String by project diff --git a/changelogs/2.0.0.md b/changelogs/2.0.0.md index 048abc1..8f9db3f 100644 --- a/changelogs/2.0.0.md +++ b/changelogs/2.0.0.md @@ -40,5 +40,5 @@ - When letting go of the zoom key or toggling zoom off whilst scrolled in, the normal zoom out transition is used with the same amount of time as if you weren't scrolled. - Increased number of scroll steps to 30. -- Apply quadratic function to scroll zoom steps to make the first few steps smaller +- Apply function to scroll zoom steps to make the first few steps smaller and the last steps larger to create a more linear effect. diff --git a/gradle.properties b/gradle.properties index a0c0c7a..03c1e66 100644 --- a/gradle.properties +++ b/gradle.properties @@ -8,7 +8,7 @@ minecraftVersion=1.19.1 loaderVersion=0.14.+ fabricVersion=0.58.5+1.19.1 fabricKotlinVersion=1.8.2 -settxiVersion=2.5.2 +settxiVersion=2.5.3 modrinthId=zoomify curseforgeId=574741 diff --git a/src/main/kotlin/dev/isxander/zoomify/ZoomHelper.kt b/src/main/kotlin/dev/isxander/zoomify/ZoomHelper.kt index 9fea6fa..c866ccb 100644 --- a/src/main/kotlin/dev/isxander/zoomify/ZoomHelper.kt +++ b/src/main/kotlin/dev/isxander/zoomify/ZoomHelper.kt @@ -90,7 +90,7 @@ class ZoomHelper(private val starting: Double = 1.0) { return (1/initialMultiplier + scrollDivisor).also { if (initialInterpolation == 0.0 && scrollInterpolation == 0.0) resetting = false - if (!resetting) resetInterpolation = 1/it + if (!resetting) resetInterpolation = 1 / it } } @@ -106,7 +106,7 @@ class ZoomHelper(private val starting: Double = 1.0) { return MathHelper.lerp( MathHelper.lerp(tickDelta.toDouble(), prevScrollInterpolation, scrollInterpolation), 0.0, - Zoomify.maxScrollTiers * (ZoomifySettings.scrollZoomAmount * 2.0) + Zoomify.maxScrollTiers * (ZoomifySettings.scrollZoomAmount * 3.0) ).let { if (resetting) 0.0 else it } } diff --git a/src/main/kotlin/dev/isxander/zoomify/config/ZoomifySettings.kt b/src/main/kotlin/dev/isxander/zoomify/config/ZoomifySettings.kt index 431a8ef..ab91bbb 100644 --- a/src/main/kotlin/dev/isxander/zoomify/config/ZoomifySettings.kt +++ b/src/main/kotlin/dev/isxander/zoomify/config/ZoomifySettings.kt @@ -66,7 +66,7 @@ object ZoomifySettings : SettxiConfigKotlinx(FabricLoader.getInstance().configDi category = SCROLLING } - var scrollZoomAmount by int(2) { + var scrollZoomAmount by int(3) { name = "zoomify.gui.scrollZoomAmount.name" description = "zoomify.gui.scrollZoomAmount.description" category = SCROLLING diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index a383444..0d0309f 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -41,7 +41,7 @@ "fabric-language-kotlin": ">=1.8.2+kotlin.1.7.10", "minecraft": "1.19.x", "java": ">=17", - "cloth-config": "7.x.x", + "cloth-config": ["7.x.x", "8.x.x"], "settxi-gui-cloth-config": "2.x.x" }, "suggests": {