fix: OSK DEF button was not setting Value inputs of mixer scripts correctly (#1536)

* The set/reset switches for a logical switch are only processed if the are valid.

* Revert "The set/reset switches for a logical switch are only processed if the are valid."

This reverts commit c238108415aec39f64ba6bae4c86cfb3ea4713bc.

* fix handling of default values in mixer scripts

* revised the use of default value to be consistent to the past usage

* Limited autoformatting

Co-authored-by: Peter Feerick <peter.feerick@gmail.com>
This commit is contained in:
Wilhelm
2022-02-04 21:53:14 +10:00
committed by GitHub
co-authored by Peter Feerick
parent 65ed80aa92
commit 5a4c6df594
2 changed files with 6 additions and 6 deletions
+4 -3
View File
@@ -1119,12 +1119,13 @@ static bool resumeLua(bool init, bool allowLcdUsage)
ScriptData & sd = g_model.scriptsData[ref - SCRIPT_MIX_FIRST];
ScriptInputsOutputs * sio = & scriptInputsOutputs[ref - SCRIPT_MIX_FIRST];
inputsCount = sio -> inputsCount;
for (int j = 0; j < inputsCount; j++) {
if (sio -> inputs[j].type == INPUT_TYPE_SOURCE)
if (sio->inputs[j].type == INPUT_TYPE_SOURCE)
luaGetValueAndPush(lsScripts, sd.inputs[j].source);
else
lua_pushinteger(lsScripts, sd.inputs[j].value + sio -> inputs[j].def);
lua_pushinteger(lsScripts,
sd.inputs[j].value + sio->inputs[j].def);
}
} else
#endif