From ab1d160ec8f99e472667b83aa4bdd7697b702f3a Mon Sep 17 00:00:00 2001 From: Alexander Tkachev Date: Tue, 7 Jun 2016 19:33:00 +0600 Subject: 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. --- gui/saveload-dialog.cpp | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) (limited to 'gui') 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 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 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 -- cgit v1.2.3