Skip to content

Commit 6f910c2

Browse files
philmozpfeerick
authored andcommitted
fix(lua): add 'repetition' property to getCustomFunction and setCustomFunction tables (#4693)
1 parent 4fe5f2c commit 6f910c2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

radio/src/lua/api_model.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -1360,6 +1360,7 @@ Get Custom Function parameters
13601360
* `mode` (number) mode (only returned only returned if action is **not** play track, sound or script)
13611361
* `param` (number) parameter (only returned only returned if action is **not** play track, sound or script)
13621362
* `active` (number) 0 = disabled, 1 = enabled
1363+
* `repetition` (number) -1 to 60, range and meaning depend on function
13631364
13641365
@status current Introduced in 2.0.0, TODO rename function
13651366
*/
@@ -1380,6 +1381,7 @@ static int luaModelGetCustomFunction(lua_State *L)
13801381
lua_pushtableinteger(L, "param", cfn->all.param);
13811382
}
13821383
lua_pushtableinteger(L, "active", CFN_ACTIVE(cfn));
1384+
lua_pushtableinteger(L, "repetition", cfn->repeat);
13831385
}
13841386
else {
13851387
lua_pushnil(L);
@@ -1433,6 +1435,9 @@ static int luaModelSetCustomFunction(lua_State *L)
14331435
else if (!strcmp(key, "active")) {
14341436
CFN_ACTIVE(cfn) = luaL_checkinteger(L, -1);
14351437
}
1438+
else if (!strcmp(key, "repetition")) {
1439+
cfn->repeat = luaL_checkinteger(L, -1);
1440+
}
14361441
}
14371442
storageDirty(EE_MODEL);
14381443
}

0 commit comments

Comments
 (0)