From 014f31edc100c43517ce8ffe3b35a032781e87bb Mon Sep 17 00:00:00 2001 From: PushmePullyu <127053144+PushmePullyu@users.noreply.github.com> Date: Mon, 18 Dec 2023 05:31:09 +0100 Subject: [PATCH] ULTIMA: NUVIE: Disable keymapper during cutscenes Keymapper support was added in 12a47d956ee00f62ed235c4009eb57ad0dbda19d Fix regression introduced in that commit: Keys bound via the keymapper were no longer usable in cutscenes, including the intro. This made it impossible to enter a character name or skip a scene with the default keybinds. --- engines/ultima/nuvie/script/script.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/engines/ultima/nuvie/script/script.cpp b/engines/ultima/nuvie/script/script.cpp index 0bccdc186e1..57a0c232f27 100644 --- a/engines/ultima/nuvie/script/script.cpp +++ b/engines/ultima/nuvie/script/script.cpp @@ -49,6 +49,7 @@ #include "ultima/nuvie/core/magic.h" #include "ultima/nuvie/files/tmx_map.h" #include "ultima/nuvie/files/u6_lib_n.h" +#include "backends/keymapper/keymapper.h" namespace Ultima { namespace Nuvie { @@ -940,7 +941,13 @@ bool Script::play_cutscene(const char *script_file) { ConsoleHide(); - return run_lua_file(script_file_path.c_str()); + // FIXME: For now we disable the keymapper during cutscenes so input works correctly + // (e.g. for character name entry or skipping the intro) + + g_system->getEventManager()->getKeymapper()->setEnabled(false); + bool retVal = run_lua_file(script_file_path.c_str()); + g_system->getEventManager()->getKeymapper()->setEnabled(true); + return retVal; } MovementStatus Script::call_player_before_move_action(sint16 *rel_x, sint16 *rel_y) {