summaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/utils
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-03-29 12:57:19 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-03-29 12:57:19 +0200
commitab471dbbfd660831e7998a1da596d562a2090677 (patch)
treef327806d07e4519797901553628dc6b5dec851ef /src/main/java/at/hannibal2/skyhanni/utils
parentb3533ebdae283e2525f660d8ec4e3214a27cab0b (diff)
downloadskyhanni-ab471dbbfd660831e7998a1da596d562a2090677.tar.gz
skyhanni-ab471dbbfd660831e7998a1da596d562a2090677.tar.bz2
skyhanni-ab471dbbfd660831e7998a1da596d562a2090677.zip
+ Money Per Hour now shows NPC Price instead of Sell Offer price when on ironman, stranded or bingo
+ Added Money per Hour Advanced stats = Money per hour compact price mode now colors current crop different
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt b/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt
index 8633dcadd..1ce7c9e22 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt
@@ -1,5 +1,6 @@
package at.hannibal2.skyhanni.utils
+import at.hannibal2.skyhanni.features.bazaar.BazaarApi
import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName
import io.github.moulberry.notenoughupdates.NEUManager
import io.github.moulberry.notenoughupdates.NotEnoughUpdates
@@ -41,6 +42,17 @@ object NEUItems {
}
fun getPrice(internalName: String, useSellingPrice: Boolean = false): Double {
+ val bazaarData = BazaarApi.getBazaarDataForInternalName(internalName)
+ bazaarData?.let {
+ val buyPrice = it.buyPrice
+ if (buyPrice > 0) return buyPrice
+
+ val sellPrice = it.sellPrice
+ if (sellPrice > 0) return sellPrice
+
+ return it.npcPrice
+ }
+
val result = manager.auctionManager.getBazaarOrBin(internalName, useSellingPrice)
// TODO remove workaround
if (result == -1.0) {