aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at
diff options
context:
space:
mode:
authorPhoebe <77941535+catgirlseraid@users.noreply.github.com>2024-05-29 19:17:47 +1200
committerGitHub <noreply@github.com>2024-05-29 09:17:47 +0200
commitc38ebf82a6f82ef66250710bb9b7513bc2ae732e (patch)
tree8b0b2d79fe62e7c9cac91d024af5a556aee1ebfa /src/main/java/at
parent84b36cb1c0b89f42cc0613cfdbba275a78528fb2 (diff)
downloadskyhanni-c38ebf82a6f82ef66250710bb9b7513bc2ae732e.tar.gz
skyhanni-c38ebf82a6f82ef66250710bb9b7513bc2ae732e.tar.bz2
skyhanni-c38ebf82a6f82ef66250710bb9b7513bc2ae732e.zip
Feature: Auction outbid warning (#1818)
Co-authored-by: SeRaid <77941535+SeRaid743@users.noreply.github.com> Co-authored-by: Cal <cwolfson58@gmail.com>
Diffstat (limited to 'src/main/java/at')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/inventory/AuctionHouseConfig.java6
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/inventory/AuctionOutbidWarning.kt28
3 files changed, 36 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt
index 44aa8dd7f..f389feeea 100644
--- a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt
+++ b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt
@@ -255,6 +255,7 @@ import at.hannibal2.skyhanni.features.gui.customscoreboard.CustomScoreboard
import at.hannibal2.skyhanni.features.gui.customscoreboard.ScoreboardPattern
import at.hannibal2.skyhanni.features.gui.quiver.QuiverDisplay
import at.hannibal2.skyhanni.features.gui.quiver.QuiverWarning
+import at.hannibal2.skyhanni.features.inventory.AuctionOutbidWarning
import at.hannibal2.skyhanni.features.inventory.AuctionsHighlighter
import at.hannibal2.skyhanni.features.inventory.ChestValue
import at.hannibal2.skyhanni.features.inventory.DojoRankDisplay
@@ -949,6 +950,7 @@ class SkyHanniMod {
loadModule(ColdOverlay())
loadModule(QuiverDisplay())
loadModule(QuiverWarning())
+ loadModule(AuctionOutbidWarning)
// test stuff
loadModule(SkyHanniDebugsAndTests())
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/inventory/AuctionHouseConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/inventory/AuctionHouseConfig.java
index 21108095b..65a21438a 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/features/inventory/AuctionHouseConfig.java
+++ b/src/main/java/at/hannibal2/skyhanni/config/features/inventory/AuctionHouseConfig.java
@@ -55,4 +55,10 @@ public class AuctionHouseConfig {
@ConfigEditorBoolean
@FeatureToggle
public boolean openPriceWebsite = false;
+
+ @Expose
+ @ConfigOption(name = "Outbid alert", desc = "Sends a warning when you're outbid on an auction.")
+ @ConfigEditorBoolean
+ @FeatureToggle
+ public boolean auctionOutbid = false;
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/AuctionOutbidWarning.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/AuctionOutbidWarning.kt
new file mode 100644
index 000000000..eae258eee
--- /dev/null
+++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/AuctionOutbidWarning.kt
@@ -0,0 +1,28 @@
+package at.hannibal2.skyhanni.features.inventory
+
+import at.hannibal2.skyhanni.SkyHanniMod
+import at.hannibal2.skyhanni.data.TitleManager
+import at.hannibal2.skyhanni.events.LorenzChatEvent
+import at.hannibal2.skyhanni.utils.LorenzUtils
+import at.hannibal2.skyhanni.utils.SoundUtils
+import at.hannibal2.skyhanni.utils.StringUtils.matches
+import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern
+import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
+import kotlin.time.Duration.Companion.seconds
+
+object AuctionOutbidWarning {
+ private val outbidPattern by RepoPattern.pattern(
+ "auction.outbid",
+ "§6\\[Auction].*§eoutbid you by.*§e§lCLICK"
+ )
+
+ @SubscribeEvent
+ fun onChat(event: LorenzChatEvent) {
+ if (!LorenzUtils.inSkyBlock) return
+ if (!SkyHanniMod.feature.inventory.auctions.auctionOutbid) return
+ if (!outbidPattern.matches(event.message)) return
+
+ TitleManager.sendTitle("§cYou have been outbid!", 5.seconds, 3.6, 7.0f)
+ SoundUtils.playBeepSound()
+ }
+}