diff --git a/src/gui/luainstance.cpp b/src/gui/luainstance.cpp index e98fca087..2662476df 100644 --- a/src/gui/luainstance.cpp +++ b/src/gui/luainstance.cpp @@ -471,6 +471,7 @@ void CLuaInstance::runScript(const char *fileName, std::vector *arg if (error_string) *error_string = std::string(lua_tostring(lua, -1)); } + g_Zapit->setStandby(false); } // Example: runScript(fileName, "Arg1", "Arg2", "Arg3", ..., NULL); @@ -523,6 +524,7 @@ const luaL_Reg CLuaInstance::methods[] = { "setBlank", CLuaInstance::setBlank }, { "ShowPicture", CLuaInstance::ShowPicture }, { "StopPicture", CLuaInstance::StopPicture }, + { "zapitSetStandby", CLuaInstance::zapitSetStandby }, { "Blit", CLuaInstance::Blit }, { "GetLanguage", CLuaInstance::GetLanguage }, { "runScript", CLuaInstance::runScriptExt }, @@ -712,6 +714,16 @@ int CLuaInstance::StopPicture(lua_State */*L*/) return 0; } +int CLuaInstance::zapitSetStandby(lua_State *L) +{ + bool standby = true; + int numargs = lua_gettop(L); + if (numargs > 1) + standby = _luaL_checkbool(L, 2); + g_Zapit->setStandby(standby); + return 0; +} + int CLuaInstance::PlayFile(lua_State *L) { printf("CLuaInstance::%s %d\n", __func__, lua_gettop(L)); diff --git a/src/gui/luainstance.h b/src/gui/luainstance.h index e670b2237..58a346822 100644 --- a/src/gui/luainstance.h +++ b/src/gui/luainstance.h @@ -34,7 +34,7 @@ extern "C" { #include #define LUA_API_VERSION_MAJOR 1 -#define LUA_API_VERSION_MINOR 6 +#define LUA_API_VERSION_MINOR 7 /* this is stored as userdata in the lua_State */ struct CLuaData @@ -230,6 +230,7 @@ private: static int setBlank(lua_State *L); static int ShowPicture(lua_State *L); static int StopPicture(lua_State *L); + static int zapitSetStandby(lua_State *L); static int PlayFile(lua_State *L); static int strFind(lua_State *L);