Skip the GUI2 FLG dialog in the automatic multiplayer test

This commit is contained in:
Jyrki Vesterinen 2016-08-31 21:18:37 +03:00
parent 2f90512856
commit 88ca728080
2 changed files with 12 additions and 1 deletions

View File

@ -106,7 +106,7 @@ local function plugin()
if info.name == "Dialog" then
log("got a leader select dialog...")
context.set_result({result = 0})
context.skip_dialog({})
events, context, info = coroutine.yield()
repeat

View File

@ -18,6 +18,8 @@
#include "gui/auxiliary/field.hpp"
#include "gui/widgets/integer_selector.hpp"
#include "scripting/plugins/context.hpp"
#include "scripting/plugins/manager.hpp"
#include "video.hpp"
namespace gui2
@ -34,6 +36,15 @@ tdialog::~tdialog()
bool tdialog::show(CVideo& video, const unsigned auto_close_time)
{
if(video.faked()) {
plugins_manager* pm = plugins_manager::get();
if (pm && pm->any_running())
{
plugins_context pc("Dialog");
pc.set_callback("skip_dialog", [this](config) { retval_ = twindow::OK; }, false);
pc.set_callback("quit", [](config) {}, false);
pc.play_slice();
}
return false;
}