Tooltip Lines Operator
pippinsmith opened this issue · 4 comments
Issue type:
- ➕ Feature request
Short description:
Idea: an operator of the following signature: Item -> List(String); Taking an item and returning a list composed of the lines of the tooltip of the input.
Tooltips are already a "first class citizen" in IntegratedTerminals for search purposes, but can't be used in filters etc.
My reason for needing/wanting this: reading tooltip for the existence of emc values provided by ProjectE, the possibility of parsing the value with regex.
From a quick look at the code, it looks straightforward to implement the functionality of this, so I'm willing to attempt a PR if this is something you'd merge, though I'm not yet sure which item I can easily use in the test suite (energy battery maybe?) since my gut feeling doesn't trust the dynamic nature of "<Shift for info"> (which is probably a translation string as well, so maybe harder to test? idk, I'm bad at tests)
Good idea, a PR is definitely welcome!
I believe tools such as pickaxes also show some tooltip lines, those could be good testing items.
If you would make a PR, could you target the master-1.19-lts
branch? I can upmerge it to higher MC versions when releasing.
Nice!
question: should I remove the item name and/or empty lines or just leave those in for the player to handle (ingame it's only a slice or tail away)
I think keeping it as-is is fine. The player will have to do post-processing anyways if they want to do anything useful with it.