From ea7f3059605526e61e8cea2364c70bef3c35806a Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sun, 9 Nov 2008 20:07:46 +0000 Subject: 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 --- gui/launcher.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'gui') 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())); -- cgit v1.2.3