aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at
diff options
context:
space:
mode:
authorLorenz <lo.scherf@gmail.com>2022-08-07 02:06:30 +0200
committerLorenz <lo.scherf@gmail.com>2022-08-07 02:06:30 +0200
commit89eb5094e01253725f7d138368299657be836e17 (patch)
tree3661af1281344ccb8c4ba9667041c0700e87d3fe /src/main/java/at
parent9a3e868e8c66f2995b4ccf7d474974c58f8c08bf (diff)
downloadskyhanni-89eb5094e01253725f7d138368299657be836e17.tar.gz
skyhanni-89eb5094e01253725f7d138368299657be836e17.tar.bz2
skyhanni-89eb5094e01253725f7d138368299657be836e17.zip
add option to disable the background color from ability cooldown display
Diffstat (limited to 'src/main/java/at')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/Abilities.java5
-rw-r--r--src/main/java/at/hannibal2/skyhanni/events/GuiRenderItemEvent.kt6
-rw-r--r--src/main/java/at/hannibal2/skyhanni/items/ItemDisplayOverlayFeatures.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/items/abilitycooldown/ItemAbilityCooldown.kt15
4 files changed, 21 insertions, 9 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/Abilities.java b/src/main/java/at/hannibal2/skyhanni/config/features/Abilities.java
index c5776087c..73fb588ef 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/features/Abilities.java
+++ b/src/main/java/at/hannibal2/skyhanni/config/features/Abilities.java
@@ -14,6 +14,11 @@ public class Abilities {
public boolean itemAbilityCooldown = false;
@Expose
+ @ConfigOption(name = "Ability Cooldown Background", desc = "Show the cooldown color of item abilities in the background.")
+ @ConfigEditorBoolean
+ public boolean itemAbilityCooldownBackground = false;
+
+ @Expose
@ConfigOption(name = "Ashfang Freeze", desc = "Show the cooldown how long Ashfang blocks all your abilities.")
@ConfigEditorBoolean
public boolean ashfangFreezeCooldown = false;
diff --git a/src/main/java/at/hannibal2/skyhanni/events/GuiRenderItemEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/GuiRenderItemEvent.kt
index 0741aac5c..ade6ce835 100644
--- a/src/main/java/at/hannibal2/skyhanni/events/GuiRenderItemEvent.kt
+++ b/src/main/java/at/hannibal2/skyhanni/events/GuiRenderItemEvent.kt
@@ -5,19 +5,19 @@ import net.minecraft.item.ItemStack
abstract class GuiRenderItemEvent : LorenzEvent() {
abstract class RenderOverlayEvent(
- open val fr: FontRenderer,
+ open val fontRenderer: FontRenderer,
open val stack: ItemStack?,
open val x: Int,
open val y: Int,
open val text: String?
) : GuiRenderItemEvent() {
data class Post(
- override val fr: FontRenderer,
+ override val fontRenderer: FontRenderer,
override val stack: ItemStack?,
override val x: Int,
override val y: Int,
override val text: String?
) :
- RenderOverlayEvent(fr, stack, x, y, text)
+ RenderOverlayEvent(fontRenderer, stack, x, y, text)
}
} \ No newline at end of file
diff --git a/src/main/java/at/hannibal2/skyhanni/items/ItemDisplayOverlayFeatures.kt b/src/main/java/at/hannibal2/skyhanni/items/ItemDisplayOverlayFeatures.kt
index 6a3f7688c..592d94fad 100644
--- a/src/main/java/at/hannibal2/skyhanni/items/ItemDisplayOverlayFeatures.kt
+++ b/src/main/java/at/hannibal2/skyhanni/items/ItemDisplayOverlayFeatures.kt
@@ -27,9 +27,9 @@ class ItemDisplayOverlayFeatures {
GlStateManager.disableLighting()
GlStateManager.disableDepth()
GlStateManager.disableBlend()
- event.fr.drawStringWithShadow(
+ event.fontRenderer.drawStringWithShadow(
stackTip,
- (event.x + 17 - event.fr.getStringWidth(stackTip)).toFloat(),
+ (event.x + 17 - event.fontRenderer.getStringWidth(stackTip)).toFloat(),
(event.y + 9).toFloat(),
16777215
)
diff --git a/src/main/java/at/hannibal2/skyhanni/items/abilitycooldown/ItemAbilityCooldown.kt b/src/main/java/at/hannibal2/skyhanni/items/abilitycooldown/ItemAbilityCooldown.kt
index e744f7ca6..f3d2cdd3f 100644
--- a/src/main/java/at/hannibal2/skyhanni/items/abilitycooldown/ItemAbilityCooldown.kt
+++ b/src/main/java/at/hannibal2/skyhanni/items/abilitycooldown/ItemAbilityCooldown.kt
@@ -111,15 +111,22 @@ class ItemAbilityCooldown {
val color = itemText.color
stackTip = color.getChatColor() + itemText.text
- item.background = color.addOpacity(120).rgb
+ if (SkyHanniMod.feature.abilities.itemAbilityCooldownBackground) {
+ var opacity = 130
+ if (color == LorenzColor.GREEN) {
+ opacity = 80
+ }
+ item.background = color.addOpacity(opacity).rgb
+ }
if (stackTip.isNotEmpty()) {
GlStateManager.disableLighting()
GlStateManager.disableDepth()
GlStateManager.disableBlend()
- event.fr.drawStringWithShadow(
+ //TODO add option to change the size
+ event.fontRenderer.drawStringWithShadow(
stackTip,
- (event.x + 17 - event.fr.getStringWidth(stackTip)).toFloat(),
+ (event.x + 17 - event.fontRenderer.getStringWidth(stackTip)).toFloat(),
(event.y + 9).toFloat(),
16777215
)
@@ -144,7 +151,7 @@ class ItemAbilityCooldown {
val cooldownInSeconds: Long,
vararg val itemNames: String,
var lastClick: Long = 0L,
- val actionBarDetection: Boolean = true
+ val actionBarDetection: Boolean = true,
) {
ATOMSPLIT("Soulcry", 4, "Atomsplit Katana", "Vorpal Katana", "Voidedge Katana"),
WITHER_IMPACT("Wither Impact", 5, "Hyperion", "Scylla", "Valkyrie", "Astrea", actionBarDetection = false),