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

Method loadScriptMenus

Extension/Script/scriptbase.cpp:455–473  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

453}
454
455void ScriptBase::loadScriptMenus()
456{
457 scriptMenuItems.clear();
458 QVariant menus = get(scriptMenuTable); //[{title=xx, id=xx}...]
459 if(menus.type() == QVariant::List)
460 {
461 auto mlist = menus.toList();
462 for(auto &m : mlist)
463 {
464 if(m.type() == QVariant::Map)
465 {
466 auto mObj = m.toMap();
467 QString title = mObj.value("title").toString(), id =mObj.value("id").toString();
468 if(title.isEmpty() || id.isEmpty()) continue;
469 scriptMenuItems.append({title, id});
470 }
471 }
472 }
473}
474
475void ScriptBase::registerFuncs(const char *tname, const luaL_Reg *funcs)
476{

Callers

nothing calls this directly

Calls 7

valueMethod · 0.80
clearMethod · 0.45
typeMethod · 0.45
toMapMethod · 0.45
toStringMethod · 0.45
isEmptyMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected