aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-09-24 09:46:48 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-09-24 09:46:48 +0200
commit60a1fe8170c49abfc7d416d0f9f0e0a1f1c5e8f2 (patch)
treef3aff2b780e542c441f12047df21a05dd4f6ec12 /src/main/java/at
parented5ec92ca497fc8de2cbaeb29ec44879a43a33ea (diff)
downloadskyhanni-60a1fe8170c49abfc7d416d0f9f0e0a1f1c5e8f2.tar.gz
skyhanni-60a1fe8170c49abfc7d416d0f9f0e0a1f1c5e8f2.tar.bz2
skyhanni-60a1fe8170c49abfc7d416d0f9f0e0a1f1c5e8f2.zip
Fixed item lore flickering when debug feature internal name is enabled.
Diffstat (limited to 'src/main/java/at')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/DevConfig.java6
-rw-r--r--src/main/java/at/hannibal2/skyhanni/test/SkyHanniDebugsAndTests.kt11
2 files changed, 15 insertions, 2 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/DevConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/DevConfig.java
index 2c5189bbc..5c0a2e286 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/features/DevConfig.java
+++ b/src/main/java/at/hannibal2/skyhanni/config/features/DevConfig.java
@@ -53,6 +53,12 @@ public class DevConfig {
public boolean showEmptyNames = false;
@Expose
+ @ConfigOption(name = "Show Item Rarity", desc = "Show item rarities in item lore.")
+ @ConfigEditorBoolean
+ @ConfigAccordionId(id = 0)
+ public boolean showItemRarity = false;
+
+ @Expose
@ConfigOption(name = "Copy Internal Name", desc = "Copies the internal name of an item on key press in the clipboard.")
@ConfigEditorKeybind(defaultKey = Keyboard.KEY_NONE)
@ConfigAccordionId(id = 0)
diff --git a/src/main/java/at/hannibal2/skyhanni/test/SkyHanniDebugsAndTests.kt b/src/main/java/at/hannibal2/skyhanni/test/SkyHanniDebugsAndTests.kt
index 077945455..8870e2d79 100644
--- a/src/main/java/at/hannibal2/skyhanni/test/SkyHanniDebugsAndTests.kt
+++ b/src/main/java/at/hannibal2/skyhanni/test/SkyHanniDebugsAndTests.kt
@@ -274,8 +274,15 @@ class SkyHanniDebugsAndTests {
if ((internalName == NEUInternalName.NONE) && !config.showEmptyNames) return
event.toolTip.add("Internal Name: '${internalName.asString()}'")
- val rarity = itemStack.getItemRarityOrNull(logError = false) ?: return
- event.toolTip.add("rarity: $rarity")
+ }
+
+ @SubscribeEvent
+ fun showItemRarity(event: ItemTooltipEvent) {
+ if (!config.showItemRarity) return
+ val itemStack = event.itemStack ?: return
+
+ val rarity = itemStack.getItemRarityOrNull(logError = false)
+ event.toolTip.add("Item rarity: $rarity")
}
@SubscribeEvent