From 4bafa3e55ea80c25165bb94704a554b2f3cf4410 Mon Sep 17 00:00:00 2001 From: Lorenz Date: Mon, 15 Aug 2022 13:11:14 +0200 Subject: add support to hide boss name and option to only show shrt name --- .../hannibal2/skyhanni/config/features/Misc.java | 8 ++++++++ .../damageindicator/BossDamageIndicator.kt | 23 +++++++++++++++++----- .../hannibal2/skyhanni/damageindicator/BossType.kt | 6 +++--- 3 files changed, 29 insertions(+), 8 deletions(-) (limited to 'src/main/java/at') diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/Misc.java b/src/main/java/at/hannibal2/skyhanni/config/features/Misc.java index 5328ba1c1..2baf33fff 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/Misc.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/Misc.java @@ -23,6 +23,14 @@ public class Misc { @ConfigAccordionId(id = 1) public boolean damageIndicatorHealingMessage = false; + @Expose + @ConfigOption( + name = "Boss Name", + desc = "Change how the boss name should be displayed") + @ConfigEditorDropdown(values = {"Disabled", "Full Name", "Short Name"}) + @ConfigAccordionId(id = 1) + public int damageIndicatorBossName = 0; + @Expose @ConfigOption(name = "Pet Display", desc = "Show the currently active pet.") @ConfigEditorBoolean diff --git a/src/main/java/at/hannibal2/skyhanni/damageindicator/BossDamageIndicator.kt b/src/main/java/at/hannibal2/skyhanni/damageindicator/BossDamageIndicator.kt index 85996919b..f63b7c6cf 100644 --- a/src/main/java/at/hannibal2/skyhanni/damageindicator/BossDamageIndicator.kt +++ b/src/main/java/at/hannibal2/skyhanni/damageindicator/BossDamageIndicator.kt @@ -88,7 +88,13 @@ class BossDamageIndicator { 6f ) - var bossName = data.bossType.bossName + var bossName = when (SkyHanniMod.feature.misc.damageIndicatorBossName) { + 0 -> "" + 1 -> data.bossType.fullName + 2 -> data.bossType.shortName + else -> data.bossType.fullName + } + if (data.namePrefix.isNotEmpty()) { bossName = data.namePrefix + bossName } @@ -328,14 +334,21 @@ class BossDamageIndicator { val healed = health - lastHealth if (healed <= 0) return - //Hide auto heal every 10 ticks - if (healed == 15_000 && bossType == BossType.HUB_REVENANT_HORROR) return + //Hide auto heal every 10 ticks (with rounding errors) + if ((healed == 15_000 || healed == 15_001) && bossType == BossType.HUB_REVENANT_HORROR) return val formatLastHealth = NumberUtil.format(lastHealth) val formatHealth = NumberUtil.format(health) val healedFormat = NumberUtil.format(healed) - println(bossType.bossName + " §fhealed for $healed❤ ($lastHealth -> $health)") - LorenzUtils.chat(bossType.bossName + " §ehealed for §a$healedFormat❤ §8(§e$formatLastHealth -> $formatHealth§8)") + + + val bossName = when (SkyHanniMod.feature.misc.damageIndicatorBossName) { + 2 -> bossType.shortName + else -> bossType.fullName + } + + println(bossName + " §healed for $healed❤ ($lastHealth -> $health)") + LorenzUtils.chat("$bossName §ehealed for §a$healedFormat❤ §8(§e$formatLastHealth -> $formatHealth§8)") } private fun grabData(entity: EntityLivingBase): EntityData? { diff --git a/src/main/java/at/hannibal2/skyhanni/damageindicator/BossType.kt b/src/main/java/at/hannibal2/skyhanni/damageindicator/BossType.kt index a913bbf4b..763bb3056 100644 --- a/src/main/java/at/hannibal2/skyhanni/damageindicator/BossType.kt +++ b/src/main/java/at/hannibal2/skyhanni/damageindicator/BossType.kt @@ -1,7 +1,7 @@ package at.hannibal2.skyhanni.damageindicator -enum class BossType(val bossName: String) { - DUNGEON("Generic Dungeon boss"),//TODO split in different bosses +enum class BossType(val fullName: String, val shortName: String = fullName) { + DUNGEON("Generic Dungeon boss"),//TODO split into different bosses NETHER_BLADESOUL("§8Bladesoul"), NETHER_MAGMA_BOSS("§4Magma Boss"), @@ -15,6 +15,6 @@ enum class BossType(val bossName: String) { END_ENDERMAN_SLAYER("Voidgloom Seraph"),//TODO use seperate enums per tier END_ENDER_DRAGON("Ender Dragon"),//TODO fix totally - HUB_REVENANT_HORROR("§5Revenant Horror 5"),//TODO add other variants like voidgloom? + HUB_REVENANT_HORROR("§5Revenant Horror 5", "§5Rev 5"),//TODO add other variants like voidgloom? HUB_HEADLESS_HORSEMAN("§6Headless Horseman"), } \ No newline at end of file -- cgit