MCPcopy Create free account
hub / github.com/KikoPlayProject/KikoPlay / allScripts

Method allScripts

Extension/Modules/lua_util.cpp:395–421  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

393}
394
395int 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
423int LuaUtil::sleep(lua_State *L)
424{

Callers

nothing calls this directly

Calls 10

ScriptTypeEnum · 0.85
lua_pushnilFunction · 0.85
pushValueFunction · 0.85
isNullMethod · 0.80
appendMethod · 0.45
idMethod · 0.45
nameMethod · 0.45
versionMethod · 0.45
descMethod · 0.45
getValueMethod · 0.45

Tested by

no test coverage detected