aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjani270 <69345714+jani270@users.noreply.github.com>2025-06-04 23:49:05 +0200
committerLinnea Gräf <nea@nea.moe>2025-06-07 23:19:12 +0200
commit33f2c27462ee0c64263e2decbfa52f61c1568e9d (patch)
tree673eb69a02ce45075df43752b9cf4dc2f39a7588 /src
parent0af721bcb274e26fa866ac40314633ffb017d7bc (diff)
downloadFirmament-33f2c27462ee0c64263e2decbfa52f61c1568e9d.tar.gz
Firmament-33f2c27462ee0c64263e2decbfa52f61c1568e9d.tar.bz2
Firmament-33f2c27462ee0c64263e2decbfa52f61c1568e9d.zip
feat: Multiplier for Price Data (ex. Pressing a Key shows the price for x Item instead of just 1)
Diffstat (limited to 'src')
-rw-r--r--src/main/kotlin/features/inventory/PriceData.kt16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/main/kotlin/features/inventory/PriceData.kt b/src/main/kotlin/features/inventory/PriceData.kt
index a724d63..026cb93 100644
--- a/src/main/kotlin/features/inventory/PriceData.kt
+++ b/src/main/kotlin/features/inventory/PriceData.kt
@@ -1,5 +1,6 @@
package moe.nea.firmament.features.inventory
+import org.lwjgl.glfw.GLFW
import net.minecraft.text.Text
import moe.nea.firmament.annotations.Subscribe
import moe.nea.firmament.events.ItemTooltipEvent
@@ -8,6 +9,7 @@ import moe.nea.firmament.gui.config.ManagedConfig
import moe.nea.firmament.repo.HypixelStaticData
import moe.nea.firmament.util.FirmFormatters.formatCommas
import moe.nea.firmament.util.bold
+import moe.nea.firmament.util.darkGrey
import moe.nea.firmament.util.gold
import moe.nea.firmament.util.skyBlockId
import moe.nea.firmament.util.tr
@@ -20,6 +22,7 @@ object PriceData : FirmamentFeature {
object TConfig : ManagedConfig(identifier, Category.INVENTORY) {
val tooltipEnabled by toggle("enable-always") { true }
val enableKeybinding by keyBindingWithDefaultUnbound("enable-keybind")
+ val stackSizeKey by keyBinding("stack-size") { GLFW.GLFW_KEY_LEFT_SHIFT }
}
override val config get() = TConfig
@@ -44,28 +47,35 @@ object PriceData : FirmamentFeature {
return
}
val sbId = it.stack.skyBlockId
+ val stackSize = it.stack.count
+ val multiplier = if (TConfig.stackSizeKey.isPressed(atLeast = true)) stackSize else 1
+ val multiplierText =
+ Text.literal("[").append(TConfig.stackSizeKey.format().string).append(" to show x").append("${stackSize}]")
+ .darkGrey()
val bazaarData = HypixelStaticData.bazaarData[sbId]
val lowestBin = HypixelStaticData.lowestBin[sbId]
if (bazaarData != null) {
it.lines.add(Text.literal(""))
+ it.lines.add(multiplierText)
it.lines.add(
formatPrice(
tr("firmament.tooltip.bazaar.sell-order", "Bazaar Sell Order"),
- bazaarData.quickStatus.sellPrice
+ bazaarData.quickStatus.sellPrice * multiplier
)
)
it.lines.add(
formatPrice(
tr("firmament.tooltip.bazaar.buy-order", "Bazaar Buy Order"),
- bazaarData.quickStatus.buyPrice
+ bazaarData.quickStatus.buyPrice * multiplier
)
)
} else if (lowestBin != null) {
it.lines.add(Text.literal(""))
+ it.lines.add(multiplierText)
it.lines.add(
formatPrice(
tr("firmament.tooltip.ah.lowestbin", "Lowest BIN"),
- lowestBin
+ lowestBin * multiplier
)
)
}