From 8be6818a6d90d8d6d75caf6dff96deb02b58e526 Mon Sep 17 00:00:00 2001 From: 3djc Date: Fri, 26 Jan 2018 18:56:02 +0100 Subject: [PATCH] Fix custom scripts outputs handling (#5601) --- radio/src/gui/128x64/model_custom_scripts.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/radio/src/gui/128x64/model_custom_scripts.cpp b/radio/src/gui/128x64/model_custom_scripts.cpp index 75a1d5e5a..e63e57e5f 100644 --- a/radio/src/gui/128x64/model_custom_scripts.cpp +++ b/radio/src/gui/128x64/model_custom_scripts.cpp @@ -61,7 +61,7 @@ void menuModelCustomScriptOne(event_t event) drawStringWithIndex(PSIZE(TR_MENUCUSTOMSCRIPTS)*FW+FW, 0, "LUA", s_currIdx+1, 0); lcdDrawFilledRect(0, 0, LCD_W, FH, SOLID, 0); - SUBMENU(STR_MENUCUSTOMSCRIPTS, 3+scriptInputsOutputs[s_currIdx].inputsCount+scriptInputsOutputs[s_currIdx].outputsCount, { 0, 0, LABEL(inputs), 0/*repeated*/ }); + SUBMENU(STR_MENUCUSTOMSCRIPTS, 3+scriptInputsOutputs[s_currIdx].inputsCount+scriptInputsOutputs[s_currIdx].outputsCount + 1 /*outputs label*/, { 0, 0, LABEL(inputs), 0/*repeated*/ }); int8_t sub = menuVerticalPosition; @@ -114,11 +114,14 @@ void menuModelCustomScriptOne(event_t event) } else if (i == ITEM_MODEL_CUSTOMSCRIPT_PARAMS_LABEL+scriptInputsOutputs[s_currIdx].inputsCount+1) { lcdDrawTextAlignedLeft(y, STR_OUTPUTS); + if (attr) { + REPEAT_LAST_CURSOR_MOVE(); + } } else if (i <= ITEM_MODEL_CUSTOMSCRIPT_PARAMS_LABEL+scriptInputsOutputs[s_currIdx].inputsCount+scriptInputsOutputs[s_currIdx].outputsCount+1) { int outputIdx = i-(ITEM_MODEL_CUSTOMSCRIPT_PARAMS_LABEL+scriptInputsOutputs[s_currIdx].inputsCount)-2; lcdDrawSizedText(INDENT_WIDTH, y, scriptInputsOutputs[s_currIdx].outputs[outputIdx].name, 10, 0); - lcdDrawNumber(SCRIPT_ONE_2ND_COLUMN_POS, y, calcRESXto1000(scriptInputsOutputs[s_currIdx].outputs[outputIdx].value), PREC1|LEFT); + lcdDrawNumber(SCRIPT_ONE_2ND_COLUMN_POS, y, calcRESXto1000(scriptInputsOutputs[s_currIdx].outputs[outputIdx].value), attr|PREC1|LEFT); } } }