MCPcopy Create free account
hub / github.com/DFHack/dfhack / CallLuaModuleFunction

Function CallLuaModuleFunction

library/include/LuaTools.h:522–535  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

520 */
521 template<typename... aT>
522 bool CallLuaModuleFunction(
523 color_ostream &out, const char* module_name, const char* fn_name, std::tuple<aT...>&& args = {},
524 size_t nres = 0, Lua::LuaLambda && res_lambda = Lua::DEFAULT_LUA_LAMBDA)
525 {
526 auto L = DFHack::Core::getInstance().getLuaState();
527 bool ok;
528
529 ok = Lua::CallLuaModuleFunction(out, L, module_name, fn_name, sizeof...(aT), nres,
530 [&args](lua_State *L) {
531 std::apply([&L](auto&&... param){ ((Lua::Push(L, param)), ...); }, args);
532 },
533 std::forward<Lua::LuaLambda&&>(res_lambda));
534 return ok;
535 }
536
537 template<typename aT>
538 bool CallLuaModuleFunction(

Callers 15

loadModScriptPathsFunction · 0.85
run_dfhack_initFunction · 0.85
onStateChangeMethod · 0.85
enableMethod · 0.85
saveMethod · 0.85
df_autonestboxFunction · 0.85
prospectorFunction · 0.85
do_commandFunction · 0.85
do_commandFunction · 0.85
do_filterFunction · 0.85
sort_proxyFunction · 0.85
do_commandFunction · 0.85

Calls 2

PushFunction · 0.85
sizeMethod · 0.45

Tested by 3

prospectorFunction · 0.68
do_commandFunction · 0.68