diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-09-16 21:24:33 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-09-16 21:24:33 +0200 |
commit | fe505fc83c2e608e6c30e36568bb6a1f2ecfade0 (patch) | |
tree | 5139bff8987b538f681ccb2c8c8d485bb9454a13 /src | |
parent | e2b9f9d9c556ff54bbe0f3b8009efebefec2f798 (diff) | |
download | skyhanni-fe505fc83c2e608e6c30e36568bb6a1f2ecfade0.tar.gz skyhanni-fe505fc83c2e608e6c30e36568bb6a1f2ecfade0.tar.bz2 skyhanni-fe505fc83c2e608e6c30e36568bb6a1f2ecfade0.zip |
migrate damage indicator config into combat
Diffstat (limited to 'src')
4 files changed, 147 insertions, 132 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/Features.java b/src/main/java/at/hannibal2/skyhanni/config/Features.java index 34e8d76a1..37b6e8331 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/Features.java +++ b/src/main/java/at/hannibal2/skyhanni/config/Features.java @@ -84,8 +84,8 @@ public class Features extends Config { public FishingConfig fishing = new FishingConfig(); @Expose - @Category(name = "Damage Indicator", desc = "Better damage overview in combat with bosses of all sorts.") - public DamageIndicatorConfig damageIndicator = new DamageIndicatorConfig(); + @Category(name = "Combat", desc = "Everything combat and PVE related.") + public CombatConfig combat = new CombatConfig(); @Expose @Category(name = "Slayer", desc = "Slayer features.") diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/CombatConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/CombatConfig.java new file mode 100644 index 000000000..9b90796c4 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/config/features/CombatConfig.java @@ -0,0 +1,137 @@ +package at.hannibal2.skyhanni.config.features; + +import at.hannibal2.skyhanni.config.FeatureToggle; +import com.google.gson.annotations.Expose; +import io.github.moulberry.moulconfig.annotations.*; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +public class CombatConfig { + + @Expose + @ConfigOption(name = "Damage Indicator", desc = "") + @Accordion + public DamageIndicatorConfig damageIndicator = new DamageIndicatorConfig(); + + public static class DamageIndicatorConfig { + + @Expose + @ConfigOption(name = "Damage Indicator Enabled", desc = "Show the boss' remaining health.") + @ConfigEditorBoolean + @FeatureToggle + public boolean enabled = false; + + @Expose + @ConfigOption(name = "Healing Chat Message", desc = "Sends a chat message when a boss heals themself.") + @ConfigEditorBoolean + public boolean healingMessage = false; + + @Expose + @ConfigOption( + name = "Boss Name", + desc = "Change how the boss name should be displayed.") + @ConfigEditorDropdown(values = {"Hidden", "Full Name", "Short Name"}) + public int bossName = 1; + + @Expose + @ConfigOption( + name = "Select Boss", + desc = "Change what type of boss you want the damage indicator be enabled for." + ) + @ConfigEditorDraggableList( + exampleText = { + "§bDungeon All", + "§bNether Mini Bosses", + "§bVanquisher", + "§bEndstone Protector (not tested)", + "§bEnder Dragon (not finished)", + "§bRevenant Horror", + "§bTarantula Broodfather", + "§bSven Packmaster", + "§bVoidgloom Seraph", + "§bInferno Demonlord (only tier 1 yet)", + "§bHeadless Horseman (bugged)", + "§bDungeon Floor 1", + "§bDungeon Floor 2", + "§bDungeon Floor 3", + "§bDungeon Floor 4", + "§bDungeon Floor 5", + "§bDungeon Floor 6", + "§bDungeon Floor 7", + "§bDiana Mobs", + "§bSea Creatures", + "Dummy", + "§bArachne", + "§bThe Rift Bosses", + "§bRiftstalker Bloodfiend", + "§6Reindrake" + } + ) + //TODO only show currently working and tested features + public List<Integer> bossesToShow = new ArrayList<>(Arrays.asList(0, 1, 2, 5, 6, 7, 8, 9, 18, 19, 21, 22, 23, 24)); + + @Expose + @ConfigOption(name = "Hide Damage Splash", desc = "Hiding damage splashes near the damage indicator.") + @ConfigEditorBoolean + public boolean hideDamageSplash = false; + + @Expose + @ConfigOption(name = "Damage Over Time", desc = "Show damage and health over time below the damage indicator.") + @ConfigEditorBoolean + public boolean showDamageOverTime = false; + + @Expose + @ConfigOption(name = "Hide Nametag", desc = "Hide the vanilla nametag of damage indicator bosses.") + @ConfigEditorBoolean + public boolean hideVanillaNametag = false; + + @Expose + @ConfigOption(name = "Time to Kill", desc = "Show the time it takes to kill the slayer boss.") + @ConfigEditorBoolean + public boolean timeToKillSlayer = true; + + + @Expose + @ConfigOption(name = "Ender Slayer", desc = "") + @Accordion + public EnderSlayerConfig enderSlayer = new EnderSlayerConfig(); + + public static class EnderSlayerConfig { + + @Expose + @ConfigOption(name = "Laser phase timer", desc = "Show a timer when the laser phase will end.") + @ConfigEditorBoolean + public boolean laserPhaseTimer = false; + + @Expose + @ConfigOption(name = "Health During Laser", desc = "Show the health of Voidgloom Seraph 4 during the laser phase.") + @ConfigEditorBoolean + public boolean showHealthDuringLaser = false; + } + + @Expose + @ConfigOption(name = "Vampire Slayer", desc = "") + @Accordion + public DamageIndicatorConfig.VampireSlayerConfig vampireSlayer = new DamageIndicatorConfig.VampireSlayerConfig(); + + public static class VampireSlayerConfig { + @Expose + @ConfigOption(name = "HP until Steak", desc = "Show the amount of HP missing until the steak can be used on the Vampire Slayer on top of the boss.") + @ConfigEditorBoolean + public boolean hpTillSteak = false; + + @Expose + @ConfigOption(name = "Mania Circles", desc = "Show a timer until the boss leaves the invincible Mania Circles state.") + @ConfigEditorBoolean + public boolean maniaCircles = false; + + @Expose + @ConfigOption(name = "Percentage HP", desc = "Show the percentage of HP next to the HP.") + @ConfigEditorBoolean + public boolean percentage = false; + } + } + +} diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/DamageIndicatorConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/DamageIndicatorConfig.java deleted file mode 100644 index 210190bac..000000000 --- a/src/main/java/at/hannibal2/skyhanni/config/features/DamageIndicatorConfig.java +++ /dev/null @@ -1,128 +0,0 @@ -package at.hannibal2.skyhanni.config.features; - -import at.hannibal2.skyhanni.config.FeatureToggle; -import com.google.gson.annotations.Expose; -import io.github.moulberry.moulconfig.annotations.*; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -public class DamageIndicatorConfig { - - @Expose - @ConfigOption(name = "Damage Indicator Enabled", desc = "Show the boss' remaining health.") - @ConfigEditorBoolean - @FeatureToggle - public boolean enabled = false; - - @Expose - @ConfigOption(name = "Healing Chat Message", desc = "Sends a chat message when a boss heals themself.") - @ConfigEditorBoolean - public boolean healingMessage = false; - - @Expose - @ConfigOption( - name = "Boss Name", - desc = "Change how the boss name should be displayed.") - @ConfigEditorDropdown(values = {"Hidden", "Full Name", "Short Name"}) - public int bossName = 1; - - @Expose - @ConfigOption( - name = "Select Boss", - desc = "Change what type of boss you want the damage indicator be enabled for." - ) - @ConfigEditorDraggableList( - exampleText = { - "§bDungeon All", - "§bNether Mini Bosses", - "§bVanquisher", - "§bEndstone Protector (not tested)", - "§bEnder Dragon (not finished)", - "§bRevenant Horror", - "§bTarantula Broodfather", - "§bSven Packmaster", - "§bVoidgloom Seraph", - "§bInferno Demonlord (only tier 1 yet)", - "§bHeadless Horseman (bugged)", - "§bDungeon Floor 1", - "§bDungeon Floor 2", - "§bDungeon Floor 3", - "§bDungeon Floor 4", - "§bDungeon Floor 5", - "§bDungeon Floor 6", - "§bDungeon Floor 7", - "§bDiana Mobs", - "§bSea Creatures", - "Dummy", - "§bArachne", - "§bThe Rift Bosses", - "§bRiftstalker Bloodfiend", - "§6Reindrake" - } - ) - //TODO only show currently working and tested features - public List<Integer> bossesToShow = new ArrayList<>(Arrays.asList(0, 1, 2, 5, 6, 7, 8, 9, 18, 19, 21, 22, 23, 24)); - - @Expose - @ConfigOption(name = "Hide Damage Splash", desc = "Hiding damage splashes near the damage indicator.") - @ConfigEditorBoolean - public boolean hideDamageSplash = false; - - @Expose - @ConfigOption(name = "Damage Over Time", desc = "Show damage and health over time below the damage indicator.") - @ConfigEditorBoolean - public boolean showDamageOverTime = false; - - @Expose - @ConfigOption(name = "Hide Nametag", desc = "Hide the vanilla nametag of damage indicator bosses.") - @ConfigEditorBoolean - public boolean hideVanillaNametag = false; - - @Expose - @ConfigOption(name = "Time to Kill", desc = "Show the time it takes to kill the slayer boss.") - @ConfigEditorBoolean - public boolean timeToKillSlayer = true; - - - @Expose - @ConfigOption(name = "Ender Slayer", desc = "") - @Accordion - public EnderSlayerConfig enderSlayer = new EnderSlayerConfig(); - - public static class EnderSlayerConfig { - - @Expose - @ConfigOption(name = "Laser phase timer", desc = "Show a timer when the laser phase will end.") - @ConfigEditorBoolean - public boolean laserPhaseTimer = false; - - @Expose - @ConfigOption(name = "Health During Laser", desc = "Show the health of Voidgloom Seraph 4 during the laser phase.") - @ConfigEditorBoolean - public boolean showHealthDuringLaser = false; - } - - @Expose - @ConfigOption(name = "Vampire Slayer", desc = "") - @Accordion - public DamageIndicatorConfig.VampireSlayerConfig vampireSlayer = new DamageIndicatorConfig.VampireSlayerConfig(); - - public static class VampireSlayerConfig { - @Expose - @ConfigOption(name = "HP until Steak", desc = "Show the amount of HP missing until the steak can be used on the Vampire Slayer on top of the boss.") - @ConfigEditorBoolean - public boolean hpTillSteak = false; - - @Expose - @ConfigOption(name = "Mania Circles", desc = "Show a timer until the boss leaves the invincible Mania Circles state.") - @ConfigEditorBoolean - public boolean maniaCircles = false; - - @Expose - @ConfigOption(name = "Percentage HP", desc = "Show the percentage of HP next to the HP.") - @ConfigEditorBoolean - public boolean percentage = false; - } -} diff --git a/src/main/java/at/hannibal2/skyhanni/features/damageindicator/DamageIndicatorManager.kt b/src/main/java/at/hannibal2/skyhanni/features/damageindicator/DamageIndicatorManager.kt index e27de7249..39a506892 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/damageindicator/DamageIndicatorManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/damageindicator/DamageIndicatorManager.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.damageindicator import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.data.ScoreboardData import at.hannibal2.skyhanni.events.* import at.hannibal2.skyhanni.features.dungeon.DungeonData @@ -40,7 +41,7 @@ class DamageIndicatorManager { private var mobFinder: MobFinder? = null private val maxHealth = mutableMapOf<UUID, Long>() - private val config get() = SkyHanniMod.feature.damageIndicator + private val config get() = SkyHanniMod.feature.combat.damageIndicator companion object { private var data = mapOf<UUID, EntityData>() @@ -661,7 +662,7 @@ class DamageIndicatorManager { health: Int, maxHealth: Int, ): String? { - val config = SkyHanniMod.feature.damageIndicator.vampireSlayer + val config = config.vampireSlayer if (config.percentage) { val percentage = LorenzUtils.formatPercentage(health.toDouble() / maxHealth) @@ -859,5 +860,10 @@ class DamageIndicatorManager { } } + @SubscribeEvent + fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { + event.move(2, "damageIndicator", "combat.damageIndicator") + } + fun isEnabled() = LorenzUtils.inSkyBlock && config.enabled }
\ No newline at end of file |