diff options
author | James Brown | 2002-10-28 10:40:49 +0000 |
---|---|---|
committer | James Brown | 2002-10-28 10:40:49 +0000 |
commit | 0e0701ade40f3e61a4e4d7a2bc2db4f62e709819 (patch) | |
tree | bd74874de1150f358b86532927717b41bafc9b81 | |
parent | 29f335c15e69446a545e43bd78af293ff5d1d45a (diff) | |
download | scummvm-rg350-0e0701ade40f3e61a4e4d7a2bc2db4f62e709819.tar.gz scummvm-rg350-0e0701ade40f3e61a4e4d7a2bc2db4f62e709819.tar.bz2 scummvm-rg350-0e0701ade40f3e61a4e4d7a2bc2db4f62e709819.zip |
Get launcher to display aliased games as well as 'basic' games
svn-id: r5343
-rw-r--r-- | gui/launcher.cpp | 37 |
1 files changed, 23 insertions, 14 deletions
diff --git a/gui/launcher.cpp b/gui/launcher.cpp index fd600b8272..4d5a933aee 100644 --- a/gui/launcher.cpp +++ b/gui/launcher.cpp @@ -49,6 +49,7 @@ enum { LauncherDialog::LauncherDialog(NewGui *gui, GameDetector &detector) : Dialog(gui, 0, 0, 320, 200), _detector(detector) { + int i; Widget *bw; // Show game name @@ -74,31 +75,39 @@ LauncherDialog::LauncherDialog(NewGui *gui, GameDetector &detector) // (i.e. a path to the game data was set and is accesible) ? + // Retrieve a list of all games defined in the config file char domains[255][100]; int count = g_config->get_domains(domains); - //printf("First domain is %s, out of %d\n", domains[0], count); - while (v->filename && v->gamename) { - if (g_config->has_domain(v->filename)) { - String name; - char *txtname; - int pos = 0, size = l.size(); - - if ((txtname = (char*)g_config->get("description", v->filename))) { - name = txtname; - } else { - name = v->gamename; + for (i=0;i<count;i++) { + String name = (char*)g_config->get("gameid", domains[i]); + String description = (char*)g_config->get("description", domains[i]); + + if (name.isEmpty() || description.isEmpty()) { + v = version_settings; + while (v->filename && v->gamename) { + if (!scumm_stricmp(v->filename, domains[i])) { + name = domains[i]; + description = v->gamename; + break; + } + v++; } + } + + if (!name.isEmpty() && !description.isEmpty()) { + // Insert the game into the launcher list + int pos = 0, size = l.size(); while (pos < size && (name > l[pos])) pos++; - l.insert_at(pos, name); - _filenames.insert_at(pos, v->filename); + l.insert_at(pos, description); + _filenames.insert_at(pos, domains[i]); } - v++; } if (l.size() > 0) _list->setList(l); + // TODO - make a default selection (maybe the game user played last?) //_list->setSelected(0); |