diff options
author | Paul Gilbert | 2015-03-14 11:57:28 -0400 |
---|---|---|
committer | Paul Gilbert | 2015-03-14 11:57:28 -0400 |
commit | 561481499d4cb6e1d2a85e5dc35c7c8ff0534e3d (patch) | |
tree | c4df0527908405798e103e0bc544c799063d1fb0 | |
parent | d47197f1fac36082783c6236552fe64415349a94 (diff) | |
download | scummvm-rg350-561481499d4cb6e1d2a85e5dc35c7c8ff0534e3d.tar.gz scummvm-rg350-561481499d4cb6e1d2a85e5dc35c7c8ff0534e3d.tar.bz2 scummvm-rg350-561481499d4cb6e1d2a85e5dc35c7c8ff0534e3d.zip |
MADS: Persist gameplay options
-rw-r--r-- | engines/mads/mads.cpp | 19 | ||||
-rw-r--r-- | engines/mads/mads.h | 4 | ||||
-rw-r--r-- | engines/mads/nebular/dialogs_nebular.cpp | 3 |
3 files changed, 26 insertions, 0 deletions
diff --git a/engines/mads/mads.cpp b/engines/mads/mads.cpp index 52a0b40561..a62ad2d7df 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 9a8f2152a1..7cc0ac8bc2 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 530cf8a785..1c780c85b7 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) |