aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorObsidian <108832807+Obsidianninja11@users.noreply.github.com>2023-12-13 15:20:14 -0900
committerGitHub <noreply@github.com>2023-12-14 01:20:14 +0100
commitdb34c26f1838a06f0516e2a57c61964f64f1f758 (patch)
tree05a41492008b2280858a70311ab26de41c7ac7da /src/main/java
parent825900c07e1a498b6dc852f4d44303394a908bf2 (diff)
downloadskyhanni-db34c26f1838a06f0516e2a57c61964f64f1f758.tar.gz
skyhanni-db34c26f1838a06f0516e2a57c61964f64f1f758.tar.bz2
skyhanni-db34c26f1838a06f0516e2a57c61964f64f1f758.zip
Option to not show cooldown when ability is ready (#691)
Added an option to not show cooldown when ability is ready. #691
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/itemability/ItemAbilityConfig.java5
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/itemabilities/abilitycooldown/ItemAbilityCooldown.kt10
2 files changed, 10 insertions, 5 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/itemability/ItemAbilityConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/itemability/ItemAbilityConfig.java
index a53075016..dabb0d535 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/features/itemability/ItemAbilityConfig.java
+++ b/src/main/java/at/hannibal2/skyhanni/config/features/itemability/ItemAbilityConfig.java
@@ -20,6 +20,11 @@ public class ItemAbilityConfig {
public boolean itemAbilityCooldownBackground = false;
@Expose
+ @ConfigOption(name = "Show When Ready", desc = "Show the R and background (if enabled) when the ability is ready.")
+ @ConfigEditorBoolean
+ public boolean itemAbilityShowWhenReady = true;
+
+ @Expose
@ConfigOption(name = "Fire Veil", desc = "")
@Accordion
public FireVeilWandConfig fireVeilWands = new FireVeilWandConfig();
diff --git a/src/main/java/at/hannibal2/skyhanni/features/itemabilities/abilitycooldown/ItemAbilityCooldown.kt b/src/main/java/at/hannibal2/skyhanni/features/itemabilities/abilitycooldown/ItemAbilityCooldown.kt
index a547c14b4..dd1c1fedf 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/itemabilities/abilitycooldown/ItemAbilityCooldown.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/itemabilities/abilitycooldown/ItemAbilityCooldown.kt
@@ -242,11 +242,10 @@ class ItemAbilityCooldown {
private fun createItemText(ability: ItemAbility): ItemText {
val specialColor = ability.specialColor
+ val readyText = if (SkyHanniMod.feature.itemAbilities.itemAbilityShowWhenReady) "R" else ""
return if (ability.isOnCooldown()) {
- val duration: Long =
- ability.lastActivation + ability.getCooldown() - System.currentTimeMillis()
- val color =
- specialColor ?: if (duration < 600) LorenzColor.RED else LorenzColor.YELLOW
+ val duration: Long = ability.lastActivation + ability.getCooldown() - System.currentTimeMillis()
+ val color = specialColor ?: if (duration < 600) LorenzColor.RED else LorenzColor.YELLOW
ItemText(color, ability.getDurationText(), true, ability.alternativePosition)
} else {
if (specialColor != null) {
@@ -254,7 +253,7 @@ class ItemAbilityCooldown {
tryHandleNextPhase(ability, specialColor)
return createItemText(ability)
}
- ItemText(LorenzColor.GREEN, "R", false, ability.alternativePosition)
+ ItemText(LorenzColor.GREEN, readyText, false, ability.alternativePosition)
}
}
@@ -293,6 +292,7 @@ class ItemAbilityCooldown {
var opacity = 130
if (color == LorenzColor.GREEN) {
opacity = 80
+ if (!SkyHanniMod.feature.itemAbilities.itemAbilityShowWhenReady) return
}
stack.background = color.addOpacity(opacity).rgb
}