message box fix

actorid
Marc Zinnschlag 15 years ago
parent f4e79a48f0
commit 08d2b80434

@ -5,6 +5,7 @@
#include <assert.h> #include <assert.h>
#include <iostream> #include <iostream>
#include <iterator>
using namespace MWGui; using namespace MWGui;
@ -102,5 +103,9 @@ void WindowManager::messageBox (const std::string& message, const std::vector<st
std::cout << "message box: " << message << std::endl; std::cout << "message box: " << message << std::endl;
if (!buttons.empty()) if (!buttons.empty())
std::cerr << "error: message box buttons not supported" << std::endl; {
std::cout << "buttons: ";
std::copy (buttons.begin(), buttons.end(), std::ostream_iterator<std::string> (std::cout, ", "));
std::cout << std::endl;
}
} }

@ -19,6 +19,11 @@ namespace Interpreter
virtual void execute (Runtime& runtime, unsigned int arg0) virtual void execute (Runtime& runtime, unsigned int arg0)
{ {
// message
int index = runtime[0].mInteger;
runtime.pop();
std::string message = runtime.getStringLiteral (index);
// buttons // buttons
std::vector<std::string> buttons; std::vector<std::string> buttons;
@ -31,11 +36,6 @@ namespace Interpreter
std::reverse (buttons.begin(), buttons.end()); std::reverse (buttons.begin(), buttons.end());
// message
int index = runtime[0].mInteger;
runtime.pop();
std::string message = runtime.getStringLiteral (index);
// additional parameters // additional parameters
std::string formattedMessage; std::string formattedMessage;

Loading…
Cancel
Save