From 52632ca22713af81d67cbe30a1e306d3fbe19ebb Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Fri, 8 Sep 2023 12:40:20 +0200 Subject: Highlight the level 100 text in gold for pets below legendary to better indicate that the pet exp bar in the item tooltip is calculating with legendary. --- .../java/at/hannibal2/skyhanni/features/misc/PetExpTooltip.kt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/PetExpTooltip.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/PetExpTooltip.kt index 3ba76f238..5abc467a1 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/PetExpTooltip.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/PetExpTooltip.kt @@ -1,15 +1,13 @@ package at.hannibal2.skyhanni.features.misc import at.hannibal2.skyhanni.SkyHanniMod -import at.hannibal2.skyhanni.utils.ItemUtils +import at.hannibal2.skyhanni.utils.* +import at.hannibal2.skyhanni.utils.ItemUtils.getItemRarity import at.hannibal2.skyhanni.utils.ItemUtils.name -import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.LorenzUtils.indexOfFirst import at.hannibal2.skyhanni.utils.LorenzUtils.round -import at.hannibal2.skyhanni.utils.NumberUtil import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getPetExp -import at.hannibal2.skyhanni.utils.StringUtils import net.minecraftforge.event.entity.player.ItemTooltipEvent import net.minecraftforge.fml.common.eventhandler.EventPriority import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @@ -44,8 +42,10 @@ class PetExpTooltip { event.toolTip.add(index, "§7Total experience: §e${NumberUtil.format(petExperience)}") } else { val progressBar = StringUtils.progressBar(percentage) + val isBelowLEgendary = itemStack.getItemRarity() < LorenzRarity.LEGENDARY + val addLegendaryColor = if (isBelowLEgendary) "§6" else "" event.toolTip.add(index, "$progressBar §e${petExperience.addSeparators()}§6/§e${NumberUtil.format(maxXp)}") - event.toolTip.add(index, "§7Progress to Level $maxLevel: §e$percentageFormat") + event.toolTip.add(index, "§7Progress to ${addLegendaryColor}Level $maxLevel: §e$percentageFormat") } } -- cgit