From 1064ed4a42b51a4270d29d2bb45e9aa7d8e7211f Mon Sep 17 00:00:00 2001 From: HiZe_ Date: Thu, 10 Aug 2023 18:41:40 +0200 Subject: Merge pull request #379 * removed unused function format3 in NumberUtil * removed toInt and toBoolean in LorenzUtils --- .../at/hannibal2/skyhanni/features/misc/BestiaryData.kt | 17 +++++++++-------- .../at/hannibal2/skyhanni/features/misc/ChestValue.kt | 6 ++---- 2 files changed, 11 insertions(+), 12 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni/features') diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/BestiaryData.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/BestiaryData.kt index 626d24f03..76a46b320 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/BestiaryData.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/BestiaryData.kt @@ -5,12 +5,13 @@ import at.hannibal2.skyhanni.events.GuiContainerEvent import at.hannibal2.skyhanni.events.GuiRenderEvent import at.hannibal2.skyhanni.events.InventoryCloseEvent import at.hannibal2.skyhanni.events.InventoryFullyOpenedEvent -import at.hannibal2.skyhanni.utils.* +import at.hannibal2.skyhanni.utils.InventoryUtils import at.hannibal2.skyhanni.utils.ItemUtils.getLore +import at.hannibal2.skyhanni.utils.LorenzColor +import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.LorenzUtils.addAsSingletonList import at.hannibal2.skyhanni.utils.LorenzUtils.addButton -import at.hannibal2.skyhanni.utils.LorenzUtils.toBoolean -import at.hannibal2.skyhanni.utils.LorenzUtils.toInt +import at.hannibal2.skyhanni.utils.NumberUtil import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators import at.hannibal2.skyhanni.utils.NumberUtil.formatNumber import at.hannibal2.skyhanni.utils.NumberUtil.romanToDecimalIfNeeded @@ -320,17 +321,17 @@ object BestiaryData { newDisplay.addButton( prefix = "§7Number Type: ", - getName = NumberType.entries[config.replaceRoman.toInt()].type, + getName = NumberType.entries[if (config.replaceRoman) 1 else 0].type, onChange = { - config.replaceRoman = ((config.replaceRoman.toInt() + 1) % 2).toBoolean() + config.replaceRoman = !config.replaceRoman update() } ) newDisplay.addButton( prefix = "§7Hide Maxed: ", - getName = HideMaxed.entries[config.hideMaxed.toInt()].b, + getName = HideMaxed.entries[if (config.hideMaxed) 1 else 0].type, onChange = { - config.hideMaxed = ((config.hideMaxed.toInt() + 1) % 2).toBoolean() + config.hideMaxed = !config.hideMaxed update() } ) @@ -405,7 +406,7 @@ object BestiaryData { HIGHEST_NEEDED_TIER("Highest kills needed to next tier"), } - enum class HideMaxed(val b: String) { + enum class HideMaxed(val type: String) { NO("Show"), YES("Hide") } diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/ChestValue.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/ChestValue.kt index 37f1d7c6e..b0228642b 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/ChestValue.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/ChestValue.kt @@ -8,8 +8,6 @@ import at.hannibal2.skyhanni.utils.* import at.hannibal2.skyhanni.utils.ItemUtils.getInternalNameOrNull import at.hannibal2.skyhanni.utils.LorenzUtils.addAsSingletonList import at.hannibal2.skyhanni.utils.LorenzUtils.addButton -import at.hannibal2.skyhanni.utils.LorenzUtils.toBoolean -import at.hannibal2.skyhanni.utils.LorenzUtils.toInt import at.hannibal2.skyhanni.utils.NEUItems.getItemStackOrNull import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators import at.hannibal2.skyhanni.utils.RenderUtils.highlight @@ -155,9 +153,9 @@ class ChestValue { }) newDisplay.addButton("§7Display Type: ", - getName = DisplayType.entries[config.alignedDisplay.toInt()].type, + getName = DisplayType.entries[if (config.alignedDisplay) 1 else 0].type, onChange = { - config.alignedDisplay = ((config.alignedDisplay.toInt() + 1) % 2).toBoolean() + config.alignedDisplay = !config.alignedDisplay update() }) } -- cgit