[Scummvm-cvs-logs] scummvm master -> 913751edae64a6ff35ab5f65822666273d279ea9

dreammaster dreammaster at scummvm.org
Sun Jul 27 17:11:55 CEST 2014


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:
913751edae MADS: Main menu selections now working


Commit: 913751edae64a6ff35ab5f65822666273d279ea9
    https://github.com/scummvm/scummvm/commit/913751edae64a6ff35ab5f65822666273d279ea9
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2014-07-27T11:10:59-04:00

Commit Message:
MADS: Main menu selections now working

Changed paths:
    engines/mads/dialogs.h
    engines/mads/nebular/dialogs_nebular.cpp
    engines/mads/nebular/game_nebular.cpp
    engines/mads/nebular/menu_nebular.cpp
    engines/mads/nebular/menu_nebular.h



diff --git a/engines/mads/dialogs.h b/engines/mads/dialogs.h
index c2d5bba..c586a6f 100644
--- a/engines/mads/dialogs.h
+++ b/engines/mads/dialogs.h
@@ -202,7 +202,8 @@ public:
 enum DialogId {
 	DIALOG_NONE = 0, DIALOG_GAME_MENU = 1, DIALOG_SAVE = 2, DIALOG_RESTORE = 3,
 	DIALOG_OPTIONS = 4, DIALOG_DIFFICULTY = 5, DIALOG_ERROR = 6,
-	DIALOG_MAIN_MENU = 7
+	DIALOG_MAIN_MENU = 7, DIALOG_TEXTVIEW = 8, DIALOG_ANIMVIEW = 9,
+	DIALOG_ADVERT = 10
 };
 
 class Dialogs {
diff --git a/engines/mads/nebular/dialogs_nebular.cpp b/engines/mads/nebular/dialogs_nebular.cpp
index 87bb954..17c27b4 100644
--- a/engines/mads/nebular/dialogs_nebular.cpp
+++ b/engines/mads/nebular/dialogs_nebular.cpp
@@ -270,41 +270,46 @@ bool DialogsNebular::commandCheck(const char *idStr, Common::String &valStr,
 }
 
 void DialogsNebular::showDialog() {
-	switch (_pendingDialog) {
-	case DIALOG_MAIN_MENU: {
-		MainMenu *menu = new MainMenu(_vm);
-		menu->show();
-		delete menu;
-		break;
-	}
-	case DIALOG_DIFFICULTY: {
-		DifficultyDialog *dlg = new DifficultyDialog(_vm);
-		dlg->show();
-		delete dlg;
-		break;
-	}
-	case DIALOG_GAME_MENU: {
-		GameMenuDialog *dlg = new GameMenuDialog(_vm);
-		dlg->show();
-		delete dlg;
-		break;
-	}
-	case DIALOG_SAVE: {
-		showScummVMSaveDialog();
-		break;
-	}
-	case DIALOG_RESTORE: {
-		showScummVMRestoreDialog();
-		break;
-	}
-	case DIALOG_OPTIONS: {
-		OptionsDialog *dlg = new OptionsDialog(_vm);
-		dlg->show();
-		delete dlg;
-		break;
-	}
-	default:
-		break;
+	while (_pendingDialog != DIALOG_NONE) {
+		DialogId dialogId = _pendingDialog;
+		_pendingDialog = DIALOG_NONE;
+
+		switch (dialogId) {
+		case DIALOG_MAIN_MENU: {
+			MainMenu *menu = new MainMenu(_vm);
+			menu->show();
+			delete menu;
+			break;
+		}
+		case DIALOG_DIFFICULTY: {
+			DifficultyDialog *dlg = new DifficultyDialog(_vm);
+			dlg->show();
+			delete dlg;
+			break;
+		}
+		case DIALOG_GAME_MENU: {
+			GameMenuDialog *dlg = new GameMenuDialog(_vm);
+			dlg->show();
+			delete dlg;
+			break;
+		}
+		case DIALOG_SAVE: {
+			showScummVMSaveDialog();
+			break;
+		}
+		case DIALOG_RESTORE: {
+			showScummVMRestoreDialog();
+			break;
+		}
+		case DIALOG_OPTIONS: {
+			OptionsDialog *dlg = new OptionsDialog(_vm);
+			dlg->show();
+			delete dlg;
+			break;
+		}
+		default:
+			break;
+		}
 	}
 }
 
diff --git a/engines/mads/nebular/game_nebular.cpp b/engines/mads/nebular/game_nebular.cpp
index 8fddf8b..902f425 100644
--- a/engines/mads/nebular/game_nebular.cpp
+++ b/engines/mads/nebular/game_nebular.cpp
@@ -60,9 +60,7 @@ ProtectionResult GameNebular::checkCopyProtection() {
 }
 
 void GameNebular::startGame() {
-	// Show the main menu
-	// TODO: Show the main menu here
-
+	/*
 	// Check copy protection
 	ProtectionResult protectionResult = checkCopyProtection();
 	switch (protectionResult) {
@@ -80,11 +78,13 @@ void GameNebular::startGame() {
 		// Copy protection check succeeded
 		break;
 	}
+	*/
 
 	initSection(_sectionNumber);
 	_statusFlag = true;
 
-	_vm->_dialogs->_pendingDialog = DIALOG_DIFFICULTY;
+	// Show the main menu
+	_vm->_dialogs->_pendingDialog = DIALOG_MAIN_MENU;
 	_vm->_dialogs->showDialog();
 	_vm->_dialogs->_pendingDialog = DIALOG_NONE;
 
diff --git a/engines/mads/nebular/menu_nebular.cpp b/engines/mads/nebular/menu_nebular.cpp
index 8deb804..363ec06 100644
--- a/engines/mads/nebular/menu_nebular.cpp
+++ b/engines/mads/nebular/menu_nebular.cpp
@@ -319,34 +319,36 @@ void MainMenu::unhighlightItem() {
 }
 
 void MainMenu::handleAction(MADSGameAction action) {
-	warning("Action %d", (int)action);
-	/*
 	_vm->_events->hideCursor();
+	_breakFlag = true;
 
 	switch (action) {
 	case START_GAME:
+		// Show the difficulty dialog
+		_vm->_dialogs->_pendingDialog = DIALOG_DIFFICULTY;
+		break;
+
 	case RESUME_GAME:
-		// Load a sample starting scene - note that, currently, calling loadScene automatically
-		// removes this menu screen from being displayed
-		_vm->_mouse->cursorOn();
-		_vm->_viewManager->addView(_vm->_scene);
-		_vm->_scene->loadScene(101);
+		// The original resumed the most recently saved game. Instead, 
+		// just show the load game scren
+		_vm->_dialogs->_pendingDialog = DIALOG_RESTORE;
 		return;
 
 	case SHOW_INTRO:
-		_vm->_viewManager->showAnimView("@rexopen");
+		AnimationView::execute("@rexopen");
 		break;
 
 	case CREDITS:
-		_vm->_viewManager->showTextView("credits");
+		TextView::execute("credits");
 		return;
 
 	case QUOTES:
-		_vm->_viewManager->showTextView("quotes");
+		TextView::execute("quotes");
 		return;
 
 	case EXIT:
-	{
+		_vm->_dialogs->_pendingDialog = DIALOG_ADVERT;
+		/*
 					// When the Exit action is done from the menu, show one of two possible advertisements
 
 					// Activate the scene display with the specified scene
@@ -359,14 +361,32 @@ void MainMenu::handleAction(MADSGameAction action) {
 
 					_vm->_events->quitFlag = true;
 					return;
-	}
+		*/
 		break;
 	default:
 		break;
 	}
-	*/
 }
 
+/*------------------------------------------------------------------------*/
+
+char TextView::_resourceName[100];
+
+void TextView::execute(const Common::String &resName) {
+	assert(resName.size() < 100);
+	strcpy(_resourceName, resName.c_str());
+}
+
+/*------------------------------------------------------------------------*/
+
+char AnimationView::_resourceName[100];
+
+void AnimationView::execute(const Common::String &resName) {
+	assert(resName.size() < 100);
+	strcpy(_resourceName, resName.c_str());
+}
+
+
 } // 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 8992119..04ac60f 100644
--- a/engines/mads/nebular/menu_nebular.h
+++ b/engines/mads/nebular/menu_nebular.h
@@ -116,6 +116,40 @@ public:
 	virtual ~MainMenu();
 };
 
+/**
+ * Scrolling text view
+ */
+class TextView : public MenuView {
+private:
+	static char _resourceName[100];
+public:
+	/**
+	 * Queue the given text resource for display
+	 */
+	static void execute(const Common::String &resName);
+
+	TextView(MADSEngine *vm) : MenuView(vm) {}
+
+	virtual ~TextView() {}
+};
+
+/**
+* Animation cutscene view
+*/
+class AnimationView : public MenuView {
+private:
+	static char _resourceName[100];
+public:
+	/**
+	* Queue the given text resource for display
+	*/
+	static void execute(const Common::String &resName);
+
+	AnimationView(MADSEngine *vm) : MenuView(vm) {}
+
+	virtual ~AnimationView() {}
+};
+
 } // End of namespace Nebular
 
 } // End of namespace MADS






More information about the Scummvm-git-logs mailing list