diff options
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/config/features/DevConfig.java | 6 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/test/SkyHanniDebugsAndTests.kt | 11 |
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 |