[Scummvm-devel] Global Menu Options

Max Horn max at quendi.de
Tue Nov 11 10:54:55 CET 2008


Hi Travis, all,

in my eyes the current GMM-OD (GMM options dialog ;) can only be a  
temporary solution, as it suffers from various fundamental issues;

1) It provides settings which do not apply to all games, in this form.  
(Although if Simon doesn't support the "subtitles + speech" mode, then  
I'd expect the AGOS engine to automatically detect that setting and  
revert it to an acceptable one -- is there any reason not to do so?)
2) It should offer far more settings to the user.
3) It should allow "turning off" settings, to revert to the global  
default.
4) ... I am sure there is more ....

Sure, we could add tons of (Meta)Engine feature flags to realize this,  
but I do not think this is a good idea. It's not flexible enough and  
just feels wrong. Imagine there is feature X which only a single  
engine needs -- do we really want to add a feature flag just for that,  
and implement generic code?


IMHO, the way to go about this could be the following:

First off, note that the "Edit Game" dialog, the global options dialog  
in the Launcher, *and* the GMM-OD all are subclasses of a single  
class, GUI::OptionsDialog. The reason for that always was the desire  
for code and layout sharing.

What I would like to see: Let's add a way for engines to modify the  
options dialog, and then use the *exact same* dialog as "Edit game"  
and the GMM-OD (with the exception of the "Game" tab, which is easily  
hidden). The way to do this would be to add a MetaEngine method that  
opens a GUI dialog for the given target, with a flag whether to show  
the "Game" tab or not.

Then, MetaEngine subclasses can overload this to provide customized  
config dialogs.

The easiest way to do the customization would be to provide a custom  
subclass (if you look at the ConfigDialog class in engine/dialog.cpp,  
this can really be done with a few dozen lines, and if we put some  
effort into it, to provide a clean API, it could be kept that short).  
This way, the (Meta)Engine can decide which stuff to show in the  
options dialog and which not. And it can add a custom tab with game  
specific data.


The main drawback I see is that we'd need custom layout data for that  
custom tab, which right now would have to be added to the central  
theme data file. Personally, I always felt that this is a limitation  
of our approach to storing all theme data in a single file.  But  
thanks to Tanoku, one can include subfiles in a Theme STX file. So, we  
could easily add e.g. a scumm.stx, etc., to describe layout of custom  
tabs. Anyway, I don't think this is a serious drawback.


And just in case everybody hates my approach to customizing the and  
wants to go with feature flags instead: Even then i think we should  
share the code between the GMM-OD and the "Edit Game" dialog, the only  
difference would be that we customize it via feature flags, not via  
subclassing.

Bye,
Max


P.S.: Can somebody tell me why we have a "GlobalDialog" dialog class?  
It seems to serve no purpose...




More information about the Scummvm-devel mailing list