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

COMMON: Built-in ScummVM Help subsystem #5326

Merged
merged 110 commits into from Sep 16, 2023
Merged

COMMON: Built-in ScummVM Help subsystem #5326

merged 110 commits into from Sep 16, 2023

Conversation

sev-
Copy link
Member

@sev- sev- commented Sep 10, 2023

Team,

Here is the result of my effort to add a built-in help.

The help content is rudimentary now and is copies of chunks of our documentation. I added help to SDL backend and Android (untested).

I will show how it looks further.

The general idea was to add something that could offer versatility, not plain text. After contemplating using a restricted HTML renderer, I decided to go with Markdown, because (a) I do not need advanced things from HTML anyway (b) there are small open source implementations of Markdown.

Then, I went with enhancing MacText with a Markdown parser. This lets me already render texts with styles, plus, I am using classicmacfonts, so the typography is decent. I haven't tested translations with it, though, maybe I'll have to revert this decision later (MacText can already draw with TrueType fonts, it is a matter of adding the relevant fonts).

I added things as image rendering, headers, and passing styles like colors. Also, all the links show tooltips with the target URL, and they are clickable and call our openUrl().

Initially, I thought of having the tabs rendered at the bottom but did not succeed with rendering, so I removed most of the relevant commits. This is why you see changes to VectorRendererSpec.

The open questions which I'd like to hear feedback on:

  • The place for the help texts in the backends. I now put them into the main backend file. Should they live in a separate file?
  • Does it work with Android as intended? The question is regarding the image pack accessibility
  • The placement of the [?] button at the launcher. Currently, it is on the left because on the right side, Andoid has general controls overlay.
  • The general feedback about the area
  • The Keyboard tab is kind of ugly because I did not implement rendering for tables. Should I still implement it?
  • General usability feedback.

Now, the screenshots.

This is the General Help tab, the default one
General Help

This is the SDL-specific Keyboard shortcuts tab. Note, that the "Exit" shortcut is platform-specific, though I could not distinguish between Unix/Linux and Other. This shows macOS shortcut. Note also how the URL tooltips look like

Screenshot 2023-09-10 at 10 57 37

This is the first Android-specific tab. Note the different text styling.
Screenshot 2023-09-10 at 11 03 57

And this is the second one. Note the screenshots. They are centered and I had to do some cropping, so they stay readable.

Screenshot 2023-09-10 at 11 04 12

@sev- sev- force-pushed the backend-help branch 2 times, most recently from d09c805 to 65e7215 Compare September 14, 2023 06:50
It was not used, and moreover \015 is \x0d which is \r. oops
This lets us find macgui.dat and classicmacfonts.dat
@@ -1024,4 +1024,112 @@ void *OSystem_Android::getOpenGLProcAddress(const char *name) const {
}
#endif

static const char *helpTabs[] = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure, but I think I would suggest:

static const char * const helpTabs[] = {

This should help compiler in RAM optimisation, by indicating that the underlying character arrays are constant, not just the pointers to them.

Several other cases of this in various embedded help strings.

@digitall
Copy link
Member

Looks good, though be nice to know how much increase in binary size and runtime RAM usage this causes for the various ports.

If this is significant, we should ensure that the help text is not shown for RAM constrained embedded ports or loaded in a way where the text is loaded as needed and unloaded after usage.

@digitall
Copy link
Member

@sev- : This looks good, but see earlier comment (forgot to tag you earlier... and had to correct rumtime to runtime which is very SoMI :) )

@sev-
Copy link
Member Author

sev- commented Sep 16, 2023

Looks good, though be nice to know how much increase in binary size and runtime RAM usage this causes for the various ports.

If this is significant, we should ensure that the help text is not shown for RAM constrained embedded ports or loaded in a way where the text is loaded as needed and unloaded after usage.

The text is indeed rendered only when the dialog is open. It draws things on a tall surface.

@sev-
Copy link
Member Author

sev- commented Sep 16, 2023

Okay, merging this. We need to work more on the Help content.

@sev- sev- merged commit 2bea791 into scummvm:master Sep 16, 2023
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants