Skip to content

Commit

Permalink
Feature: Exp in Superpairs as Stack Size. (#1988)
Browse files Browse the repository at this point in the history
Co-authored-by: Cal <cwolfson58@gmail.com>
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
  • Loading branch information
3 people authored Aug 26, 2024
1 parent 81e8c4c commit 085fdbe
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,10 @@ public enum ItemNumberEntry implements HasLegacyId {
BOTTLE_OF_JYRRE("§bBottle Of Jyrre", 15),
DARK_CACAO_TRUFFLE("§bDark Cacao Truffle"),
EDITION_NUMBER("§bEdition Number", 16),
ENCHANTING_EXP("§bEnchanting EXP (Superpairs)"),
BINGO_GOAL_RANK("§bBingo Goal Rank"),
SKYBLOCK_LEVEL("§bSkyblock Level"),
BESTIARY_LEVEL("§bBestiary Level")
BESTIARY_LEVEL("§bBestiary Level"),
;

private final String str;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ import at.hannibal2.skyhanni.api.CollectionAPI
import at.hannibal2.skyhanni.api.SkillAPI
import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator
import at.hannibal2.skyhanni.config.features.inventory.InventoryConfig.ItemNumberEntry
import at.hannibal2.skyhanni.config.features.inventory.InventoryConfig.ItemNumberEntry.BESTIARY_LEVEL
import at.hannibal2.skyhanni.config.features.inventory.InventoryConfig.ItemNumberEntry.BINGO_GOAL_RANK
import at.hannibal2.skyhanni.config.features.inventory.InventoryConfig.ItemNumberEntry.BOTTLE_OF_JYRRE
import at.hannibal2.skyhanni.config.features.inventory.InventoryConfig.ItemNumberEntry.COLLECTION_LEVEL
import at.hannibal2.skyhanni.config.features.inventory.InventoryConfig.ItemNumberEntry.DARK_CACAO_TRUFFLE
import at.hannibal2.skyhanni.config.features.inventory.InventoryConfig.ItemNumberEntry.DUNGEON_HEAD_FLOOR_NUMBER
import at.hannibal2.skyhanni.config.features.inventory.InventoryConfig.ItemNumberEntry.DUNGEON_POTION_LEVEL
import at.hannibal2.skyhanni.config.features.inventory.InventoryConfig.ItemNumberEntry.EDITION_NUMBER
import at.hannibal2.skyhanni.config.features.inventory.InventoryConfig.ItemNumberEntry.ENCHANTING_EXP
import at.hannibal2.skyhanni.config.features.inventory.InventoryConfig.ItemNumberEntry.KUUDRA_KEY
import at.hannibal2.skyhanni.config.features.inventory.InventoryConfig.ItemNumberEntry.LARVA_HOOK
import at.hannibal2.skyhanni.config.features.inventory.InventoryConfig.ItemNumberEntry.MASTER_SKULL_TIER
Expand All @@ -23,7 +25,6 @@ import at.hannibal2.skyhanni.config.features.inventory.InventoryConfig.ItemNumbe
import at.hannibal2.skyhanni.config.features.inventory.InventoryConfig.ItemNumberEntry.SKILL_LEVEL
import at.hannibal2.skyhanni.config.features.inventory.InventoryConfig.ItemNumberEntry.SKYBLOCK_LEVEL
import at.hannibal2.skyhanni.config.features.inventory.InventoryConfig.ItemNumberEntry.VACUUM_GARDEN
import at.hannibal2.skyhanni.config.features.inventory.InventoryConfig.ItemNumberEntry.BESTIARY_LEVEL
import at.hannibal2.skyhanni.data.PetAPI
import at.hannibal2.skyhanni.events.RenderItemTipEvent
import at.hannibal2.skyhanni.features.garden.GardenAPI
Expand Down Expand Up @@ -96,7 +97,16 @@ object ItemDisplayOverlayFeatures {
)
private val bestiaryStackPattern by patternGroup.pattern(
"bestiarystack",
"§7Progress to Tier (?<tier>[\\dIVXC]+): §b[\\d.]+%"
"§7Progress to Tier (?<tier>[\\dIVXC]+): §b[\\d.]+%",
)

/**
* REGEX-TEST: 5k Enchanting Exp
* REGEX-TEST: 5.5k Enchanting Exp
*/
private val enchantingExpPattern by patternGroup.pattern(
"enchantingexp",
"(?<exp>.*)k Enchanting Exp",
)

@SubscribeEvent
Expand Down Expand Up @@ -299,6 +309,13 @@ object ItemDisplayOverlayFeatures {
}
}

if (ENCHANTING_EXP.isSelected() && chestName.startsWith("Superpairs")) {
enchantingExpPattern.matchMatcher(item.cleanName()) {
val exp = group("exp").formatLong()
return "§b${exp.shortFormat()}"
}
}

return null
}

Expand Down

0 comments on commit 085fdbe

Please sign in to comment.