From 79d891d5a3e1bffd31491a921757ccf7ab66b5fe Mon Sep 17 00:00:00 2001 From: Thunderblade73 <85900443+Thunderblade73@users.noreply.github.com> Date: Sat, 31 Aug 2024 22:31:55 +0200 Subject: Feature: Bits on Cookie (#2265) Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com> --- .../skyhanni/config/features/misc/BitsConfig.java | 19 +++++ .../java/at/hannibal2/skyhanni/data/BitsAPI.kt | 40 ++++++----- .../features/inventory/BitsPerCookieVisual.kt | 80 ++++++++++++++++++++++ .../java/at/hannibal2/skyhanni/utils/RegexUtils.kt | 10 +++ 4 files changed, 130 insertions(+), 19 deletions(-) create mode 100644 src/main/java/at/hannibal2/skyhanni/features/inventory/BitsPerCookieVisual.kt (limited to 'src/main') diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/misc/BitsConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/misc/BitsConfig.java index 9b3cc32e8..7179a2aab 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/misc/BitsConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/misc/BitsConfig.java @@ -7,6 +7,25 @@ import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorSlider; import io.github.notenoughupdates.moulconfig.annotations.ConfigOption; public class BitsConfig { + + @Expose + @ConfigOption(name = "Bulk Buy Cookie Time", desc = "Corrects the time for cookies if bought in bulk on the buy item.") + @ConfigEditorBoolean + @FeatureToggle + public boolean bulkBuyCookieTime = true; + + @Expose + @ConfigOption(name = "Bits on Cookie", desc = "Show the bits you would gain on a cookies.") + @ConfigEditorBoolean + @FeatureToggle + public boolean showBitsOnCookie = true; + + @Expose + @ConfigOption(name = "Bits on Cookie Change", desc = "Show the change in available bits on cookies.") + @ConfigEditorBoolean + @FeatureToggle + public boolean showBitsChangeOnCookie = false; + @Expose @ConfigOption(name = "Enable No Bits Warning", desc = "Alerts you when you have no bits available.") @ConfigEditorBoolean diff --git a/src/main/java/at/hannibal2/skyhanni/data/BitsAPI.kt b/src/main/java/at/hannibal2/skyhanni/data/BitsAPI.kt index 72928fd25..e9e58fa46 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/BitsAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/BitsAPI.kt @@ -60,7 +60,7 @@ object BitsAPI { // Scoreboard patterns val bitsScoreboardPattern by bitsDataGroup.pattern( "scoreboard", - "^Bits: §b(?[\\d,.]+).*$" + "^Bits: §b(?[\\d,.]+).*$", ) // Chat patterns @@ -68,17 +68,17 @@ object BitsAPI { private val bitsFromFameRankUpChatPattern by bitsChatGroup.pattern( "rankup.bits", - "§eYou gained §3(?.*) Bits Available §ecompounded from all your §epreviously eaten §6cookies§e! Click here to open §6cookie menu§e!" + "§eYou gained §3(?.*) Bits Available §ecompounded from all your §epreviously eaten §6cookies§e! Click here to open §6cookie menu§e!", ) private val fameRankUpPattern by bitsChatGroup.pattern( "rankup.rank", - "[§\\w\\s]+FAME RANK UP (?:§.)+(?.*)" + "[§\\w\\s]+FAME RANK UP (?:§.)+(?.*)", ) private val boosterCookieAte by bitsChatGroup.pattern( "boostercookieate", - "§eYou consumed a §6Booster Cookie§e!.*" + "§eYou consumed a §6Booster Cookie§e!.*", ) // GUI patterns @@ -86,12 +86,12 @@ object BitsAPI { private val bitsAvailableMenuPattern by bitsGuiGroup.pattern( "availablemenu", - "§7Bits Available: §b(?[\\d,]+)(§3.+)?" + "§7Bits Available: §b(?[\\d,]+)(§3.+)?", ) private val fameRankSbMenuPattern by bitsGuiGroup.pattern( "sbmenufamerank", - "§7Your rank: §e(?.*)" + "§7Your rank: §e(?.*)", ) /** @@ -99,47 +99,47 @@ object BitsAPI { */ private val cookieDurationPattern by bitsGuiGroup.pattern( "cookieduration", - "\\s*§7Duration: §a(?