feat: Add "Enable" button to all SF/GF (#3024) (#3601)

Co-authored-by: eshifri <eshifri@hotmail.com>
Co-authored-by: philmoz <philmoz@users.noreply.github.com>
This commit is contained in:
Peter Feerick
2023-12-03 12:23:34 +10:00
committed by GitHub
co-authored by eshifri philmoz
parent 878a365e72
commit ee73fa47f0
33 changed files with 262 additions and 194 deletions
+10 -9
View File
@@ -1129,15 +1129,16 @@ static bool resumeLua(bool init, bool allowLcdUsage)
functionsContext = &globalFunctionsContext;
}
tmr10ms_t tmr10ms = get_tmr10ms();
if (getSwitch(fn->swtch) && (functionsContext->lastFunctionTime[idx] == 0 || CFN_PLAY_REPEAT(fn) == 0)) {
lua_rawgeti(lsScripts, LUA_REGISTRYINDEX, sid.run);
functionsContext->lastFunctionTime[idx] = tmr10ms;
}
else {
if (sid.background == LUA_NOREF) continue;
lua_rawgeti(lsScripts, LUA_REGISTRYINDEX, sid.background);
if (CFN_ACTIVE(fn)) {
tmr10ms_t tmr10ms = get_tmr10ms();
if (getSwitch(fn->swtch) && (functionsContext->lastFunctionTime[idx] == 0 || CFN_PLAY_REPEAT(fn) == 0)) {
lua_rawgeti(lsScripts, LUA_REGISTRYINDEX, sid.run);
functionsContext->lastFunctionTime[idx] = tmr10ms;
}
else {
if (sid.background == LUA_NOREF) continue;
lua_rawgeti(lsScripts, LUA_REGISTRYINDEX, sid.background);
}
}
}
#if defined(PCBTARANIS)