[Scummvm-cvs-logs] scummvm master -> 561481499d4cb6e1d2a85e5dc35c7c8ff0534e3d
dreammaster
dreammaster at scummvm.org
Sat Mar 14 16:58:49 CET 2015
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
561481499d MADS: Persist gameplay options
Commit: 561481499d4cb6e1d2a85e5dc35c7c8ff0534e3d
https://github.com/scummvm/scummvm/commit/561481499d4cb6e1d2a85e5dc35c7c8ff0534e3d
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2015-03-14T11:57:28-04:00
Commit Message:
MADS: Persist gameplay options
Changed paths:
engines/mads/mads.cpp
engines/mads/mads.h
engines/mads/nebular/dialogs_nebular.cpp
diff --git a/engines/mads/mads.cpp b/engines/mads/mads.cpp
index 52a0b40..a62ad2d 100644
--- a/engines/mads/mads.cpp
+++ b/engines/mads/mads.cpp
@@ -82,6 +82,8 @@ void MADSEngine::initialize() {
MSurface::setVm(this);
MSprite::setVm(this);
+ loadOptions();
+
Resources::init(this);
Conversation::init(this);
_debugger = new Debugger(this);
@@ -98,6 +100,23 @@ void MADSEngine::initialize() {
_screen.empty();
}
+void MADSEngine::loadOptions() {
+ if (ConfMan.hasKey("EasyMouse"))
+ _easyMouse = ConfMan.getBool("EasyMouse");
+ if (ConfMan.hasKey("InvObjectsAnimated"))
+ _invObjectsAnimated = ConfMan.getBool("InvObjectsAnimated");
+ if (ConfMan.hasKey("TextWindowStill"))
+ _textWindowStill = ConfMan.getBool("TextWindowStill");
+}
+
+void MADSEngine::saveOptions() {
+ ConfMan.setBool("EasyMouse", _easyMouse);
+ ConfMan.setBool("InvObjectsAnimated", _invObjectsAnimated);
+ ConfMan.setBool("TextWindowStill", _textWindowStill);
+
+ ConfMan.flushToDisk();
+}
+
Common::Error MADSEngine::run() {
initGraphics(MADS_SCREEN_WIDTH, MADS_SCREEN_HEIGHT, false);
initialize();
diff --git a/engines/mads/mads.h b/engines/mads/mads.h
index 9a8f215..7cc0ac8 100644
--- a/engines/mads/mads.h
+++ b/engines/mads/mads.h
@@ -84,6 +84,8 @@ private:
* Handles basic initialisation
*/
void initialize();
+
+ void loadOptions();
protected:
// Engine APIs
virtual Common::Error run();
@@ -145,6 +147,8 @@ public:
* Handles saving the game via the GMM
*/
virtual Common::Error saveGameState(int slot, const Common::String &desc);
+
+ void saveOptions();
};
} // End of namespace MADS
diff --git a/engines/mads/nebular/dialogs_nebular.cpp b/engines/mads/nebular/dialogs_nebular.cpp
index 530cf8a..1c780c8 100644
--- a/engines/mads/nebular/dialogs_nebular.cpp
+++ b/engines/mads/nebular/dialogs_nebular.cpp
@@ -1117,12 +1117,15 @@ void OptionsDialog::show() {
break;
case 3: // Interface
_vm->_easyMouse = !_vm->_easyMouse;
+ _vm->saveOptions();
break;
case 4: // Inventory
_vm->_invObjectsAnimated = !_vm->_invObjectsAnimated;
+ _vm->saveOptions();
break;
case 5: // Text window
_vm->_textWindowStill = !_vm->_textWindowStill;
+ _vm->saveOptions();
break;
case 6: // Screen fade
if (_vm->_screenFade == SCREEN_FADE_FAST)
More information about the Scummvm-git-logs
mailing list