aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2024-04-06 01:19:13 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2024-04-06 01:19:13 +0200
commit93a31c9fd9d4c4054783ec7e0ab6753f0d86d8bb (patch)
treeb5555be5aa4fbddd2dd157650f7f43e7079ad099 /src/main
parent6c088c46709a84cf6ae6ec0b35be9d25278784c7 (diff)
downloadskyhanni-93a31c9fd9d4c4054783ec7e0ab6753f0d86d8bb.tar.gz
skyhanni-93a31c9fd9d4c4054783ec7e0ab6753f0d86d8bb.tar.bz2
skyhanni-93a31c9fd9d4c4054783ec7e0ab6753f0d86d8bb.zip
code cleanup
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/ConfigManager.kt3
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/update/GuiOptionEditorUpdateCheck.kt3
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/update/UpdateManager.kt6
3 files changed, 4 insertions, 8 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/ConfigManager.kt b/src/main/java/at/hannibal2/skyhanni/config/ConfigManager.kt
index b81e1efb8..4059761c3 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/ConfigManager.kt
+++ b/src/main/java/at/hannibal2/skyhanni/config/ConfigManager.kt
@@ -51,8 +51,7 @@ import kotlin.concurrent.fixedRateTimer
typealias TrackerDisplayMode = SkyHanniTracker.DefaultDisplayMode
private fun GsonBuilder.reigsterIfBeta(create: TypeAdapterFactory): GsonBuilder {
- val isBeta = SkyHanniMod.version.contains("beta", ignoreCase = true)
- return if (isBeta) {
+ return if (LorenzUtils.isBetaVersion()) {
registerTypeAdapterFactory(create)
} else this
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/update/GuiOptionEditorUpdateCheck.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/update/GuiOptionEditorUpdateCheck.kt
index 3b75291a0..e92d6bdf3 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/misc/update/GuiOptionEditorUpdateCheck.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/update/GuiOptionEditorUpdateCheck.kt
@@ -1,5 +1,6 @@
package at.hannibal2.skyhanni.features.misc.update
+import at.hannibal2.skyhanni.SkyHanniMod
import io.github.moulberry.moulconfig.gui.GuiOptionEditor
import io.github.moulberry.moulconfig.internal.TextRenderUtils
import io.github.moulberry.moulconfig.processor.ProcessedOption
@@ -44,7 +45,7 @@ class GuiOptionEditorUpdateCheck(option: ProcessedOption) : GuiOptionEditor(opti
val widthRemaining = width - button.width - 10
GlStateManager.scale(2F, 2F, 1F)
- val currentVersion = UpdateManager.getCurrentVersion()
+ val currentVersion = SkyHanniMod.version
val sameVersion = currentVersion.equals(nextVersion, true)
TextRenderUtils.drawStringCenteredScaledMaxWidth(
"${if (UpdateManager.updateState == UpdateManager.UpdateState.NONE) GREEN else RED}$currentVersion" +
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/update/UpdateManager.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/update/UpdateManager.kt
index f064ac574..b96533cc6 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/misc/update/UpdateManager.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/update/UpdateManager.kt
@@ -56,10 +56,6 @@ object UpdateManager {
checkUpdate()
}
- fun getCurrentVersion(): String {
- return SkyHanniMod.version
- }
-
fun injectConfigProcessor(processor: MoulConfigProcessor<*>) {
processor.registerConfigEditor(ConfigVersionDisplay::class.java) { option, _ ->
GuiOptionEditorUpdateCheck(option)
@@ -67,7 +63,7 @@ object UpdateManager {
}
fun isCurrentlyBeta(): Boolean {
- return getCurrentVersion().contains("beta", ignoreCase = true)
+ return SkyHanniMod.version.contains("beta", ignoreCase = true)
}
private val config get() = SkyHanniMod.feature.about