feat: Option to choose the colour of the highlight search result

This commit is contained in:
jani270
2025-07-10 19:54:49 +02:00
committed by Linnea Gräf
parent 13d64762bb
commit 649aac85c3
2 changed files with 18 additions and 1 deletions

View File

@@ -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()
)
}
}

View File

@@ -364,6 +364,8 @@
"firmament.config.storage-overlay.height": "Storage Height",
"firmament.config.storage-overlay.height.description": "The height of the scrollable storage panel.",
"firmament.config.storage-overlay.highlight-search-results": "Highlight Search Results",
"firmament.config.storage-overlay.highlight-search-results-colour": "Highlight Search Colour",
"firmament.config.storage-overlay.highlight-search-results-colour.description": "Change the colour of the highlighted search result.",
"firmament.config.storage-overlay.highlight-search-results.description": "Highlight the search results in the ender chest overlay.",
"firmament.config.storage-overlay.inverse-scroll": "Invert Scroll",
"firmament.config.storage-overlay.inverse-scroll.description": "Invert the mouse wheel scrolling in Firmament's storage overlay.",