[Scummvm-devel] how to add 'Help' button to launcher screen and global menu

Max Horn max at quendi.de
Sun May 9 21:16:33 CEST 2010


Am 07.05.2010 um 10:25 schrieb Frantisek Dufka:

> Hi,
> 
> I'd like to have one extra button "Help" on launcher screen (topright or 
> left corner possibly) and also in Global menu screen.

Of course this would be possible in principle. This requires tweaking the code for the two dialogs, and updating the themes (i.e. at least four theme style files: classic and modern, as well as the "small" and "large" variants).
Also, you'd have to write a dialog capable of displaying the help data, possibly allowing the user to navigate in it. A simple version could consist of a kind of "text view widget" with a scroll bar, which just display text and lets the user scroll through it. A more advanced dialog could have buttons for jumping to several "chapters".

Also, a way needs to be determined how to populate this with data. Just using a "help.txt" somewhere as you propose doesn't sounds as if it would scale well. First off, it's easy to break, the file might be missing or from an older/newer version. So, better to compile it in.

Secondly, data for a help dialog should probably be coming from multiple sources: E.g. for in-game help, the port author may want to display help about port specific shortcuts and stuff, while the engine author may wish to show game specific help -- notable, the SCUMM engine does that, it already has a "Help" dialog reachable from its F5 menu (which is similar to the GMM -- the GMM was in fact modeled on this dialog).
And for the launcher help dialog, we may want to include some general help on the launcher, independent of port specific stuff.

To get started, I recommend that you look at the menu dialog of the scumm engine in engines/scumm/dialogs.cpp, and compare the code to engines/dialogs.cpp (both are very close). To find the theme data, look at  gui/themes/scumm*/*_layou*.stx -- these four files contain the layout data. It's pretty easy to find the relevant sections, just grep for "GlobalMenu"!

Actually, adding the missing "help" button is about the only reason why SCUMM still has its own "main menu". So if you add a help button to the GMM, then this could be used to simplify the SCUMM code (I am not saying that *you* should do it, just want to say that this makes adding a Help button in the GMM even more desirable). Of course, it also means that there is a conflict here that needs to be resolved, as now your port and the SCUMM engine both want to use that button... :)


Bye,
Max



More information about the Scummvm-devel mailing list