diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-08-03 15:31:53 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-08-03 15:31:53 +0200 |
commit | 04bb7a6965587a1a1b7f65da8f7743092dd8248d (patch) | |
tree | a0360f6734168c4c490d5cce7b04fa64053aa7fe /src/main/java | |
parent | f7f341b927c42b1fa9ee47549f35f9e0ba2bb36d (diff) | |
download | skyhanni-04bb7a6965587a1a1b7f65da8f7743092dd8248d.tar.gz skyhanni-04bb7a6965587a1a1b7f65da8f7743092dd8248d.tar.bz2 skyhanni-04bb7a6965587a1a1b7f65da8f7743092dd8248d.zip |
Added dev options to show slot number on key press
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/config/features/DevConfig.java | 5 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/test/TestShowSlotNumber.kt | 17 |
2 files changed, 22 insertions, 0 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 6c42d1e82..459eb65a6 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/DevConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/DevConfig.java @@ -81,6 +81,11 @@ public class DevConfig { @ConfigAccordionId(id = 0) public boolean highlightMissingRepo = false; + @Expose + @ConfigOption(name = "Slot Number", desc = "Show slot number in inventory while pressing this key.") + @ConfigEditorKeybind(defaultKey = Keyboard.KEY_NONE) + public int showSlotNumberKey = Keyboard.KEY_NONE; + @ConfigOption(name = "Parkour Waypoints", desc = "") @Accordion @Expose diff --git a/src/main/java/at/hannibal2/skyhanni/test/TestShowSlotNumber.kt b/src/main/java/at/hannibal2/skyhanni/test/TestShowSlotNumber.kt new file mode 100644 index 000000000..be202e20d --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/test/TestShowSlotNumber.kt @@ -0,0 +1,17 @@ +package at.hannibal2.skyhanni.test + +import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.events.RenderInventoryItemTipEvent +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent +import org.lwjgl.input.Keyboard + +class TestShowSlotNumber { + + @SubscribeEvent + fun onRenderItemTip(event: RenderInventoryItemTipEvent) { + if (Keyboard.isKeyDown(SkyHanniMod.feature.dev.showSlotNumberKey)) { + val slotIndex = event.slot.slotIndex + event.stackTip = "$slotIndex" + } + } +} |