From c5f6fb5f9a3ed24eb0b31c2290fd2748bfb5792a Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 2 May 2020 18:35:28 -0700 Subject: [PATCH] ULTIMA4: Adding title skipping from mouse clicks --- .../ultima/ultima4/controllers/controller.h | 10 ++++++++++ .../ultima4/controllers/intro_controller.cpp | 20 ++++++++++++++++++- .../ultima4/controllers/intro_controller.h | 6 ++++++ 3 files changed, 35 insertions(+), 1 deletion(-) diff --git a/engines/ultima/ultima4/controllers/controller.h b/engines/ultima/ultima4/controllers/controller.h index 96715872ac5..bcbd141010b 100644 --- a/engines/ultima/ultima4/controllers/controller.h +++ b/engines/ultima/ultima4/controllers/controller.h @@ -139,6 +139,16 @@ public: Controller_startWait(); return getValue(); } + + /** + * Mouse button was pressed + */ + virtual bool mousePressed(const Common::Point &mousePos) { + // Treat mouse clicks as an abort + doneWaiting(); + return true; + } + }; class TurnCompleter { diff --git a/engines/ultima/ultima4/controllers/intro_controller.cpp b/engines/ultima/ultima4/controllers/intro_controller.cpp index c51c5bc4f14..8b1bb814199 100644 --- a/engines/ultima/ultima4/controllers/intro_controller.cpp +++ b/engines/ultima/ultima4/controllers/intro_controller.cpp @@ -360,7 +360,6 @@ bool IntroController::keyPressed(int key) { bool valid = true; switch (_mode) { - case INTRO_TITLES: // the user pressed a key to abort the sequence skipTitles(); @@ -428,6 +427,25 @@ bool IntroController::keyPressed(int key) { return valid || KeyHandler::defaultHandler(key, nullptr); } +bool IntroController::mousePressed(const Common::Point &mousePos) { + switch (_mode) { + case INTRO_TITLES: + // Finish the title sequence + skipTitles(); + break; + + case INTRO_MAP: + _mode = INTRO_MENU; + updateScreen(); + break; + + default: + break; + } + + return true; +} + void IntroController::drawMap() { if (0 && _sleepCycles > 0) { drawMapStatic(); diff --git a/engines/ultima/ultima4/controllers/intro_controller.h b/engines/ultima/ultima4/controllers/intro_controller.h index 98e275a7d5d..f3cdfde7f25 100644 --- a/engines/ultima/ultima4/controllers/intro_controller.h +++ b/engines/ultima/ultima4/controllers/intro_controller.h @@ -99,6 +99,12 @@ public: * Handles keystrokes during the introduction. */ bool keyPressed(int key); + + /** + * Mouse button was pressed + */ + bool mousePressed(const Common::Point &mousePos) override; + byte *getSigData(); /**