diff options
author | Matthew Hoops | 2011-05-11 21:23:37 -0400 |
---|---|---|
committer | Matthew Hoops | 2011-05-11 21:28:28 -0400 |
commit | 6067a46e9d4ac580d3dca7d38dfe4cc4a6c3f0cd (patch) | |
tree | 071ced87a9998fcd4a1ed2ba924b3b11bb40571f | |
parent | 01380d287ab582099dc632329389fc70186b0b73 (diff) | |
download | scummvm-rg350-6067a46e9d4ac580d3dca7d38dfe4cc4a6c3f0cd.tar.gz scummvm-rg350-6067a46e9d4ac580d3dca7d38dfe4cc4a6c3f0cd.tar.bz2 scummvm-rg350-6067a46e9d4ac580d3dca7d38dfe4cc4a6c3f0cd.zip |
PEGASUS: Cleanup menu button handling
Also, hooked the Restore button up to the load dialog
-rw-r--r-- | engines/pegasus/menu.cpp | 19 | ||||
-rw-r--r-- | engines/pegasus/pegasus.cpp | 32 | ||||
-rw-r--r-- | engines/pegasus/pegasus.h | 5 |
3 files changed, 42 insertions, 14 deletions
diff --git a/engines/pegasus/menu.cpp b/engines/pegasus/menu.cpp index d2cb584d31..8f587c3095 100644 --- a/engines/pegasus/menu.cpp +++ b/engines/pegasus/menu.cpp @@ -21,6 +21,7 @@ */ #include "common/events.h" +#include "common/textconsole.h" #include "pegasus/pegasus.h" @@ -81,8 +82,13 @@ void PegasusEngine::runMainMenu() { if (buttonSelected != kDifficultyButton) { drawMenuButtonSelected(buttonSelected); setGameMode(buttonSelected); - _sound->stopSound(); - return; + + if (_gameMode != kMainMenuMode) { + _sound->stopSound(); + return; + } + + drawMenu(buttonSelected); } break; default: @@ -107,6 +113,7 @@ void PegasusEngine::runMainMenu() { // Too slow! Go back and show the intro again. _sound->stopSound(); _video->playMovie("Images/Opening_Closing/LilMovie.movie"); + _gameMode = kIntroMode; } void PegasusEngine::drawMenu(int buttonSelected) { @@ -159,7 +166,7 @@ void PegasusEngine::setGameMode(int buttonSelected) { _gameMode = kMainGameMode; break; case kDemoCreditsButton: - _gameMode = kCreditsMode; + warning("No credits just yet"); break; case kDemoQuitButton: _gameMode = kQuitMode; @@ -168,16 +175,16 @@ void PegasusEngine::setGameMode(int buttonSelected) { } else { switch (buttonSelected) { case kInterfaceOverviewButton: - _gameMode = kInterfaceOverviewMode; + warning("No overview just yet"); break; case kStartButton: _gameMode = kMainGameMode; break; case kRestoreButton: - _gameMode = kRestoreMode; + showLoadDialog(); break; case kCreditsButton: - _gameMode = kCreditsMode; + warning("No credits just yet"); break; case kQuitButton: _gameMode = kQuitMode; diff --git a/engines/pegasus/pegasus.cpp b/engines/pegasus/pegasus.cpp index c8958a076f..9688a99c73 100644 --- a/engines/pegasus/pegasus.cpp +++ b/engines/pegasus/pegasus.cpp @@ -23,14 +23,15 @@ #include "common/config-manager.h" #include "common/error.h" #include "common/events.h" +#include "common/file.h" #include "common/textconsole.h" +#include "common/translation.h" #include "base/plugins.h" #include "base/version.h" +#include "gui/saveload.h" #include "pegasus/pegasus.h" -#include "common/file.h" - //#define RUN_SUB_MOVIE // :D :D :D :D :D :D //#define RUN_INTERFACE_TEST @@ -55,7 +56,7 @@ Common::Error PegasusEngine::run() { _resFork = new Common::MacResManager(); _inventoryLid = new Common::MacResManager(); _biochipLid = new Common::MacResManager(); - _gameMode = kMainMenuMode; + _gameMode = kIntroMode; _adventureMode = true; if (!_resFork->open("JMP PP Resources") || !_resFork->hasResFork()) @@ -107,10 +108,12 @@ Common::Error PegasusEngine::run() { #else while (!shouldQuit()) { switch (_gameMode) { - case kMainMenuMode: + case kIntroMode: if (!isDemo()) runIntro(); - + _gameMode = kMainMenuMode; + break; + case kMainMenuMode: runMainMenu(); break; case kMainGameMode: @@ -306,6 +309,25 @@ void PegasusEngine::loadExtras(TimeZone timeZone) { delete res; } +void PegasusEngine::showLoadDialog() { + GUI::SaveLoadChooser slc(_("Load game:"), _("Load")); + slc.setSaveMode(false); + + Common::String gameId = ConfMan.get("gameid"); + + const EnginePlugin *plugin = 0; + EngineMan.findGame(gameId, &plugin); + + int slot = slc.runModalWithPluginAndTarget(plugin, ConfMan.getActiveDomainName()); + + if (slot >= 0) { + warning("TODO: Load game"); + _gameMode = kMainGameMode; + } + + slc.close(); +} + Common::String PegasusEngine::getTimeZoneDesc(TimeZone timeZone) { static const char *names[] = { "Prehistoric", "Mars", "WSC", "Tiny TSA", "Full TSA", "Norad Alpha", "Caldoria", "Norad Delta" }; return names[timeZone]; diff --git a/engines/pegasus/pegasus.h b/engines/pegasus/pegasus.h index a0b98a511c..30199f1755 100644 --- a/engines/pegasus/pegasus.h +++ b/engines/pegasus/pegasus.h @@ -175,11 +175,9 @@ enum Item { }; enum GameMode { + kIntroMode, kMainMenuMode, kMainGameMode, - kCreditsMode, - kInterfaceOverviewMode, - kRestoreMode, kQuitMode }; @@ -215,6 +213,7 @@ private: void drawInterface(); //void drawCompass(); //void runPauseMenu(); + void showLoadDialog(); // Interface Overview void drawInterfaceOverview(); |