aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorCalMWolfs <94038482+CalMWolfs@users.noreply.github.com>2024-06-07 13:07:53 +1000
committerGitHub <noreply@github.com>2024-06-07 13:07:53 +1000
commit5882e9178278c942d4ee03eea58e3d5ef6af357b (patch)
tree25e638125317e65ea24e3dd21ffb82010c4a281a /src/main/java
parent239579b732e95562279af643527ee30b0858ee12 (diff)
downloadskyhanni-5882e9178278c942d4ee03eea58e3d5ef6af357b.tar.gz
skyhanni-5882e9178278c942d4ee03eea58e3d5ef6af357b.tar.bz2
skyhanni-5882e9178278c942d4ee03eea58e3d5ef6af357b.zip
Backend: Remove deprecated BazaarData values (#1987)
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/combat/ghostcounter/GhostCounter.kt6
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/farming/CropMoneyDisplay.kt10
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/BazaarBestSellMethod.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/BazaarData.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/BazaarOrderHelper.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/tracker/SkyHanniTracker.kt4
6 files changed, 12 insertions, 16 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/combat/ghostcounter/GhostCounter.kt b/src/main/java/at/hannibal2/skyhanni/features/combat/ghostcounter/GhostCounter.kt
index 5fdc1077e..af666b5f0 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/combat/ghostcounter/GhostCounter.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/combat/ghostcounter/GhostCounter.kt
@@ -264,10 +264,10 @@ object GhostCounter {
addAsSingletonList(etaFormatting.base.formatText(eta).formatText(killETA))
val rate = 0.12 * (1 + (avgMagicFind.toDouble() / 100))
- val sorrowValue = SORROW.getBazaarData()?.buyPrice?.toLong() ?: 0L
+ val sorrowValue = SORROW.getBazaarData()?.sellOfferPrice?.toLong() ?: 0L
val final: String = (killInterp * sorrowValue * (rate / 100)).toLong().addSeparators()
- val plasmaValue = PLASMA.getBazaarData()?.buyPrice?.toLong() ?: 0L
- val voltaValue = VOLTA.getBazaarData()?.buyPrice?.toLong() ?: 0L
+ val plasmaValue = PLASMA.getBazaarData()?.sellOfferPrice?.toLong() ?: 0L
+ val voltaValue = VOLTA.getBazaarData()?.sellOfferPrice?.toLong() ?: 0L
var moneyMade: Long = 0
val priceMap = listOf(
Triple("Sorrow", Option.SORROWCOUNT.getInt(), sorrowValue),
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/CropMoneyDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/CropMoneyDisplay.kt
index 40509d97c..97a63928c 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/CropMoneyDisplay.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/CropMoneyDisplay.kt
@@ -160,7 +160,7 @@ object CropMoneyDisplay {
}
val bazaarData = internalName.getBazaarData()
val price =
- if (LorenzUtils.noTradeMode || bazaarData == null) internalName.getNpcPrice() / 160 else (bazaarData.sellPrice + bazaarData.buyPrice) / 320
+ if (LorenzUtils.noTradeMode || bazaarData == null) internalName.getNpcPrice() / 160 else (bazaarData.instantBuyPrice + bazaarData.sellOfferPrice) / 320
extraDicerCoins = 60 * 60 * GardenCropSpeed.getRecentBPS() * dicerDrops * price
}
@@ -343,8 +343,8 @@ object CropMoneyDisplay {
val bazaarData = internalName.getBazaarData() ?: continue
var npcPrice = internalName.getNpcPrice() * cropsPerHour
- var sellOffer = bazaarData.buyPrice * cropsPerHour
- var instantSell = bazaarData.sellPrice * cropsPerHour
+ var sellOffer = bazaarData.sellOfferPrice * cropsPerHour
+ var instantSell = bazaarData.instantBuyPrice * cropsPerHour
if (debug) {
debugList.addAsSingletonList(" npcPrice: ${npcPrice.addSeparators()}")
debugList.addAsSingletonList(" sellOffer: ${sellOffer.addSeparators()}")
@@ -363,8 +363,8 @@ object CropMoneyDisplay {
}
val factor = NEUItems.getPrimitiveMultiplier(internalName).amount
npcPrice += "SEEDS".asInternalName().getNpcPrice() * seedsPerHour / factor
- sellOffer += it.buyPrice * seedsPerHour
- instantSell += it.sellPrice * seedsPerHour
+ sellOffer += it.sellOfferPrice * seedsPerHour
+ instantSell += it.instantBuyPrice * seedsPerHour
}
}
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/BazaarBestSellMethod.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/BazaarBestSellMethod.kt
index 775432866..b2ab56be6 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/BazaarBestSellMethod.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/BazaarBestSellMethod.kt
@@ -59,7 +59,7 @@ object BazaarBestSellMethod {
if (having <= 0) return ""
val data = internalName.getBazaarDataOrError()
- val totalDiff = (data.buyPrice - data.sellPrice) * having
+ val totalDiff = (data.sellOfferPrice - data.instantBuyPrice) * having
val result = NumberUtil.format(totalDiff.toInt())
val name = internalName.itemName
diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/BazaarData.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/BazaarData.kt
index db97d5e6b..21fdddfaf 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/BazaarData.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/BazaarData.kt
@@ -7,8 +7,4 @@ data class BazaarData(
val sellOfferPrice: Double,
val instantBuyPrice: Double,
val product: BazaarProduct,
- @Deprecated("outdated", ReplaceWith("instantBuyPrice"))
- val sellPrice: Double = instantBuyPrice,
- @Deprecated("outdated", ReplaceWith("sellOfferPrice"))
- val buyPrice: Double = sellOfferPrice,
)
diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/BazaarOrderHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/BazaarOrderHelper.kt
index 373b866f2..3522eb735 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/BazaarOrderHelper.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/BazaarOrderHelper.kt
@@ -76,7 +76,7 @@ class BazaarOrderHelper {
pricePattern.matchMatcher(line) {
val price = group("number").formatDouble()
- if (buyOrSell.first && price < data.sellPrice || buyOrSell.second && price > data.buyPrice) {
+ if (buyOrSell.first && price < data.instantBuyPrice || buyOrSell.second && price > data.sellOfferPrice) {
slot highlight LorenzColor.GOLD
return
}
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/tracker/SkyHanniTracker.kt b/src/main/java/at/hannibal2/skyhanni/utils/tracker/SkyHanniTracker.kt
index 51a0e4f65..beceaf8f9 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/tracker/SkyHanniTracker.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/tracker/SkyHanniTracker.kt
@@ -41,8 +41,8 @@ open class SkyHanniTracker<Data : TrackerData>(
private val storedTrackers get() = SkyHanniMod.feature.storage.trackerDisplayModes
fun getPricePer(name: NEUInternalName) = when (config.priceFrom) {
- PriceFromEntry.INSTANT_SELL -> name.getBazaarData()?.sellPrice ?: name.getPriceOrNull() ?: 0.0
- PriceFromEntry.SELL_OFFER -> name.getBazaarData()?.buyPrice ?: name.getPriceOrNull() ?: 0.0
+ PriceFromEntry.INSTANT_SELL -> name.getBazaarData()?.instantBuyPrice ?: name.getPriceOrNull() ?: 0.0
+ PriceFromEntry.SELL_OFFER -> name.getBazaarData()?.sellOfferPrice ?: name.getPriceOrNull() ?: 0.0
else -> name.getNpcPriceOrNull() ?: 0.0
}