From 17135a64035d1f26b8bdd6f7125254935b9067e8 Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Sun, 22 Aug 2010 11:22:10 +0200 Subject: [PATCH] routed message box output through window manager --- apps/openmw/mwgui/window_manager.cpp | 9 +++++++++ apps/openmw/mwgui/window_manager.hpp | 3 +++ apps/openmw/mwscript/interpretercontext.cpp | 5 +---- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/apps/openmw/mwgui/window_manager.cpp b/apps/openmw/mwgui/window_manager.cpp index 726cd5bd8d..ed4085ea8d 100644 --- a/apps/openmw/mwgui/window_manager.cpp +++ b/apps/openmw/mwgui/window_manager.cpp @@ -4,6 +4,7 @@ #include "console.hpp" #include +#include using namespace MWGui; @@ -95,3 +96,11 @@ void WindowManager::setValue (const std::string& id, const MWMechanics::DynamicS stats->setValue (id, value); hud->setValue (id, value); } + +void WindowManager::messageBox (const std::string& message, const std::vector& buttons) +{ + std::cout << "message box: " << message << std::endl; + + if (!buttons.empty()) + std::cerr << "error: message box buttons not supported" << std::endl; +} diff --git a/apps/openmw/mwgui/window_manager.hpp b/apps/openmw/mwgui/window_manager.hpp index a2e664d26d..ea2d87bc9c 100644 --- a/apps/openmw/mwgui/window_manager.hpp +++ b/apps/openmw/mwgui/window_manager.hpp @@ -11,6 +11,7 @@ */ #include +#include #include "../mwmechanics/stat.hpp" @@ -144,6 +145,8 @@ namespace MWGui void setValue (const std::string& id, const MWMechanics::DynamicStat& value); ///< Set value for the given ID. + + void messageBox (const std::string& message, const std::vector& buttons); }; } #endif diff --git a/apps/openmw/mwscript/interpretercontext.cpp b/apps/openmw/mwscript/interpretercontext.cpp index 404aa69a68..22a5aaa702 100644 --- a/apps/openmw/mwscript/interpretercontext.cpp +++ b/apps/openmw/mwscript/interpretercontext.cpp @@ -105,10 +105,7 @@ namespace MWScript void InterpreterContext::messageBox (const std::string& message, const std::vector& buttons) { - std::cout << "message box: " << message << std::endl; - - if (!buttons.empty()) - std::cerr << "error: message box buttons not supported" << std::endl; + mEnvironment.mWindowManager->messageBox (message, buttons); } bool InterpreterContext::menuMode()