diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-06-12 15:06:51 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-06-12 15:06:51 +0200 |
commit | 151cd72af5aa82cdbc3d99b6240261e1b33bbf8b (patch) | |
tree | 363d6245a8f9f3ba54758485837133b82218a0fc /src/main/java/at/hannibal2/skyhanni | |
parent | fe9e6825401abe1309d915a3fa237322b33c6413 (diff) | |
download | skyhanni-151cd72af5aa82cdbc3d99b6240261e1b33bbf8b.tar.gz skyhanni-151cd72af5aa82cdbc3d99b6240261e1b33bbf8b.tar.bz2 skyhanni-151cd72af5aa82cdbc3d99b6240261e1b33bbf8b.zip |
Added title warning when picking up an expensive slayer item
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/config/features/Slayer.java | 10 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerItemProfitTracker.kt | 8 |
2 files changed, 17 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/Slayer.java b/src/main/java/at/hannibal2/skyhanni/config/features/Slayer.java index 424c478ba..00392bcc4 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/Slayer.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/Slayer.java @@ -113,6 +113,16 @@ public class Slayer { @ConfigOption(name = "Minimum Price", desc = "Items below this price will not show up in chat.") @ConfigEditorSlider(minValue = 1, maxValue = 5_000_000, minStep = 1) public int minimumPrice = 100_000; + + @Expose + @ConfigOption(name = "Title Warning", desc = "Show an title for expensive item pickups.") + @ConfigEditorBoolean + public boolean titleWarning = false; + + @Expose + @ConfigOption(name = "Title Price", desc = "Items above this price will show up as title.") + @ConfigEditorSlider(minValue = 1, maxValue = 20_000_000, minStep = 1) + public int minimumPriceWarning = 500_000; } @Expose diff --git a/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerItemProfitTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerItemProfitTracker.kt index 2933017d1..b32073c60 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerItemProfitTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerItemProfitTracker.kt @@ -4,6 +4,7 @@ import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.config.Storage import at.hannibal2.skyhanni.data.ProfileStorageData import at.hannibal2.skyhanni.data.SlayerAPI +import at.hannibal2.skyhanni.data.TitleUtils import at.hannibal2.skyhanni.events.* import at.hannibal2.skyhanni.features.bazaar.BazaarApi import at.hannibal2.skyhanni.features.bazaar.BazaarData @@ -127,10 +128,15 @@ class SlayerItemProfitTracker { addItemPickup(internalName, itemStack.stackSize) logger.log("Coins gained for picking up an item ($itemName) ${price.addSeparators()}") if (config.priceInChat) { - if (config.minimumPrice < price) { + if (price > config.minimumPrice) { LorenzUtils.chat("§e[SkyHanni] §a+Slayer Drop§7: §r$itemName") } } + if (config.titleWarning) { + if (price > config.minimumPriceWarning) { + TitleUtils.sendTitle("§a+ $itemName", 5_000) + } + } } fun update() { |