diff options
author | Adrian Frühwirth | 2018-06-01 10:19:47 +0200 |
---|---|---|
committer | Adrian Frühwirth | 2018-06-27 22:47:51 +0200 |
commit | e86189bd8607d3bc0cc8d94042c315d81485a2d1 (patch) | |
tree | d30324c85a62573751f6cd439b457243b77bd46d | |
parent | c808f33f5213f7920e398be99d719bfec5abfcb9 (diff) | |
download | scummvm-rg350-e86189bd8607d3bc0cc8d94042c315d81485a2d1.tar.gz scummvm-rg350-e86189bd8607d3bc0cc8d94042c315d81485a2d1.tar.bz2 scummvm-rg350-e86189bd8607d3bc0cc8d94042c315d81485a2d1.zip |
GUI: Grey out unlaunchable games in launcher
-rw-r--r-- | gui/launcher.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/gui/launcher.cpp b/gui/launcher.cpp index 214dc30834..fd65e37cdd 100644 --- a/gui/launcher.cpp +++ b/gui/launcher.cpp @@ -247,6 +247,8 @@ void LauncherDialog::close() { void LauncherDialog::updateListing() { StringArray l; + ListWidget::ColorList colors; + ThemeEngine::FontColor color; // Retrieve a list of all games defined in the config file _domains.clear(); @@ -263,6 +265,7 @@ void LauncherDialog::updateListing() { String gameid(iter->_value.getVal("gameid")); String description(iter->_value.getVal("description")); + Common::FSNode path(iter->_value.getVal("path")); if (gameid.empty()) gameid = iter->_key; @@ -282,13 +285,25 @@ void LauncherDialog::updateListing() { while (pos < size && (scumm_stricmp(description.c_str(), l[pos].c_str()) > 0)) pos++; + + color = ThemeEngine::kFontColorNormal; + if (!path.isDirectory()) { + color = ThemeEngine::kFontColorAlternate; + // If more conditions which grey out entries are added we should consider + // enabling this so that it is easy to spot why a certain game entry cannot + // be started. + + // description += Common::String::format(" (%s)", _("Not found")); + } + l.insert_at(pos, description); + colors.insert_at(pos, color); _domains.insert_at(pos, iter->_key); } } const int oldSel = _list->getSelected(); - _list->setList(l); + _list->setList(l, &colors); if (oldSel < (int)l.size()) _list->setSelected(oldSel); // Restore the old selection else if (oldSel != -1) |