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

Add controls for viewing off-screen GUI text #85

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

splatoon1enjoyer
Copy link

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

  • R / L Stick: View rightmost text

Copy link
Contributor

@Maschell Maschell left a 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());
)
grafik

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;
Copy link
Contributor

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?

@Maschell
Copy link
Contributor

Maschell commented Aug 9, 2024

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?

https://github.com/wiiu-env/libgui/blob/62e2655b725d0a4af43f147063bdbea2aa05e6b1/source/gui/GuiText.cpp#L391

@splatoon1enjoyer
Copy link
Author

@Maschell

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?

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.

Also when I hold the stick to the right, it wraps back at some point and can I never see the full string.

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.

How about text that automatically scrolls?

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants