diff options
author | CalMWolfs <94038482+CalMWolfs@users.noreply.github.com> | 2024-05-24 20:24:55 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-24 12:24:55 +0200 |
commit | a425f95998893cf2dbeca4deb80df3a9dfb1c466 (patch) | |
tree | 3e064e62889f144834354db1c642750429b7686c /src | |
parent | df42041dee8ee08f7b3445a87a9e977cc23a4060 (diff) | |
download | skyhanni-a425f95998893cf2dbeca4deb80df3a9dfb1c466.tar.gz skyhanni-a425f95998893cf2dbeca4deb80df3a9dfb1c466.tar.bz2 skyhanni-a425f95998893cf2dbeca4deb80df3a9dfb1c466.zip |
Fix: Calendar pattern (#1871)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/garden/GardenNextJacobContest.kt | 15 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/garden/contest/JacobFarmingContestsInventory.kt | 1 |
2 files changed, 10 insertions, 6 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenNextJacobContest.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenNextJacobContest.kt index 05668871f..0bfc9c87b 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenNextJacobContest.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenNextJacobContest.kt @@ -28,7 +28,6 @@ import at.hannibal2.skyhanni.utils.SimpleTimeMark.Companion.asTimeMark import at.hannibal2.skyhanni.utils.SkyBlockTime import at.hannibal2.skyhanni.utils.SoundUtils import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher -import at.hannibal2.skyhanni.utils.StringUtils.matches import at.hannibal2.skyhanni.utils.StringUtils.removeColor import at.hannibal2.skyhanni.utils.TabListData import at.hannibal2.skyhanni.utils.TimeUtils.format @@ -67,9 +66,16 @@ object GardenNextJacobContest { "day", "§aDay (?<day>.*)" ) + + /** + * REGEX-TEST: Early Spring, Year 351 + * REGEX-TEST: Late Summer, Year 351 + * REGEX-TEST: Autumn, Year 351 + */ + val monthPattern by patternGroup.pattern( "month", - "(?<month>.*), Year (?<year>.*)" + "(?<month>(?:\\w+ )?(?:Summer|Spring|Winter|Autumn)), Year (?<year>\\d+)" ) private val cropPattern by patternGroup.pattern( "crop", @@ -187,11 +193,8 @@ object GardenNextJacobContest { @SubscribeEvent fun onInventoryOpen(event: InventoryFullyOpenedEvent) { if (!config.display) return - if (!monthPattern.matches(event.inventoryName)) return - - inCalendar = true - monthPattern.matchMatcher(event.inventoryName) { + inCalendar = true val month = LorenzUtils.getSBMonthByName(group("month")) val year = group("year").toInt() diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/contest/JacobFarmingContestsInventory.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/contest/JacobFarmingContestsInventory.kt index 72d3c6975..8cdde229f 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/contest/JacobFarmingContestsInventory.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/contest/JacobFarmingContestsInventory.kt @@ -82,6 +82,7 @@ class JacobFarmingContestsInventory { @SubscribeEvent fun onSlotClick(event: GuiContainerEvent.SlotClickEvent) { + // TODO add tooltip line "click + press <keybind> to open on elite website if (!config.openOnElite.isKeyHeld()) return if (!LorenzUtils.inSkyBlock) return |