From 70dde2d8bdfeb0e86a76d196193339f9ec9e17ab Mon Sep 17 00:00:00 2001 From: Stephen Kennedy Date: Wed, 13 Aug 2008 19:24:52 +0000 Subject: RemapDialog now properly uses reflowLayout() and open(), so that the same instance can be reopened svn-id: r33843 --- backends/events/default/default-events.cpp | 12 ++++++++++-- backends/events/default/default-events.h | 2 ++ 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'backends/events') diff --git a/backends/events/default/default-events.cpp b/backends/events/default/default-events.cpp index ccea12dad6..af8f9fa231 100644 --- a/backends/events/default/default-events.cpp +++ b/backends/events/default/default-events.cpp @@ -198,6 +198,7 @@ DefaultEventManager::DefaultEventManager(OSystem *boss) : _vk = new Common::VirtualKeyboard(); _keymapper = new Common::Keymapper(this); + _remap = false; } DefaultEventManager::~DefaultEventManager() { @@ -429,8 +430,15 @@ bool DefaultEventManager::pollEvent(Common::Event &event) { result = false; } } else if (event.kbd.keycode == Common::KEYCODE_F7 && event.kbd.flags == 0) { - Common::RemapDialog dialog; - dialog.runModal(); + if (!_remap) { + _remap = true; + Common::RemapDialog _remapDialog; + bool isPaused = (g_engine) ? g_engine->isPaused() : true; + if (!isPaused) g_engine->pauseEngine(true); + _remapDialog.runModal(); + if (!isPaused) g_engine->pauseEngine(false); + _remap = false; + } } break; diff --git a/backends/events/default/default-events.h b/backends/events/default/default-events.h index 8e24120ad0..81387d8d98 100644 --- a/backends/events/default/default-events.h +++ b/backends/events/default/default-events.h @@ -31,6 +31,7 @@ #include "common/savefile.h" namespace Common { + class Keymapper; class VirtualKeyboard; } @@ -51,6 +52,7 @@ class DefaultEventManager : public Common::EventManager { Common::VirtualKeyboard *_vk; Common::Keymapper *_keymapper; + bool _remap; Common::Queue _artificialEventQueue; int _artificialEventCounter; -- cgit v1.2.3