From 60b0f12c5b68563681802d3b29c13ffcb08cd473 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 9 Oct 2011 20:00:27 +1100 Subject: TSAGE: Added code allowing Blue Force intro to be skipped by clicking the mouse --- engines/tsage/blue_force/blueforce_logic.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/engines/tsage/blue_force/blueforce_logic.cpp b/engines/tsage/blue_force/blueforce_logic.cpp index 6f8d68566e..b5465e7c40 100644 --- a/engines/tsage/blue_force/blueforce_logic.cpp +++ b/engines/tsage/blue_force/blueforce_logic.cpp @@ -908,6 +908,23 @@ void SceneHandlerExt::process(Event &event) { return; } + // If the user clicks the button whislt the introduction is active, prompt for playing the game + if ((BF_GLOBALS._dayNumber == 0) && (event.eventType == EVENT_BUTTON_DOWN)) { + // Prompt user for whether to start play or watch introduction + BF_GLOBALS._player.enableControl(); + BF_GLOBALS._events.setCursor(CURSOR_WALK); + + if (MessageDialog::show2(WATCH_INTRO_MSG, START_PLAY_BTN_STRING, INTRODUCTION_BTN_STRING) == 0) { + // Start the game + BF_GLOBALS._dayNumber = 1; + BF_GLOBALS._sceneManager.changeScene(190); + } else { + BF_GLOBALS._player.disableControl(); + } + + event.handled = true; + } + SceneHandler::process(event); } -- cgit v1.2.3 From a9abe40a124a6f7ab492906581674033d2d40942 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Sun, 9 Oct 2011 11:24:43 +0200 Subject: CGE: Add come comments in inventory functions --- engines/cge/snail.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/engines/cge/snail.cpp b/engines/cge/snail.cpp index 34adeb3a8e..966a372be4 100644 --- a/engines/cge/snail.cpp +++ b/engines/cge/snail.cpp @@ -613,15 +613,23 @@ int CGEEngine::findPocket(Sprite *spr) { return -1; } +/** + * Check if an item is in the inventory, and returns its position + * @param Inventory slot number Sprite pointer + */ void CGEEngine::selectPocket(int n) { debugC(1, kCGEDebugEngine, "CGEEngine::selectPocket(%d)", n); if (n < 0 || (_pocLight->_seqPtr && _pocPtr == n)) { + // If no slot specified, or another slot already selected + // stop the blinking animation _pocLight->step(0); n = findPocket(NULL); if (n >= 0) _pocPtr = n; } else { + // If slot specified, check if the slot if used. + // Is so, start the blinking animation if (_pocket[n] != NULL) { _pocPtr = n; _pocLight->step(1); @@ -630,13 +638,18 @@ void CGEEngine::selectPocket(int n) { _pocLight->gotoxy(kPocketX + _pocPtr * kPocketDX + kPocketSX, kPocketY + kPocketSY); } +/** + * Logic used when all the inventory slots are full and the user tries to pick + * another object. + * @param Inventory slot number Sprite pointer + */ void CGEEngine::pocFul() { debugC(1, kCGEDebugEngine, "CGEEngine::pocFul()"); _hero->park(); _commandHandler->addCommand(kCmdWait, -1, -1, _hero); _commandHandler->addCommand(kCmdSeq, -1, kSeqPocketFull, _hero); - _commandHandler->addCommand(kCmdSound, -1, 2, _hero); + _commandHandler->addCommand(kCmdSound, -1, 2, _hero); // Play the 'hum-hum" sound (fx00002) _commandHandler->addCommand(kCmdWait, -1, -1, _hero); _commandHandler->addCommand(kCmdSay, 1, kPocketFull, _hero); } -- cgit v1.2.3