From 182e27f2dbf13574e43e30ef1937237d4b9be21f Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Fri, 14 Apr 2023 17:00:09 +0200 Subject: Do not show the same version number twice if it is correct --- src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java | 1 - .../skyhanni/features/misc/update/GuiOptionEditorUpdateCheck.kt | 6 ++++-- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni') diff --git a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java index 06c19a8a8..76eda7c64 100644 --- a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java +++ b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java @@ -96,7 +96,6 @@ public class SkyHanniMod { public static final String DEPENDENCIES = "after:notenoughupdates@[2.1.1,);"; - public static Features feature; public static RepoManager repo; 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 395975aa6..18620137b 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 @@ -43,9 +43,11 @@ class GuiOptionEditorUpdateCheck(option: ProcessedOption) : GuiOptionEditor(opti val widthRemaining = width - button.width - 10 GlStateManager.scale(2F, 2F, 1F) + val currentVersion = UpdateManager.getCurrentVersion() + val sameVersion = currentVersion.equals(nextVersion, true) TextRenderUtils.drawStringCenteredScaledMaxWidth( - "${if (UpdateManager.updateState == UpdateManager.UpdateState.NONE) GREEN else RED}${UpdateManager.getCurrentVersion()}" + - if (nextVersion != null) "➜ ${GREEN}${nextVersion}" else "", + "${if (UpdateManager.updateState == UpdateManager.UpdateState.NONE) GREEN else RED}$currentVersion" + + if (nextVersion != null && !sameVersion) "➜ ${GREEN}${nextVersion}" else "", fr, widthRemaining / 4F, 10F, -- cgit