From af44ac4f47acc6c7c27b4d5a165083a002406303 Mon Sep 17 00:00:00 2001 From: saga Date: Mon, 3 Jun 2024 12:51:38 -0300 Subject: [PATCH 1/3] stack size exp enchanting stack size --- .../config/features/inventory/InventoryConfig.java | 1 + .../features/inventory/ItemDisplayOverlayFeatures.kt | 12 ++++++++++++ 2 files changed, 13 insertions(+) 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 872fb8ad6ba1..144af82b04da 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 @@ -129,6 +129,7 @@ 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"), BINGO_GOAL_RANK("§bBingo Goal Rank"), ; 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 9d1df7abdd6a..670e4baf60b3 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt @@ -5,6 +5,7 @@ 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.ENCHANTING_EXP 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 @@ -81,6 +82,10 @@ object ItemDisplayOverlayFeatures { "bingogoalrank", "(§.)*You were the (§.)*(?[\\w]+)(?(st|nd|rd|th)) (§.)*to" ) + private val enchantingExpPattern by patternGroup.pattern( + "enchantingexp", + "(?[0-9]+)k Enchanting Exp" + ) @SubscribeEvent fun onRenderItemTip(event: RenderItemTipEvent) { @@ -265,6 +270,13 @@ object ItemDisplayOverlayFeatures { } } + if (ENCHANTING_EXP.isSelected() && chestName.startsWith("Superpairs")) { + enchantingExpPattern.matchMatcher(item.cleanName()) { + val exp = group("exp").formatLong() + return "§b${NumberUtil.format(exp)}" + } + } + return null } From 1f01ad1c9e480d96c99b55dfeea5f00cd077b182 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Mon, 26 Aug 2024 11:30:28 +0200 Subject: [PATCH 2/3] formatting --- .../config/features/inventory/InventoryConfig.java | 2 +- .../features/inventory/ItemDisplayOverlayFeatures.kt | 10 +++++----- 2 files changed, 6 insertions(+), 6 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 0133843ec48a..80be3f327c3f 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 @@ -149,7 +149,7 @@ public enum ItemNumberEntry implements HasLegacyId { ENCHANTING_EXP("§bEnchanting EXP"), BINGO_GOAL_RANK("§bBingo Goal Rank"), SKYBLOCK_LEVEL("§bSkyblock Level"), - BESTIARY_LEVEL("§bBestiary Level") + BESTIARY_LEVEL("§bBestiary Level"), ; 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 2ae649a2f4d5..033f047a2e98 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt @@ -5,7 +5,7 @@ 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.ENCHANTING_EXP +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 @@ -13,6 +13,7 @@ import at.hannibal2.skyhanni.config.features.inventory.InventoryConfig.ItemNumbe 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 @@ -24,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 @@ -97,11 +97,11 @@ object ItemDisplayOverlayFeatures { ) private val bestiaryStackPattern by patternGroup.pattern( "bestiarystack", - "§7Progress to Tier (?[\\dIVXC]+): §b[\\d.]+%" + "§7Progress to Tier (?[\\dIVXC]+): §b[\\d.]+%", ) private val enchantingExpPattern by patternGroup.pattern( "enchantingexp", - "(?[0-9]+)k Enchanting Exp" + "(?[0-9]+)k Enchanting Exp", ) @SubscribeEvent @@ -307,7 +307,7 @@ object ItemDisplayOverlayFeatures { if (ENCHANTING_EXP.isSelected() && chestName.startsWith("Superpairs")) { enchantingExpPattern.matchMatcher(item.cleanName()) { val exp = group("exp").formatLong() - return "§b${NumberUtil.format(exp)}" + return "§b${exp.shortFormat()}" } } From 9ce7929ebdb854e386c824cd214da71a5014e36d Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Mon, 26 Aug 2024 11:38:15 +0200 Subject: [PATCH 3/3] formatting and fixed bug with comma --- .../config/features/inventory/InventoryConfig.java | 2 +- .../features/inventory/ItemDisplayOverlayFeatures.kt | 7 ++++++- 2 files changed, 7 insertions(+), 2 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 80be3f327c3f..e7609135eeb0 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 @@ -146,7 +146,7 @@ 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"), + ENCHANTING_EXP("§bEnchanting EXP (Superpairs)"), BINGO_GOAL_RANK("§bBingo Goal Rank"), SKYBLOCK_LEVEL("§bSkyblock Level"), BESTIARY_LEVEL("§bBestiary Level"), 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 033f047a2e98..43448f8d8a76 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt @@ -99,9 +99,14 @@ object ItemDisplayOverlayFeatures { "bestiarystack", "§7Progress to Tier (?[\\dIVXC]+): §b[\\d.]+%", ) + + /** + * REGEX-TEST: 5k Enchanting Exp + * REGEX-TEST: 5.5k Enchanting Exp + */ private val enchantingExpPattern by patternGroup.pattern( "enchantingexp", - "(?[0-9]+)k Enchanting Exp", + "(?.*)k Enchanting Exp", ) @SubscribeEvent