From 6cc2646eaaec81581ec4914f3a656578323ead28 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Tue, 21 Feb 2023 14:41:53 +0100 Subject: Added skill and collection level as item stack. --- .../skyhanni/config/features/Inventory.java | 8 +++--- .../inventory/ItemDisplayOverlayFeatures.kt | 30 +++++++++++++++++++++- 2 files changed, 34 insertions(+), 4 deletions(-) (limited to 'src/main') diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/Inventory.java b/src/main/java/at/hannibal2/skyhanni/config/features/Inventory.java index d1a42c252..f4df59580 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/Inventory.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/Inventory.java @@ -4,7 +4,7 @@ import at.hannibal2.skyhanni.config.core.config.annotations.*; import com.google.gson.annotations.Expose; import java.util.ArrayList; -import java.util.Collections; +import java.util.Arrays; import java.util.List; public class Inventory { @@ -103,10 +103,12 @@ public class Inventory { "§bMinion Tier", "§bCrimson Armor", "§bWishing Compass", - "§bKuudra Key" + "§bKuudra Key", + "§bSkill Level", + "§bCollection Level" } ) - public List itemNumberAsStackSize = new ArrayList<>(Collections.singletonList(3)); + public List itemNumberAsStackSize = new ArrayList<>(Arrays.asList(3, 9)); @Expose @ConfigOption(name = "Sack Name", desc = "Show an abbreviation of the Sack name.") 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 a8825354b..2fe34d105 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt @@ -6,8 +6,10 @@ import at.hannibal2.skyhanni.utils.InventoryUtils import at.hannibal2.skyhanni.utils.ItemUtils import at.hannibal2.skyhanni.utils.ItemUtils.cleanName 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.NumberUtil.romanToDecimal +import at.hannibal2.skyhanni.utils.NumberUtil.romanToDecimalIfNeeded import at.hannibal2.skyhanni.utils.StringUtils.matchRegex import net.minecraft.item.ItemStack import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @@ -104,7 +106,7 @@ class ItemDisplayOverlayFeatures { } } - if (SkyHanniMod.feature.inventory.itemNumberAsStackSize.contains(7)) { + if (SkyHanniMod.feature.inventory.itemNumberAsStackSize.contains(8)) { if (name.contains("Kuudra Key")) { return when (name) { "Kuudra Key" -> "§a1" @@ -116,6 +118,32 @@ class ItemDisplayOverlayFeatures { } } } + + if (SkyHanniMod.feature.inventory.itemNumberAsStackSize.contains(9)) { + if (InventoryUtils.openInventoryName() == "Your Skills") { + if (item.getLore().any { it.contains("Click to view!") }) { + item.name?.let { + if (!it.contains("Dungeon")) { + val text = it.split(" ").last() + return "" + text.romanToDecimalIfNeeded() + } + } + } + } + } + + if (SkyHanniMod.feature.inventory.itemNumberAsStackSize.contains(10)) { + if (InventoryUtils.openInventoryName().endsWith(" Collections")) { + if (item.getLore().any { it.contains("Click to view!") }) { + item.name?.let { + if (it.startsWith("§e")) { + val text = it.split(" ").last() + return "" + text.romanToDecimalIfNeeded() + } + } + } + } + } return "" } -- cgit