aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni
diff options
context:
space:
mode:
authorLorenz <lo.scherf@gmail.com>2022-08-17 02:46:05 +0200
committerLorenz <lo.scherf@gmail.com>2022-08-17 02:46:05 +0200
commit5669dbf6f68e7cacb2df6a4e37d703df8635353e (patch)
tree20f20726c9b15c599e83717010e94b48a9128d4a /src/main/java/at/hannibal2/skyhanni
parent26d9f454754a01c7c95cc2a16c28236861b17dc0 (diff)
downloadskyhanni-5669dbf6f68e7cacb2df6a4e37d703df8635353e.tar.gz
skyhanni-5669dbf6f68e7cacb2df6a4e37d703df8635353e.tar.bz2
skyhanni-5669dbf6f68e7cacb2df6a4e37d703df8635353e.zip
separate config category for damage indicator features
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/Features.java4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/DamageIndicator.java71
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/Misc.java76
-rw-r--r--src/main/java/at/hannibal2/skyhanni/damageindicator/DamageIndicatorManager.kt (renamed from src/main/java/at/hannibal2/skyhanni/damageindicator/BossDamageIndicator.kt)16
5 files changed, 88 insertions, 83 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java
index 4ee380890..848d45421 100644
--- a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java
+++ b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java
@@ -9,7 +9,7 @@ import at.hannibal2.skyhanni.chat.NewChatFilter;
import at.hannibal2.skyhanni.chat.PlayerChatFilter;
import at.hannibal2.skyhanni.config.Features;
import at.hannibal2.skyhanni.config.gui.commands.Commands;
-import at.hannibal2.skyhanni.damageindicator.BossDamageIndicator;
+import at.hannibal2.skyhanni.damageindicator.DamageIndicatorManager;
import at.hannibal2.skyhanni.dungeon.*;
import at.hannibal2.skyhanni.fishing.SeaCreatureManager;
import at.hannibal2.skyhanni.fishing.SeaCreatureMessageShortener;
@@ -73,7 +73,7 @@ public class SkyHanniMod {
registerEvent(new ItemDisplayOverlayFeatures());
registerEvent(new CurrentPetDisplay());
registerEvent(new ExpBottleOnGroundHider());
- registerEvent(new BossDamageIndicator());
+ registerEvent(new DamageIndicatorManager());
registerEvent(new ItemAbilityCooldown());
registerEvent(new DungeonMilestoneDisplay());
registerEvent(new DungeonDeathCounter());
diff --git a/src/main/java/at/hannibal2/skyhanni/config/Features.java b/src/main/java/at/hannibal2/skyhanni/config/Features.java
index 833cb8123..494acd36c 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/Features.java
+++ b/src/main/java/at/hannibal2/skyhanni/config/Features.java
@@ -88,6 +88,10 @@ public class Features {
public Fishing fishing = new Fishing();
@Expose
+ @Category(name = "Damage Indicator", desc = "Better damage overview in combat with bosses of all sorts.")
+ public DamageIndicator damageIndicator = new DamageIndicator();
+
+ @Expose
@Category(name = "Misc", desc = "Settings without a category.")
public Misc misc = new Misc();
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/DamageIndicator.java b/src/main/java/at/hannibal2/skyhanni/config/features/DamageIndicator.java
new file mode 100644
index 000000000..0adef7865
--- /dev/null
+++ b/src/main/java/at/hannibal2/skyhanni/config/features/DamageIndicator.java
@@ -0,0 +1,71 @@
+package at.hannibal2.skyhanni.config.features;
+
+import at.hannibal2.skyhanni.config.gui.core.config.annotations.ConfigEditorBoolean;
+import at.hannibal2.skyhanni.config.gui.core.config.annotations.ConfigEditorDraggableList;
+import at.hannibal2.skyhanni.config.gui.core.config.annotations.ConfigEditorDropdown;
+import at.hannibal2.skyhanni.config.gui.core.config.annotations.ConfigOption;
+import com.google.gson.annotations.Expose;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+public class DamageIndicator {
+
+ @Expose
+ @ConfigOption(name = "Enabled", desc = "Show the missing health of a boss.")
+ @ConfigEditorBoolean
+ public boolean enabled = false;
+
+ @Expose
+ @ConfigOption(name = "Healing Chat Message", desc = "Sends a chat message when a boss heals himself.")
+ @ConfigEditorBoolean
+ public boolean healingMessage = false;
+
+ @Expose
+ @ConfigOption(
+ name = "Boss Name",
+ desc = "Change how the boss name should be displayed")
+ @ConfigEditorDropdown(values = {"Disabled", "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 = {
+ "\u00a7bDungeon All",
+ "\u00a7bNether Mini Bosses",
+ "\u00a7bVanquisher",
+ "\u00a7bEndstone Protector (not tested)",
+ "\u00a7bEnder Dragon (not finished)",
+ "\u00a7bRevenant Horror",
+ "\u00a7bTarantula Broodfather",
+ "\u00a7bSven Packmaster",
+ "\u00a7bVoidgloom Seraph",
+ "\u00a7bInferno Demonlord (only tier 1 yet)",
+ "\u00a7bHeadless Horseman (bugged)",
+ "\u00a7bDungeon Floor 1",
+ "\u00a7bDungeon Floor 2",
+ "\u00a7bDungeon Floor 3",
+ "\u00a7bDungeon Floor 4",
+ "\u00a7bDungeon Floor 5",
+ "\u00a7bDungeon Floor 6",
+ "\u00a7bDungeon Floor 7"
+ }
+ )
+ //TODO only show currently working and tested features
+ public List<Integer> bossesToShow = new ArrayList<>(Arrays.asList(0, 1, 2, 5, 6, 7, 8, 9));
+
+ @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;
+}
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 5362db7fa..23487a20d 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/features/Misc.java
+++ b/src/main/java/at/hannibal2/skyhanni/config/features/Misc.java
@@ -1,84 +1,14 @@
package at.hannibal2.skyhanni.config.features;
import at.hannibal2.skyhanni.config.gui.core.config.Position;
-import at.hannibal2.skyhanni.config.gui.core.config.annotations.*;
+import at.hannibal2.skyhanni.config.gui.core.config.annotations.ConfigEditorBoolean;
+import at.hannibal2.skyhanni.config.gui.core.config.annotations.ConfigEditorButton;
+import at.hannibal2.skyhanni.config.gui.core.config.annotations.ConfigOption;
import com.google.gson.annotations.Expose;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
public class Misc {
@Expose
- @ConfigOption(name = "Damage Indicator", desc = "")
- @ConfigEditorAccordion(id = 1)
- public boolean damageIndicatorInternal = false;
-
- @Expose
- @ConfigOption(name = "Enabled", desc = "Show the missing health of a boss.")
- @ConfigEditorBoolean
- @ConfigAccordionId(id = 1)
- public boolean damageIndicator = false;
-
- @Expose
- @ConfigOption(name = "Healing Chat Message", desc = "Sends a chat message when a boss heals himself.")
- @ConfigEditorBoolean
- @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 = 1;
-
- @Expose
- @ConfigOption(
- name = "Select Boss",
- desc = "Change what type of boss you want the damage indicator be enabled for."
- )
- @ConfigEditorDraggableList(
- exampleText = {
- "\u00a7bDungeon All",
- "\u00a7bNether Mini Bosses",
- "\u00a7bVanquisher",
- "\u00a7bEndstone Protector (not tested)",
- "\u00a7bEnder Dragon (not finished)",
- "\u00a7bRevenant Horror",
- "\u00a7bTarantula Broodfather",
- "\u00a7bSven Packmaster",
- "\u00a7bVoidgloom Seraph",
- "\u00a7bInferno Demonlord (only tier 1 yet)",
- "\u00a7bHeadless Horseman (bugged)",
- "\u00a7bDungeon Floor 1",
- "\u00a7bDungeon Floor 2",
- "\u00a7bDungeon Floor 3",
- "\u00a7bDungeon Floor 4",
- "\u00a7bDungeon Floor 5",
- "\u00a7bDungeon Floor 6",
- "\u00a7bDungeon Floor 7"
- }
- )
- @ConfigAccordionId(id = 1)
- //TODO only show currently working and tested features
- public List<Integer> damageIndicatorBossesToShow = new ArrayList<>(Arrays.asList(0, 1, 2, 5, 6, 7, 8, 9));
-
- @Expose
- @ConfigOption(name = "Hide Damage Splash", desc = "Hiding damage splashes near the damage indicator")
- @ConfigEditorBoolean
- @ConfigAccordionId(id = 1)
- public boolean damageIndicatorHideDamageSplash = false;
-
- @Expose
- @ConfigOption(name = "Damage Over Time", desc = "Show damage and health over time below the damage indicator")
- @ConfigEditorBoolean
- @ConfigAccordionId(id = 1)
- public boolean damageIndicatorShowDamageOverTime = false;
-
- @Expose
@ConfigOption(name = "Pet Display", desc = "Show the currently active pet.")
@ConfigEditorBoolean
public boolean petDisplay = false;
diff --git a/src/main/java/at/hannibal2/skyhanni/damageindicator/BossDamageIndicator.kt b/src/main/java/at/hannibal2/skyhanni/damageindicator/DamageIndicatorManager.kt
index 38a415f03..fa7dbb530 100644
--- a/src/main/java/at/hannibal2/skyhanni/damageindicator/BossDamageIndicator.kt
+++ b/src/main/java/at/hannibal2/skyhanni/damageindicator/DamageIndicatorManager.kt
@@ -30,7 +30,7 @@ import java.util.*
import java.util.regex.Pattern
import kotlin.math.max
-class BossDamageIndicator {
+class DamageIndicatorManager {
var data = mutableMapOf<UUID, EntityData>()
private var bossFinder: BossFinder? = null
@@ -51,7 +51,7 @@ class BossDamageIndicator {
@SubscribeEvent
fun onWorldRender(event: RenderWorldLastEvent) {
- if (!SkyHanniMod.feature.misc.damageIndicator) return
+ if (!SkyHanniMod.feature.damageIndicator.enabled) return
GlStateManager.disableDepth()
GlStateManager.disableCull()
@@ -69,7 +69,7 @@ class BossDamageIndicator {
if (!data.ignoreBlocks) {
if (!player.canEntityBeSeen(data.entity)) continue
}
- if (data.bossType.bossTypeToggle !in SkyHanniMod.feature.misc.damageIndicatorBossesToShow) continue
+ if (data.bossType.bossTypeToggle !in SkyHanniMod.feature.damageIndicator.bossesToShow) continue
val entity = data.entity
@@ -100,7 +100,7 @@ class BossDamageIndicator {
RenderUtils.drawLabel(location, healthText, partialTicks, true, 6f)
}
- var bossName = when (SkyHanniMod.feature.misc.damageIndicatorBossName) {
+ var bossName = when (SkyHanniMod.feature.damageIndicator.bossName) {
0 -> ""
1 -> data.bossType.fullName
2 -> data.bossType.shortName
@@ -116,7 +116,7 @@ class BossDamageIndicator {
RenderUtils.drawLabel(location, bossName, partialTicks, true, 3.9f, -9.0f)
- if (SkyHanniMod.feature.misc.damageIndicatorShowDamageOverTime) {
+ if (SkyHanniMod.feature.damageIndicator.showDamageOverTime) {
var diff = 13f
val currentDamage = data.damageCounter.currentDamage
val currentHealing = data.damageCounter.currentHealing
@@ -414,7 +414,7 @@ class BossDamageIndicator {
if (data.containsKey(entity.uniqueID)) {
val lastHealth = data[entity.uniqueID]!!.lastHealth
val bossType = entityData.bossType
- if (SkyHanniMod.feature.misc.damageIndicatorHealingMessage) {
+ if (SkyHanniMod.feature.damageIndicator.healingMessage) {
checkHealed(health, lastHealth, bossType)
}
checkDamage(entityData, health, lastHealth, bossType)
@@ -478,7 +478,7 @@ class BossDamageIndicator {
val healedFormat = NumberUtil.format(healed)
- val bossName = when (SkyHanniMod.feature.misc.damageIndicatorBossName) {
+ val bossName = when (SkyHanniMod.feature.damageIndicator.bossName) {
2 -> bossType.shortName
else -> bossType.fullName
}
@@ -522,7 +522,7 @@ class BossDamageIndicator {
@SubscribeEvent(priority = EventPriority.HIGHEST)
fun onRenderLiving(e: RenderLivingEvent.Specials.Pre<EntityLivingBase>) {
- if (!SkyHanniMod.feature.misc.damageIndicatorHideDamageSplash) return
+ if (!SkyHanniMod.feature.damageIndicator.hideDamageSplash) return
val entity = e.entity
if (entity.ticksExisted > 300 || entity !is EntityArmorStand) return