diff options
author | Erymanthus[#5074] | (u/)RayDeeUx <51521765+RayDeeUx@users.noreply.github.com> | 2023-12-01 18:29:11 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-02 00:29:11 +0100 |
commit | 3a661521014be1ff856e08243f961f8745571eb2 (patch) | |
tree | cebcb81ef52dedab00cd431deb4d269a774b39c7 /src/main/java | |
parent | 3de887d7ec97ab25bd98277f1eef1fb3f8a1a3dc (diff) | |
download | skyhanni-3a661521014be1ff856e08243f961f8745571eb2.tar.gz skyhanni-3a661521014be1ff856e08243f961f8745571eb2.tar.bz2 skyhanni-3a661521014be1ff856e08243f961f8745571eb2.zip |
Feature: Item Stack Size Support for secret bingo number (#750)
Added Bingo Goal Rank as stack size in bingo card. #750
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/config/features/inventory/InventoryConfig.java | 1 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt | 13 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/inventory/InventoryConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/inventory/InventoryConfig.java index 0586e9e33..bc333cfb8 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/inventory/InventoryConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/inventory/InventoryConfig.java @@ -87,6 +87,7 @@ public class InventoryConfig { VACUUM_GARDEN("§bVacuum (Garden)", 14), BOTTLE_OF_JYRRE("§bBottle Of Jyrre", 15), EDITION_NUMBER("§bEdition Number", 16), + SECRET_BINGO_DISCOVERY("§bSecret Bingo Discovery"), ; private final String str; diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt index 72506d4ab..f9008713d 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt @@ -19,6 +19,7 @@ import at.hannibal2.skyhanni.config.features.inventory.InventoryConfig.ItemNumbe import at.hannibal2.skyhanni.config.features.inventory.InventoryConfig.ItemNumberEntry.RANCHERS_BOOTS_SPEED import at.hannibal2.skyhanni.config.features.inventory.InventoryConfig.ItemNumberEntry.SKILL_LEVEL import at.hannibal2.skyhanni.config.features.inventory.InventoryConfig.ItemNumberEntry.VACUUM_GARDEN +import at.hannibal2.skyhanni.config.features.inventory.InventoryConfig.ItemNumberEntry.SECRET_BINGO_DISCOVERY import at.hannibal2.skyhanni.events.RenderItemTipEvent import at.hannibal2.skyhanni.features.garden.pests.PestAPI import at.hannibal2.skyhanni.utils.ConfigUtils @@ -30,6 +31,7 @@ import at.hannibal2.skyhanni.utils.ItemUtils.getLore import at.hannibal2.skyhanni.utils.ItemUtils.name import at.hannibal2.skyhanni.utils.LorenzUtils.between import at.hannibal2.skyhanni.utils.NEUInternalName.Companion.asInternalName +import at.hannibal2.skyhanni.utils.NumberUtil import at.hannibal2.skyhanni.utils.NumberUtil.formatNumber import at.hannibal2.skyhanni.utils.NumberUtil.romanToDecimal import at.hannibal2.skyhanni.utils.NumberUtil.romanToDecimalIfNecessary @@ -50,6 +52,7 @@ object ItemDisplayOverlayFeatures { private val gardenVacuumPatterm = "§7Vacuum Bag: §6(?<amount>\\d*) Pests?".toPattern() private val harvestPattern = "§7§7You may harvest §6(?<amount>.).*".toPattern() private val dungeonPotionPattern = "Dungeon (?<level>.*) Potion".toPattern() + private val secretBingoDiscoveryPattern = "(§.)*You were the (§.)*(?<nth>[\\w]+)(?<ordinal>(st|nd|rd|th)) (§.)*to".toPattern() private val bottleOfJyrre = "NEW_BOTTLE_OF_JYRRE".asInternalName() @@ -60,6 +63,7 @@ object ItemDisplayOverlayFeatures { private fun getStackTip(item: ItemStack): String { val itemName = item.cleanName() + val chestName = InventoryUtils.openInventoryName() if (MASTER_STAR_TIER.isSelected()) { when (itemName) { @@ -220,6 +224,15 @@ object ItemDisplayOverlayFeatures { } } + if (SECRET_BINGO_DISCOVERY.isSelected() && chestName == "Bingo Card" && item.getLore().last() == "§aGOAL REACHED") { + for (line in item.getLore()) { + secretBingoDiscoveryPattern.matchMatcher(line) { + val nth = group("nth").formatNumber() + if (nth < 10000) return "${NumberUtil.format(nth)}" + } + } + } + return "" } |