mirror of
https://github.com/opentx/opentx.git
synced 2025-07-24 00:35:18 +03:00
Fixes #1540: added Lua playDuration()
This commit is contained in:
parent
07728782c8
commit
e13f2913df
1 changed files with 9 additions and 0 deletions
|
@ -283,6 +283,14 @@ static int luaPlayNumber(lua_State *L)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int luaPlayDuration(lua_State *L)
|
||||||
|
{
|
||||||
|
int duration = luaL_checkinteger(L, 1);
|
||||||
|
bool playTime = (luaL_checkinteger(L, 2) != 0);
|
||||||
|
playDuration(duration, playTime ? PLAY_TIME : 0, 0);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static int luaKillEvents(lua_State *L)
|
static int luaKillEvents(lua_State *L)
|
||||||
{
|
{
|
||||||
int event = luaL_checkinteger(L, 1);
|
int event = luaL_checkinteger(L, 1);
|
||||||
|
@ -1363,6 +1371,7 @@ void luaInit()
|
||||||
|
|
||||||
lua_register(L, "playFile", luaPlayFile);
|
lua_register(L, "playFile", luaPlayFile);
|
||||||
lua_register(L, "playNumber", luaPlayNumber);
|
lua_register(L, "playNumber", luaPlayNumber);
|
||||||
|
lua_register(L, "playDuration", luaPlayDuration);
|
||||||
lua_register(L, "popupInput", luaPopupInput);
|
lua_register(L, "popupInput", luaPopupInput);
|
||||||
lua_register(L, "defaultStick", luaDefaultStick);
|
lua_register(L, "defaultStick", luaDefaultStick);
|
||||||
lua_register(L, "defaultChannel", luaDefaultChannel);
|
lua_register(L, "defaultChannel", luaDefaultChannel);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue