Skip to content

Commit

Permalink
Diana Chat hider.
Browse files Browse the repository at this point in the history
  • Loading branch information
hannibal002 committed Dec 16, 2023
1 parent 905ae15 commit 35eea60
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ public class FilterTypesConfig {
@FeatureToggle
public boolean fireSale = true;

@Expose
@ConfigOption(name = "Diana", desc = "Hide chat messages around griffin burrow chains and griffin feather drops and coin drops.")
@ConfigEditorBoolean
@FeatureToggle
public boolean diana = false;

//TODO remove
@Expose
@ConfigOption(name = "Others", desc = "Hide other annoying messages.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,29 @@ object DianaProfitTracker {

@SubscribeEvent
fun onChat(event: LorenzChatEvent) {
if (chatDugOutPattern.matches(event.message)) {
val message = event.message
if (chatDugOutPattern.matches(message)) {
tracker.modify {
it.burrowsDug++
}
tryHide(event)
}
chatDugOutCoinsPattern.matchMatcher(event.message) {
chatDugOutCoinsPattern.matchMatcher(message) {
val coins = group("coins").formatNumber().toInt()
tracker.addCoins(coins)
tryHide(event)
}

if (message == "§6§lRARE DROP! §r§eYou dug out a §r§9Griffin Feather§r§e!" ||
message == "§eFollow the arrows to find the §r§6treasure§r§e!"
) {
tryHide(event)
}
}

private fun tryHide(event: LorenzChatEvent) {
if (SkyHanniMod.feature.chat.filterType.diana) {
event.blockedReason = "diana_chain_or_drops"
}
}

Expand Down

0 comments on commit 35eea60

Please sign in to comment.