[Scummvm-cvs-logs] SF.net SVN: scummvm:[34965] scummvm/trunk
thebluegr at users.sourceforge.net
thebluegr at users.sourceforge.net
Sun Nov 9 18:53:37 CET 2008
Revision: 34965
http://scummvm.svn.sourceforge.net/scummvm/?rev=34965&view=rev
Author: thebluegr
Date: 2008-11-09 17:53:37 +0000 (Sun, 09 Nov 2008)
Log Message:
-----------
Save game descriptions are now set correctly in the GMM save dialog
Modified Paths:
--------------
scummvm/trunk/engines/dialogs.cpp
scummvm/trunk/gui/launcher.cpp
scummvm/trunk/gui/launcher.h
Modified: scummvm/trunk/engines/dialogs.cpp
===================================================================
--- scummvm/trunk/engines/dialogs.cpp 2008-11-09 17:43:39 UTC (rev 34964)
+++ scummvm/trunk/engines/dialogs.cpp 2008-11-09 17:53:37 UTC (rev 34965)
@@ -166,9 +166,7 @@
int slot = _saveDialog->runModal(plugin, ConfMan.getActiveDomainName());
if (slot >= 0) {
- // FIXME: at this point, the save list's selItem is -1!
- //Common::String result(_saveDialog->getResultString());
- Common::String result;
+ Common::String result(_saveDialog->getResultString());
if (result.empty()) {
// If the user was lazy and entered no save name, come up with a default name.
char buf[20];
Modified: scummvm/trunk/gui/launcher.cpp
===================================================================
--- scummvm/trunk/gui/launcher.cpp 2008-11-09 17:43:39 UTC (rev 34964)
+++ scummvm/trunk/gui/launcher.cpp 2008-11-09 17:53:37 UTC (rev 34965)
@@ -524,6 +524,7 @@
_thumbnailSupport = _metaInfoSupport && (*_plugin)->hasFeature(MetaEngine::kSavesSupportThumbnail);
_saveDateSupport = _metaInfoSupport && (*_plugin)->hasFeature(MetaEngine::kSavesSupportCreationDate);
_playTimeSupport = _metaInfoSupport && (*_plugin)->hasFeature(MetaEngine::kSavesSupportPlayTime);
+ _resultString = "";
reflowLayout();
updateSaveList();
@@ -536,7 +537,7 @@
}
const Common::String &SaveLoadChooser::getResultString() const {
- return _list->getSelectedString();
+ return (_list->getSelected() > -1) ? _list->getSelectedString() : _resultString;
}
void SaveLoadChooser::setSaveMode(bool saveMode) {
@@ -553,13 +554,20 @@
if (selItem >= 0) {
if (_list->isEditable() || !_list->getSelectedString().empty()) {
_list->endEditMode();
- setResult(atoi(_saveList[selItem].save_slot().c_str()));
+ if (!_saveList.empty()) {
+ setResult(atoi(_saveList[selItem].save_slot().c_str()));
+ _resultString = _list->getSelectedString();
+ }
close();
}
}
break;
case kChooseCmd:
- setResult(atoi(_saveList[selItem].save_slot().c_str()));
+ _list->endEditMode();
+ if (!_saveList.empty()) {
+ setResult(atoi(_saveList[selItem].save_slot().c_str()));
+ _resultString = _list->getSelectedString();
+ }
close();
break;
case GUI::kListSelectionChangedCmd: {
@@ -747,8 +755,11 @@
// Fill the rest of the save slots with empty saves
Common::String emptyDesc;
- for (int i = curSlot + 1; i <= (*_plugin)->getMaximumSaveSlot(); i++)
+ for (int i = curSlot + 1; i <= (*_plugin)->getMaximumSaveSlot(); i++) {
saveNames.push_back(emptyDesc);
+ SaveStateDescriptor dummySave(i, "");
+ _saveList.push_back(dummySave);
+ }
_list->setList(saveNames);
}
Modified: scummvm/trunk/gui/launcher.h
===================================================================
--- scummvm/trunk/gui/launcher.h 2008-11-09 17:43:39 UTC (rev 34964)
+++ scummvm/trunk/gui/launcher.h 2008-11-09 17:53:37 UTC (rev 34965)
@@ -101,6 +101,7 @@
bool _playTimeSupport;
String _target;
SaveStateList _saveList;
+ String _resultString;
uint8 _fillR, _fillG, _fillB;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list