diff options
author | Walker Selby <git@walkerselby.com> | 2023-12-11 13:59:52 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-11 22:59:52 +0100 |
commit | d5b4a817e2b9e7e5c88eb0c8212b9a6e678bd92f (patch) | |
tree | bc07923686b77da759b3f12ea535f2e3c02deead /src/main/java/at/hannibal2/skyhanni/data/SackAPI.kt | |
parent | b8ec689ce9bd6fe89e4b825a988edb63fb51b5ab (diff) | |
download | skyhanni-d5b4a817e2b9e7e5c88eb0c8212b9a6e678bd92f.tar.gz skyhanni-d5b4a817e2b9e7e5c88eb0c8212b9a6e678bd92f.tar.bz2 skyhanni-d5b4a817e2b9e7e5c88eb0c8212b9a6e678bd92f.zip |
Internal: Migrate Deprecated Config Values to Enums (#790)
Migrate Deprecated Config Values to Enums. #790
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/data/SackAPI.kt')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/data/SackAPI.kt | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/data/SackAPI.kt b/src/main/java/at/hannibal2/skyhanni/data/SackAPI.kt index 3694bf672..8a2c511b3 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/SackAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/SackAPI.kt @@ -2,6 +2,7 @@ package at.hannibal2.skyhanni.data import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.config.ConfigFileType +import at.hannibal2.skyhanni.config.features.inventory.SackDisplayConfig.PriceFrom import at.hannibal2.skyhanni.events.InventoryCloseEvent import at.hannibal2.skyhanni.events.InventoryFullyOpenedEvent import at.hannibal2.skyhanni.events.LorenzChatEvent @@ -89,9 +90,10 @@ object SackAPI { } private fun NEUInternalName.sackPrice(stored: String) = when (sackDisplayConfig.priceFrom) { - 0 -> (getPrice(true) * stored.formatNumber()).toLong().let { if (it < 0) 0L else it } + PriceFrom.BAZAAR -> (getPrice(true) * stored.formatNumber()).toLong() + .let { if (it < 0) 0L else it } - 1 -> try { + PriceFrom.NPC -> try { val npcPrice = getNpcPriceOrNull() ?: 0.0 (npcPrice * stored.formatNumber()).toLong() } catch (e: Exception) { |