Cleanup trigger_script_by_name() debug/error messages
This commit is contained in:
parent
734bb51384
commit
506a42daf3
@ -758,12 +758,14 @@ Editor::trigger_script_by_name (const std::string script_name)
|
|||||||
script_path = (*s)->path;
|
script_path = (*s)->path;
|
||||||
|
|
||||||
if (!Glib::file_test (script_path, Glib::FILE_TEST_EXISTS | Glib::FILE_TEST_IS_REGULAR)) {
|
if (!Glib::file_test (script_path, Glib::FILE_TEST_EXISTS | Glib::FILE_TEST_IS_REGULAR)) {
|
||||||
|
#ifndef NDEBUG
|
||||||
cerr << "Lua Script action: path to " << script_path << " does not appear to be valid" << endl;
|
cerr << "Lua Script action: path to " << script_path << " does not appear to be valid" << endl;
|
||||||
|
#endif
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
LuaState lua;
|
LuaState lua;
|
||||||
lua.Print.connect (&_lua_print); //ToDo
|
lua.Print.connect (&_lua_print);
|
||||||
lua.sandbox (false);
|
lua.sandbox (false);
|
||||||
lua_State* L = lua.getState();
|
lua_State* L = lua.getState();
|
||||||
LuaInstance::register_classes (L);
|
LuaInstance::register_classes (L);
|
||||||
@ -774,9 +776,6 @@ Editor::trigger_script_by_name (const std::string script_name)
|
|||||||
lua.do_file (script_path);
|
lua.do_file (script_path);
|
||||||
luabridge::LuaRef args (luabridge::newTable (L));
|
luabridge::LuaRef args (luabridge::newTable (L));
|
||||||
|
|
||||||
//ToDo: args?
|
|
||||||
// args["how_many"] = count;
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
luabridge::LuaRef fn = luabridge::getGlobal (L, "factory");
|
luabridge::LuaRef fn = luabridge::getGlobal (L, "factory");
|
||||||
if (fn.isFunction()) {
|
if (fn.isFunction()) {
|
||||||
@ -787,12 +786,12 @@ Editor::trigger_script_by_name (const std::string script_name)
|
|||||||
} catch (...) {
|
} catch (...) {
|
||||||
cerr << "Lua script failed: " << script_path << endl;
|
cerr << "Lua script failed: " << script_path << endl;
|
||||||
}
|
}
|
||||||
|
return;
|
||||||
continue; //script found; we're done
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#ifndef NDEBUG
|
||||||
cerr << "Lua script was not found: " << script_name << endl;
|
cerr << "Lua script was not found: " << script_name << endl;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
Loading…
Reference in New Issue
Block a user