[Scummvm-cvs-logs] scummvm master -> 7579005ff1153d4eefe2914d0210a46ee3d88719

bluegr bluegr at gmail.com
Mon May 26 21:53:58 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:
7579005ff1 MADS: Implement the recipe showing functionality


Commit: 7579005ff1153d4eefe2914d0210a46ee3d88719
    https://github.com/scummvm/scummvm/commit/7579005ff1153d4eefe2914d0210a46ee3d88719
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2014-05-26T22:52:41+03:00

Commit Message:
MADS: Implement the recipe showing functionality

Changed paths:
    engines/mads/nebular/game_nebular.cpp
    engines/mads/nebular/game_nebular.h



diff --git a/engines/mads/nebular/game_nebular.cpp b/engines/mads/nebular/game_nebular.cpp
index c6fa60b..75d1ff1 100644
--- a/engines/mads/nebular/game_nebular.cpp
+++ b/engines/mads/nebular/game_nebular.cpp
@@ -278,6 +278,51 @@ void GameNebular::checkShowDialog() {
 	}
 }
 
+void GameNebular::showRecipe() {
+	Dialogs &dialogs = *_vm->_dialogs;
+	int count;
+
+	for (count = 0; count < 4; count++) {
+		switch(_globals[kIngredientQuantity + count]) {
+		case 0:
+			dialogs._indexList[count] = NOUN_DROP;
+			break;
+		case 1:
+			dialogs._indexList[count] = NOUN_DOLLOP;
+			break;
+		case 2:
+			dialogs._indexList[count] = NOUN_DASH;
+			break;
+		case 3:
+			dialogs._indexList[count] = NOUN_SPLASH;
+			break;
+		default:
+			break;
+		}
+	}
+
+	for (count = 0; count < 4; count++) {
+		switch(_globals[kIngredientList + count]) {
+		case 0:
+			dialogs._indexList[count + 4] = NOUN_ALCOHOL;
+			break;
+		case 1:
+			dialogs._indexList[count + 4] = NOUN_LECITHIN;
+			break;
+		case 2:
+			dialogs._indexList[count + 4] = NOUN_PETROX;
+			break;
+		case 3:
+			dialogs._indexList[count + 4] = NOUN_FORMALDEHYDE;
+			break;
+		default:
+			break;
+		}
+	}
+
+	_vm->_dialogs->show(401);
+}
+
 void GameNebular::doObjectAction() {
 	Scene &scene = _scene;
 	MADSAction &action = _scene._action;
@@ -424,7 +469,7 @@ void GameNebular::doObjectAction() {
 		_objects.setRoom(OBJ_AUDIO_TAPE, OBJ_TAPE_PLAYER);
 	} else if (action.isAction(VERB_ACTIVATE, NOUN_TAPE_PLAYER) && _objects.isInInventory(OBJ_TAPE_PLAYER)) {
 		if (_objects[OBJ_AUDIO_TAPE]._roomNumber == OBJ_TAPE_PLAYER) {
-			warning("TODO: Show the recipe");
+			showRecipe();
 		} else {
 			dialogs.show(406);
 		}
diff --git a/engines/mads/nebular/game_nebular.h b/engines/mads/nebular/game_nebular.h
index da25221..56bcf44 100644
--- a/engines/mads/nebular/game_nebular.h
+++ b/engines/mads/nebular/game_nebular.h
@@ -117,6 +117,8 @@ public:
 
 	virtual void doObjectAction();
 
+	void showRecipe();
+
 	virtual void unhandledAction();
 
 	virtual void step();






More information about the Scummvm-git-logs mailing list