diff options
author | Alexander Tkachev | 2016-06-07 19:33:00 +0600 |
---|---|---|
committer | Alexander Tkachev | 2016-08-24 16:07:55 +0600 |
commit | ab1d160ec8f99e472667b83aa4bdd7697b702f3a (patch) | |
tree | 7b52ca273b683c485ce59a85b8722a6f43ba8014 /gui | |
parent | bf71ba9a1c98b39647edb248e913322ee38a0af5 (diff) | |
download | scummvm-rg350-ab1d160ec8f99e472667b83aa4bdd7697b702f3a.tar.gz scummvm-rg350-ab1d160ec8f99e472667b83aa4bdd7697b702f3a.tar.bz2 scummvm-rg350-ab1d160ec8f99e472667b83aa4bdd7697b702f3a.zip |
ALL: Add MetaEngine::simpleSaveNames()
Engines with "simple" savenames would support "Run in background" in
save/load dialog and gradual save slots unlocking. Other engines
save/load feature would be locked until save sync is over.
Diffstat (limited to 'gui')
-rw-r--r-- | gui/saveload-dialog.cpp | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/gui/saveload-dialog.cpp b/gui/saveload-dialog.cpp index 1ba1793ef4..0dde1a4060 100644 --- a/gui/saveload-dialog.cpp +++ b/gui/saveload-dialog.cpp @@ -266,25 +266,27 @@ void SaveLoadChooserDialog::listSaves() { if (!_metaEngine) return; //very strange _saveList = _metaEngine->listSaves(_target.c_str()); - Common::String pattern = _metaEngine->getSavefilesPattern(_target); - Common::Array<Common::String> files = CloudMan.getSyncingFiles(); //returns empty array if not syncing - for (uint32 i = 0; i < files.size(); ++i) { - if (!files[i].matchString(pattern, true)) continue; - - //make up some slot number - int slotNum = 0; - for (uint32 j = (files[i].size() > 3 ? files[i].size() - 3 : 0); j < files[i].size(); ++j) { //3 last chars - char c = files[i][j]; - if (c < '0' || c > '9') continue; - slotNum = slotNum * 10 + (c - '0'); + if (_metaEngine->simpleSaveNames()) { + Common::String pattern = _target + ".###"; + Common::Array<Common::String> files = CloudMan.getSyncingFiles(); //returns empty array if not syncing + for (uint32 i = 0; i < files.size(); ++i) { + if (!files[i].matchString(pattern, true)) continue; + + //make up some slot number + int slotNum = 0; + for (uint32 j = (files[i].size() > 3 ? files[i].size() - 3 : 0); j < files[i].size(); ++j) { //3 last chars + char c = files[i][j]; + if (c < '0' || c > '9') continue; + slotNum = slotNum * 10 + (c - '0'); + } + + SaveStateDescriptor slot(slotNum, files[i]); + slot.setLocked(true); + _saveList.push_back(slot); } - SaveStateDescriptor slot(slotNum, files[i]); - slot.setLocked(true); - _saveList.push_back(slot); + Common::sort(_saveList.begin(), _saveList.end(), SaveStateDescriptorSlotComparator()); } - - Common::sort(_saveList.begin(), _saveList.end(), SaveStateDescriptorSlotComparator()); } #ifndef DISABLE_SAVELOADCHOOSER_GRID |