diff options
author | Max Horn | 2002-12-20 22:41:03 +0000 |
---|---|---|
committer | Max Horn | 2002-12-20 22:41:03 +0000 |
commit | 189c5405b0d8ed7a395d663524cccadbdc5087bc (patch) | |
tree | 54a251b64b4def31e7d4280c058a90e9da84d5ed | |
parent | fd7cc14ab235ea5a85ffd26cc1943c4b0fb3d5d5 (diff) | |
download | scummvm-rg350-189c5405b0d8ed7a395d663524cccadbdc5087bc.tar.gz scummvm-rg350-189c5405b0d8ed7a395d663524cccadbdc5087bc.tar.bz2 scummvm-rg350-189c5405b0d8ed7a395d663524cccadbdc5087bc.zip |
don't show amiga checkbox for simon games
svn-id: r6031
-rw-r--r-- | gui/launcher.cpp | 38 |
1 files changed, 23 insertions, 15 deletions
diff --git a/gui/launcher.cpp b/gui/launcher.cpp index 1effb014af..6b5f5e90cf 100644 --- a/gui/launcher.cpp +++ b/gui/launcher.cpp @@ -92,17 +92,20 @@ EditGameDialog::EditGameDialog(NewGui *gui, Config &config, const String &domain // Determine the description string String gameid(_config.get("gameid", _domain)); String description(_config.get("description", _domain)); + const VersionSettings *v = version_settings; + if (gameid.isEmpty()) gameid = _domain; - if (description.isEmpty()) { - const VersionSettings *v = version_settings; - while (v->filename) { - if (!scumm_stricmp(v->filename, gameid.c_str())) { - description = v->gamename; - break; - } - v++; + + // Find the VersionSettings for this gameid + while (v->filename) { + if (!scumm_stricmp(v->filename, gameid.c_str())) { + break; } + v++; + } + if (description.isEmpty()) { + description = v->gamename; } // Label & edit widget for the game ID @@ -120,17 +123,21 @@ EditGameDialog::EditGameDialog(NewGui *gui, Config &config, const String &domain new StaticTextWidget(this, 10, 42, 40, kLineHeight, "Path: ", kTextAlignRight); new StaticTextWidget(this, 50, 42, _w-50-10, kLineHeight, path, kTextAlignLeft); - // TODO - insert more widgets here; see comments before the class + // Full screen checkbox _fullscreenCheckbox = new CheckboxWidget(this, 15, 62, 200, 16, "Use Fullscreen Mode", 0, 'F'); - _amigaPalCheckbox = new CheckboxWidget(this, 15, 82, 200, 16, "Use Amiga Palette", 0, 'A'); + _fullscreenCheckbox->setState(_config.getBool("fullscreen", false, _domain)); + + // Display 'Amiga' checkbox, but only for Scumm games. + if (GID_SIMON_FIRST <= v->id && v->id <= GID_SIMON_LAST) { + _amigaPalCheckbox = 0; + } else { + _amigaPalCheckbox = new CheckboxWidget(this, 15, 82, 200, 16, "Use Amiga Palette", 0, 'A'); + _amigaPalCheckbox->setState(_config.getBool("amiga", false, _domain)); + } // Add OK & Cancel buttons addButton(_w-2*(kButtonWidth+10), _h-24, "Cancel", kCloseCmd, 0); addButton(_w-(kButtonWidth+10), _h-24, "OK", kOKCmd, 0); - - // Load in settings for the checkboxs - _fullscreenCheckbox->setState(_config.getBool("fullscreen", false, _domain)); - _amigaPalCheckbox->setState(_config.getBool("amiga", false, _domain)); // TODO - only show this checkbox if this is a Scumm game? } void EditGameDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) @@ -147,7 +154,8 @@ void EditGameDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 dat _config.rename_domain(_domain, newDomain); } _config.set("description", _descriptionWidget->getLabel(), newDomain); - _config.setBool("amiga", _amigaPalCheckbox->getState(), newDomain); + if (_amigaPalCheckbox) + _config.setBool("amiga", _amigaPalCheckbox->getState(), newDomain); _config.setBool("fullscreen", _fullscreenCheckbox->getState(), newDomain); setResult(1); close(); |