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:
@@ -112,9 +112,8 @@ class ScriptEditWindow : public Page {
|
|||||||
new StaticText(window, grid.getLabelSlot(true), si.name, 0, COLOR_THEME_PRIMARY1);
|
new StaticText(window, grid.getLabelSlot(true), si.name, 0, COLOR_THEME_PRIMARY1);
|
||||||
grid.nextLine();
|
grid.nextLine();
|
||||||
if (si.type == INPUT_TYPE_VALUE) {
|
if (si.type == INPUT_TYPE_VALUE) {
|
||||||
new NumberEdit(gInputs, inputsGrid.getSlot(), si.min - si.def,
|
(new NumberEdit(gInputs, inputsGrid.getSlot(), si.min, si.max,
|
||||||
si.max - si.def,
|
GET_SET_WITH_OFFSET(sd->inputs[i].value, si.def)))->setDefault(si.def);
|
||||||
GET_SET_WITH_OFFSET(sd->inputs[i].value, si.def));
|
|
||||||
} else {
|
} else {
|
||||||
new SourceChoice(gInputs, inputsGrid.getSlot(), 0,
|
new SourceChoice(gInputs, inputsGrid.getSlot(), 0,
|
||||||
MIXSRC_LAST_TELEM,
|
MIXSRC_LAST_TELEM,
|
||||||
|
|||||||
@@ -1121,10 +1121,11 @@ static bool resumeLua(bool init, bool allowLcdUsage)
|
|||||||
inputsCount = sio -> inputsCount;
|
inputsCount = sio -> inputsCount;
|
||||||
|
|
||||||
for (int j = 0; j < inputsCount; j++) {
|
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);
|
luaGetValueAndPush(lsScripts, sd.inputs[j].source);
|
||||||
else
|
else
|
||||||
lua_pushinteger(lsScripts, sd.inputs[j].value + sio -> inputs[j].def);
|
lua_pushinteger(lsScripts,
|
||||||
|
sd.inputs[j].value + sio->inputs[j].def);
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user