From 35e13552257e07ef13ef0aaf059156a175f55340 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Tue, 12 Dec 2023 04:21:20 +0100 Subject: Not only Slayer, also Fishing and Diana items will now show in chat & title when over a custom defined price. --- .../hannibal2/skyhanni/utils/tracker/SkyHanniItemTracker.kt | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni/utils/tracker') diff --git a/src/main/java/at/hannibal2/skyhanni/utils/tracker/SkyHanniItemTracker.kt b/src/main/java/at/hannibal2/skyhanni/utils/tracker/SkyHanniItemTracker.kt index 6812476df..60d094dbe 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/tracker/SkyHanniItemTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/tracker/SkyHanniItemTracker.kt @@ -3,6 +3,7 @@ package at.hannibal2.skyhanni.utils.tracker import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.config.Storage import at.hannibal2.skyhanni.config.features.misc.TrackerConfig.PriceFromEntry +import at.hannibal2.skyhanni.data.SlayerAPI import at.hannibal2.skyhanni.test.PriceSource import at.hannibal2.skyhanni.utils.ItemUtils.getNameWithEnchantment import at.hannibal2.skyhanni.utils.KeyboardManager @@ -35,15 +36,22 @@ class SkyHanniItemTracker( addItem(SKYBLOCK_COIN, coins) } - fun addItem(internalName: NEUInternalName, stackSize: Int) { + fun addItem(internalName: NEUInternalName, amount: Int) { modify { - it.additem(internalName, stackSize) + it.additem(internalName, amount) } getSharedTracker()?.let { val hidden = it.get(DisplayMode.TOTAL).items[internalName]!!.hidden it.get(DisplayMode.SESSION).items[internalName]!!.hidden = hidden } + val (itemName, price) = SlayerAPI.getItemNameAndPrice(internalName, amount) + if (config.warnings.chat && price >= config.warnings.minimumChat) { + LorenzUtils.chat("§a+Tracker Drop§7: §r$itemName") + } + if (config.warnings.title && price >= config.warnings.minimumTitle) { + LorenzUtils.sendTitle("§a+ $itemName", 5.seconds) + } } fun addPriceFromButton(lists: MutableList>) { -- cgit