| 55 | static int32_t interfacePct = 100; |
| 56 | |
| 57 | static void overlay_interpose_lua(const char *fn_name, int nargs = 0, int nres = 0, |
| 58 | Lua::LuaLambda && args_lambda = Lua::DEFAULT_LUA_LAMBDA, |
| 59 | Lua::LuaLambda && res_lambda = Lua::DEFAULT_LUA_LAMBDA) { |
| 60 | DEBUG(event).print("calling overlay lua function: '{}'\n", fn_name); |
| 61 | |
| 62 | color_ostream & out = Core::getInstance().getConsole(); |
| 63 | auto L = DFHack::Core::getInstance().getLuaState(); |
| 64 | |
| 65 | auto & core = Core::getInstance(); |
| 66 | auto & counters = core.perf_counters; |
| 67 | uint32_t start_ms = core.p->getTickCount(); |
| 68 | |
| 69 | Lua::CallLuaModuleFunction(out, L, "plugins.overlay", fn_name, nargs, nres, |
| 70 | std::forward<Lua::LuaLambda&&>(args_lambda), |
| 71 | std::forward<Lua::LuaLambda&&>(res_lambda)); |
| 72 | |
| 73 | counters.incCounter(counters.total_overlay_ms, start_ms); |
| 74 | } |
| 75 | |
| 76 | template<class T> |
| 77 | struct viewscreen_overlay : T { |
no test coverage detected