aboutsummaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorFilippos Karapetis2008-11-09 20:07:46 +0000
committerFilippos Karapetis2008-11-09 20:07:46 +0000
commitea7f3059605526e61e8cea2364c70bef3c35806a (patch)
treecb2f732f79a980cedf31ffdd38c0a1bbe0218c48 /gui
parent7d8e4ca59bc1877ccb86bcbffacb1847bdf7f3e9 (diff)
downloadscummvm-rg350-ea7f3059605526e61e8cea2364c70bef3c35806a.tar.gz
scummvm-rg350-ea7f3059605526e61e8cea2364c70bef3c35806a.tar.bz2
scummvm-rg350-ea7f3059605526e61e8cea2364c70bef3c35806a.zip
Added a new SaveStateDescriptor flag, is_write_protected, which can be used to stop the user from overwriting certain saves (e.g. the auto save, the restart save in the Kyrandia games, the quicksaves etc)
svn-id: r34970
Diffstat (limited to 'gui')
-rw-r--r--gui/launcher.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/gui/launcher.cpp b/gui/launcher.cpp
index c11cc58ae1..3f569c22bb 100644
--- a/gui/launcher.cpp
+++ b/gui/launcher.cpp
@@ -673,11 +673,13 @@ void SaveLoadChooser::updateSelection(bool redraw) {
int selItem = _list->getSelected();
bool isDeletable = _delSupport;
+ bool isWriteProtected = false;
if (selItem >= 0 && !_list->getSelectedString().empty() && _metaInfoSupport) {
SaveStateDescriptor desc = (*_plugin)->querySaveMetaInfos(_target.c_str(), atoi(_saveList[selItem].save_slot().c_str()));
isDeletable = desc.getBool("is_deletable") && _delSupport;
+ isWriteProtected = desc.getBool("is_write_protected");
if (_thumbnailSupport) {
const Graphics::Surface *thumb = desc.getThumbnail();
@@ -720,7 +722,7 @@ void SaveLoadChooser::updateSelection(bool redraw) {
// Disable these buttons if nothing is selected, or if an empty
// list item is selected.
- _chooseButton->setEnabled(selItem >= 0 && (!_list->getSelectedString().empty()));
+ _chooseButton->setEnabled(selItem >= 0 && (!_list->getSelectedString().empty()) && !isWriteProtected);
// Delete will always be disabled if the engine doesn't support it.
_deleteButton->setEnabled(isDeletable && (selItem >= 0) && (!_list->getSelectedString().empty()));