diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-12-12 04:21:20 +0100 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-12-12 04:21:20 +0100 |
commit | 35e13552257e07ef13ef0aaf059156a175f55340 (patch) | |
tree | 9bd56c938d7a22d63be7524eac3f200d80c9fd57 /src/main/java/at/hannibal2/skyhanni/utils/tracker | |
parent | 232c3cfc2074480976d39ca9d1f33cf7c7225a93 (diff) | |
download | skyhanni-35e13552257e07ef13ef0aaf059156a175f55340.tar.gz skyhanni-35e13552257e07ef13ef0aaf059156a175f55340.tar.bz2 skyhanni-35e13552257e07ef13ef0aaf059156a175f55340.zip |
Not only Slayer, also Fishing and Diana items will now show in chat & title when over a custom defined price.
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils/tracker')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/tracker/SkyHanniItemTracker.kt | 12 |
1 files changed, 10 insertions, 2 deletions
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<Data : ItemTrackerData>( 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<List<Any>>) { |