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
Conversation
d09c805
to
65e7215
Compare
It was not used, and moreover \015 is \x0d which is \r. oops
…g(), fixed closing formatting
This lets us find macgui.dat and classicmacfonts.dat
Could lead to regressions, need more testing
@@ -1024,4 +1024,112 @@ void *OSystem_Android::getOpenGLProcAddress(const char *name) const { | |||
} | |||
#endif | |||
|
|||
static const char *helpTabs[] = { |
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.
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.
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. |
@sev- : This looks good, but see earlier comment (forgot to tag you earlier... and had to correct rumtime to runtime which is very SoMI :) ) |
The text is indeed rendered only when the dialog is open. It draws things on a tall surface. |
Okay, merging this. We need to work more on the Help content. |
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:
Now, the screenshots.
This is the General Help tab, the default one

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
This is the first Android-specific tab. Note the different text styling.

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