From aaefca67b304688efb0f4c893aab469d61f8f0bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Wed, 20 Apr 2016 19:20:12 +0200 Subject: vis-lua: trigger start event after ui has been initialized --- vis-lua.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'vis-lua.c') diff --git a/vis-lua.c b/vis-lua.c index 0c043fc..fb560ab 100644 --- a/vis-lua.c +++ b/vis-lua.c @@ -13,6 +13,7 @@ #if !CONFIG_LUA +void vis_lua_init(Vis *vis) { } void vis_lua_start(Vis *vis) { } void vis_lua_quit(Vis *vis) { } void vis_lua_file_open(Vis *vis, File *file) { } @@ -970,7 +971,7 @@ static bool vis_lua_path_add(Vis *vis, const char *path) { return true; } -void vis_lua_start(Vis *vis) { +void vis_lua_init(Vis *vis) { lua_State *L = luaL_newstate(); if (!L) return; @@ -1043,6 +1044,12 @@ void vis_lua_start(Vis *vis) { lua_getglobal(L, "require"); lua_pushstring(L, "visrc"); pcall(vis, L, 1, 0); +} + +void vis_lua_start(Vis *vis) { + lua_State *L = vis->lua; + if (!L) + return; vis_lua_event(vis, "start"); if (lua_isfunction(L, -1)) pcall(vis, L, 0, 0); -- cgit v1.2.3