diff options
author | Paul Gilbert | 2014-10-18 11:20:50 -0400 |
---|---|---|
committer | Paul Gilbert | 2014-10-18 11:20:50 -0400 |
commit | 72303564f70573dc4bacd9c726dc626920bf21e8 (patch) | |
tree | 0609776637669a2681c66641fd36027a1578f645 /engines/mads/nebular | |
parent | 22aaf995ed4f5131ae9cf6753d228718a96293f3 (diff) | |
download | scummvm-rg350-72303564f70573dc4bacd9c726dc626920bf21e8.tar.gz scummvm-rg350-72303564f70573dc4bacd9c726dc626920bf21e8.tar.bz2 scummvm-rg350-72303564f70573dc4bacd9c726dc626920bf21e8.zip |
MADS: Hook up Rex game endings to show the correct animation and/or credits
Diffstat (limited to 'engines/mads/nebular')
-rw-r--r-- | engines/mads/nebular/dialogs_nebular.cpp | 4 | ||||
-rw-r--r-- | engines/mads/nebular/game_nebular.cpp | 26 | ||||
-rw-r--r-- | engines/mads/nebular/menu_nebular.cpp | 15 | ||||
-rw-r--r-- | engines/mads/nebular/menu_nebular.h | 12 |
4 files changed, 55 insertions, 2 deletions
diff --git a/engines/mads/nebular/dialogs_nebular.cpp b/engines/mads/nebular/dialogs_nebular.cpp index 86244bd3bb..1900a12b59 100644 --- a/engines/mads/nebular/dialogs_nebular.cpp +++ b/engines/mads/nebular/dialogs_nebular.cpp @@ -314,13 +314,13 @@ void DialogsNebular::showDialog() { break; } case DIALOG_TEXTVIEW: { - TextView *dlg = new TextView(_vm); + TextView *dlg = new RexTextView(_vm); dlg->show(); delete dlg; break; } case DIALOG_ANIMVIEW: { - AnimationView *dlg = new AnimationView(_vm); + AnimationView *dlg = new RexAnimationView(_vm); dlg->show(); delete dlg; break; diff --git a/engines/mads/nebular/game_nebular.cpp b/engines/mads/nebular/game_nebular.cpp index 902f42507a..eae74d6da0 100644 --- a/engines/mads/nebular/game_nebular.cpp +++ b/engines/mads/nebular/game_nebular.cpp @@ -27,6 +27,7 @@ #include "mads/game.h" #include "mads/screen.h" #include "mads/msurface.h" +#include "mads/menu_views.h" #include "mads/nebular/game_nebular.h" #include "mads/nebular/dialogs_nebular.h" #include "mads/nebular/globals_nebular.h" @@ -309,6 +310,31 @@ void GameNebular::setSectionHandler() { } void GameNebular::checkShowDialog() { + // Handling to start endgame sequences if the win/lose type has been set + switch (_winStatus) { + case 1: + // No shields failure ending + AnimationView::execute(_vm, "rexend1"); + break; + case 2: + // Shields, but no targetting failure ending + AnimationView::execute(_vm, "rexend2"); + break; + case 3: + // Completed game successfully, so activate quotes item on the main menu + ConfMan.setBool("ShowQuotes", true); + ConfMan.flushToDisk(); + + AnimationView::execute(_vm, "rexend3"); + break; + case 4: + // Decompression ending + TextView::execute(_vm, "ending4"); + break; + } + _winStatus = 0; + + // Loop for showing dialogs, if any need to be shown if (_vm->_dialogs->_pendingDialog && _player._stepEnabled && !_globals[kCopyProtectFailed]) { _player.releasePlayerSprites(); diff --git a/engines/mads/nebular/menu_nebular.cpp b/engines/mads/nebular/menu_nebular.cpp index 717e3f6cf9..46dc411678 100644 --- a/engines/mads/nebular/menu_nebular.cpp +++ b/engines/mads/nebular/menu_nebular.cpp @@ -375,6 +375,21 @@ bool AdvertView::onEvent(Common::Event &event) { return false; } +/*------------------------------------------------------------------------*/ + +void RexAnimationView::scriptDone() { + AnimationView::scriptDone(); + + Common::String s = getResourceName(); + if (s == "rexend1") { + TextView::execute(_vm, "ending1"); + } else if (s == "rexend2") { + TextView::execute(_vm, "ending2"); + } else if (s == "rexend3") { + TextView::execute(_vm, "credits"); + } +} + } // End of namespace Nebular } // End of namespace MADS diff --git a/engines/mads/nebular/menu_nebular.h b/engines/mads/nebular/menu_nebular.h index 29777a7a7c..d00439c1e4 100644 --- a/engines/mads/nebular/menu_nebular.h +++ b/engines/mads/nebular/menu_nebular.h @@ -128,6 +128,18 @@ public: void show(); }; +class RexAnimationView : public AnimationView { +protected: + virtual void scriptDone(); +public: + RexAnimationView(MADSEngine *vm) : AnimationView(vm) {} +}; + +class RexTextView : public TextView { +public: + RexTextView(MADSEngine *vm) : TextView(vm) {} +}; + } // End of namespace Nebular } // End of namespace MADS |