-
Notifications
You must be signed in to change notification settings - Fork 6
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
Add controls for viewing off-screen GUI text #85
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe I am not understanding the purpose of the PR correctly, but if the string is too long it still gets completely rendered, covered the actual config value? You probably want to use the StringTools::truncate which has a eplisis option (see:
DrawUtils::print(16, 6 + 24, StringTools::truncate(mInfo->name, 45).c_str()); |
Also when I hold the stick to the right, it wraps back at some point and can I never see the full string. Without further investigation it might be related to the code I commented
|
||
text.erase(0, offset); | ||
if (text.size() < MIN_TEXT_WIDTH_FOR_SCROLL) { | ||
offset = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this a bug?
How about text that automatically scrolls? e.g. the GuiText class from the hombrew launcher has support for it, maybe it can be used as a base? |
That is indeed an issue. My main use case for this was for logging via stub config items (which is the reason I initially made the PR), so I did not notice or account for config items that hold properties, because it would be very unusual for a config option to have lengthy text. An easy fix for me to implement would probably be subtracting the length of the property, if one exists. I will follow-up on this one with a fix.
I did that intentionally so that you do not have to scroll all the way back or change the selected element to move back to the front of the text. If you think this is annoying, I can get rid of it.
I did consider this, but I think that it could be annoying for users if the text automatically resets when the scrolling reaches the end before they can read the text, and additionally if we did this we would likely need to have some sort of global option for modifying the auto-scrolling speed. If you want me to do it I can try to implement it like that, but I don't think it would be as ergonomic for users as the manual option. |
Description
This PR adds controls for viewing off-screen GUI text for all GUI elements. The "zoomed" text gets erased when switching the selected element.
Controls