| 393 | } |
| 394 | |
| 395 | int LuaUtil::allScripts(lua_State *L) |
| 396 | { |
| 397 | QVariant info; |
| 398 | QMetaObject::invokeMethod(GlobalObjects::scriptManager, [&](){ |
| 399 | QVariantList scriptList; |
| 400 | for (int i = 0; i < ScriptType::UNKNOWN_STYPE; ++i) |
| 401 | { |
| 402 | auto type = ScriptType(i); |
| 403 | for (const auto &s: GlobalObjects::scriptManager->scripts(type)) |
| 404 | { |
| 405 | scriptList.append(QVariantMap{ |
| 406 | {"type", i}, |
| 407 | {"id", s->id()}, |
| 408 | {"name", s->name()}, |
| 409 | {"version", s->version()}, |
| 410 | {"desc", s->desc()}, |
| 411 | {"path", s->getValue("path")}, |
| 412 | {"min_kiko", s->getValue("min_kiko")}, |
| 413 | }); |
| 414 | } |
| 415 | } |
| 416 | info = scriptList; |
| 417 | }, QThread::currentThread() == GlobalObjects::scriptManager->thread()? Qt::DirectConnection : Qt::BlockingQueuedConnection); |
| 418 | if (info.isNull()) lua_pushnil(L); |
| 419 | else ScriptBase::pushValue(L, info); |
| 420 | return 1; |
| 421 | } |
| 422 | |
| 423 | int LuaUtil::sleep(lua_State *L) |
| 424 | { |
nothing calls this directly
no test coverage detected