diff options
Diffstat (limited to 'src/main/kotlin/features/inventory')
3 files changed, 47 insertions, 3 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/src/main/kotlin/features/inventory/PriceData.kt b/src/main/kotlin/features/inventory/PriceData.kt index 92bfc58..241fb43 100644 --- a/src/main/kotlin/features/inventory/PriceData.kt +++ b/src/main/kotlin/features/inventory/PriceData.kt @@ -88,13 +88,13 @@ object PriceData : FirmamentFeature { it.lines.add(multiplierText) it.lines.add( formatPrice( - tr("firmament.tooltip.bazaar.sell-order", "Bazaar Sell Order"), + tr("firmament.tooltip.bazaar.buy-order", "Bazaar Buy Order"), bazaarData.quickStatus.sellPrice * multiplier ) ) it.lines.add( formatPrice( - tr("firmament.tooltip.bazaar.buy-order", "Bazaar Buy Order"), + tr("firmament.tooltip.bazaar.sell-order", "Bazaar Sell Order"), bazaarData.quickStatus.buyPrice * multiplier ) ) diff --git a/src/main/kotlin/features/inventory/storageoverlay/StorageOverlay.kt b/src/main/kotlin/features/inventory/storageoverlay/StorageOverlay.kt index 988a7c8..f59b293 100644 --- a/src/main/kotlin/features/inventory/storageoverlay/StorageOverlay.kt +++ b/src/main/kotlin/features/inventory/storageoverlay/StorageOverlay.kt @@ -48,6 +48,15 @@ object StorageOverlay : FirmamentFeature { val margin by integer("margin", 1, 60) { 20 } val itemsBlockScrolling by toggle("block-item-scrolling") { true } val highlightSearchResults by toggle("highlight-search-results") { true } + val highlightSearchResultsColour by colour("highlight-search-results-colour") { + ChromaColour.fromRGB( + 0, + 176, + 0, + 0, + 255 + ) + } } @Subscribe @@ -60,7 +69,13 @@ object StorageOverlay : FirmamentFeature { val stack = event.slot.stack ?: return val search = storageOverlayScreen.searchText.get().takeIf { it.isNotBlank() } ?: return if (storageOverlayScreen.matchesSearch(stack, search)) { - event.context.fill(event.slot.x, event.slot.y, event.slot.x + 16, event.slot.y + 16, 0xFF00B000.toInt()) + event.context.fill( + event.slot.x, + event.slot.y, + event.slot.x + 16, + event.slot.y + 16, + TConfig.highlightSearchResultsColour.getEffectiveColourRGB() + ) } } |
