diff options
author | Conutik <60240193+Conutik@users.noreply.github.com> | 2024-03-10 23:19:41 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-10 21:19:41 +0100 |
commit | de2cd8b5cb0020471e3120a5dac4e8bbd9b3150b (patch) | |
tree | 5b93d1d9e891601646557f8f99bf5edfaa4383e9 /src/main/java/at | |
parent | 33dc30ea4ee00afd97d28b5dbffc3f5f57d2473f (diff) | |
download | skyhanni-de2cd8b5cb0020471e3120a5dac4e8bbd9b3150b.tar.gz skyhanni-de2cd8b5cb0020471e3120a5dac4e8bbd9b3150b.tar.bz2 skyhanni-de2cd8b5cb0020471e3120a5dac4e8bbd9b3150b.zip |
Feature: Show available/missing classes (#1111)
Co-authored-by: calwolfson <cwolfson58@gmail.com>
Diffstat (limited to 'src/main/java/at')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/config/features/dungeon/PartyFinderConfig.java | 6 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonFinderFeatures.kt | 11 |
2 files changed, 15 insertions, 2 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/dungeon/PartyFinderConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/dungeon/PartyFinderConfig.java index 17c0ab6ad..b46baf31e 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/dungeon/PartyFinderConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/dungeon/PartyFinderConfig.java @@ -47,4 +47,10 @@ public class PartyFinderConfig { @ConfigEditorBoolean @FeatureToggle public boolean markMissingClass = true; + + @Expose + @ConfigOption(name = "Show Missing Classes", desc = "Show missing classes in a party in the tooltip.") + @ConfigEditorBoolean + @FeatureToggle + public boolean showMissingClasses = true; } diff --git a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonFinderFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonFinderFeatures.kt index 9c352a459..05104ce8a 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonFinderFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonFinderFeatures.kt @@ -14,6 +14,7 @@ import at.hannibal2.skyhanni.utils.LorenzColor import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.NumberUtil.romanToDecimalIfNecessary import at.hannibal2.skyhanni.utils.RenderUtils.highlight +import at.hannibal2.skyhanni.utils.StringUtils.createCommaSeparatedList import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher import at.hannibal2.skyhanni.utils.StringUtils.removeColor import net.minecraft.client.gui.inventory.GuiChest @@ -148,22 +149,28 @@ class DungeonFinderFeatures { @SubscribeEvent fun onItemTooltip(event: LorenzToolTipEvent) { if (!LorenzUtils.inSkyBlock) return - if (!config.coloredClassLevel) return val chestName = InventoryUtils.openInventoryName() if (chestName != "Party Finder") return val stack = event.itemStack + val classNames = mutableListOf("Healer", "Mage", "Berserk", "Archer", "Tank") for ((index, line) in stack.getLore().withIndex()) { classLevelPattern.matchMatcher(line) { val playerName = group("playerName") val className = group("className") val level = group("level").toInt() val color = getColor(level) - event.toolTip[index + 1] = " §b$playerName§f: §e$className $color$level" + if (config.coloredClassLevel) event.toolTip[index + 1] = " §b$playerName§f: §e$className $color$level" + classNames.remove(className) } } + if (!config.showMissingClasses) return + if (!stack.getLore()[0].removeColor().startsWith("Dungeon:")) return + if (classNames.contains(selectedClass)) classNames[classNames.indexOf(selectedClass)] = "§a${selectedClass}§7" + event.toolTip.add("") + event.toolTip.add("§cMissing: §7" + createCommaSeparatedList(classNames)) } @SubscribeEvent |