Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tooltip Lines Operator #1449

Closed
pippinsmith opened this issue Dec 29, 2024 · 4 comments
Closed

Tooltip Lines Operator #1449

pippinsmith opened this issue Dec 29, 2024 · 4 comments

Comments

@pippinsmith
Copy link

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)

@rubensworks
Copy link
Member

Thanks for the suggestion!

@rubensworks
Copy link
Member

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.

@rubensworks rubensworks moved this from Options to Accepted (To Do) in Features Dec 30, 2024
@rubensworks rubensworks moved this from Accepted (To Do) to In Progress in Features Dec 30, 2024
@rubensworks rubensworks moved this from In Progress to Accepted (To Do) in Features Dec 30, 2024
@pippinsmith
Copy link
Author

initial attempt:
image

image

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)

gonna start writing tests now

@rubensworks
Copy link
Member

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.

@github-project-automation github-project-automation bot moved this from Accepted (To Do) to Done in Features Dec 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

2 participants