From 33f2c27462ee0c64263e2decbfa52f61c1568e9d Mon Sep 17 00:00:00 2001 From: jani270 <69345714+jani270@users.noreply.github.com> Date: Wed, 4 Jun 2025 23:49:05 +0200 Subject: feat: Multiplier for Price Data (ex. Pressing a Key shows the price for x Item instead of just 1) --- src/main/kotlin/features/inventory/PriceData.kt | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'src') 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 ) ) } -- cgit