aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWapic <17051068+Wapic@users.noreply.github.com>2025-07-14 21:48:07 +0200
committerLinnea Gräf <nea@nea.moe>2025-08-12 01:22:56 +0200
commitf3e5a5181b47b0a7c51dd04722e0cc912a52b4dc (patch)
tree18e1d6d0b13d1ba512b2403a2839f868beda913a
parent6bd39eb81fb35b4dbd3107955a076ccacc70ee23 (diff)
downloadFirmament-f3e5a5181b47b0a7c51dd04722e0cc912a52b4dc.tar.gz
Firmament-f3e5a5181b47b0a7c51dd04722e0cc912a52b4dc.tar.bz2
Firmament-f3e5a5181b47b0a7c51dd04722e0cc912a52b4dc.zip
feat: Junk Highlighter
-rw-r--r--src/main/kotlin/features/inventory/JunkHighlighter.kt29
-rw-r--r--translations/en_us.json6
2 files changed, 35 insertions, 0 deletions
diff --git a/src/main/kotlin/features/inventory/JunkHighlighter.kt b/src/main/kotlin/features/inventory/JunkHighlighter.kt
new file mode 100644
index 0000000..80fd99d
--- /dev/null
+++ b/src/main/kotlin/features/inventory/JunkHighlighter.kt
@@ -0,0 +1,29 @@
+package moe.nea.firmament.features.inventory
+
+import org.lwjgl.glfw.GLFW
+import moe.nea.firmament.annotations.Subscribe
+import moe.nea.firmament.events.SlotRenderEvents
+import moe.nea.firmament.features.FirmamentFeature
+import moe.nea.firmament.gui.config.ManagedConfig
+import moe.nea.firmament.util.skyblock.SBItemUtil.getSearchName
+import moe.nea.firmament.util.useMatch
+
+object JunkHighlighter : FirmamentFeature {
+ override val identifier: String
+ get() = "junk-highlighter"
+
+ object TConfig : ManagedConfig(identifier, Category.INVENTORY) {
+ val junkRegex by string("regex") { "" }
+ val highlightBind by keyBinding("highlight") { GLFW.GLFW_KEY_LEFT_CONTROL }
+ }
+
+ @Subscribe
+ fun onDrawSlot(event: SlotRenderEvents.After) {
+ if(!TConfig.highlightBind.isPressed() || TConfig.junkRegex.isEmpty()) return
+ val junkRegex = TConfig.junkRegex.toPattern()
+ val slot = event.slot
+ junkRegex.useMatch(slot.stack.getSearchName()) {
+ event.context.fill(slot.x, slot.y, slot.x + 16, slot.y + 16, 0xffff0000.toInt())
+ }
+ }
+}
diff --git a/translations/en_us.json b/translations/en_us.json
index 542abe0..5404862 100644
--- a/translations/en_us.json
+++ b/translations/en_us.json
@@ -423,6 +423,12 @@
"firmament.config.waypoints.skip-to-nearest.description": "Allow skipping waypoints in an ordered list. If disabled you will need to walk to the next point, before being allowed to the next one after.",
"firmament.config.waypoints.temp-waypoint-duration": "Temporary Waypoint Duration",
"firmament.config.waypoints.temp-waypoint-duration.description": "Display waypoints sent by other players using /firm sendcoords in the world.",
+ "firmament.config.junk-highlighter": "Junk Highlighter",
+ "firmament.config.junk-highlighter.description": "Highlight items using regex to search for items in your inventory",
+ "firmament.config.junk-highlighter.regex": "Search Regex",
+ "firmament.config.junk-highlighter.regex.description": "The RegEx (Regular Expression) to use when searching",
+ "firmament.config.junk-highlighter.highlight": "Highlight Keybind",
+ "firmament.config.junk-highlighter.highlight.description": "Highlight found items when this keybind is held",
"firmament.debug.skyblockid": "SkyBlock ID: %s",
"firmament.debug.skyblockid.copy": "Click to copy SkyBlock ID",
"firmament.dev.resourcerebuild.done": "Gradle resource rebuild done in %s",