feat(color): show global variable names in UI (#5526)

This commit is contained in:
philmoz
2024-09-11 16:24:40 +10:00
committed by GitHub
parent ecfa1e1b5b
commit 6e706c4b1c
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -334,7 +334,7 @@ class GVarEditWindow : public Page
refreshTitle = false;
lastFlightMode = curFM;
lastGVar = fmData->gvars[index];
sprintf(label, "%s%d=", STR_GV, index + 1);
sprintf(label, "%s=", getSourceString(index + MIXSRC_FIRST_GVAR));
if (lastGVar > GVAR_MAX) {
uint8_t fm = lastGVar - GVAR_MAX - 1;
if (fm >= curFM) fm++;
@@ -425,7 +425,7 @@ class GVarEditWindow : public Page
new StaticText(line, rect_t{}, STR_NAME);
grid.nextCell();
new ModelTextEdit(line, rect_t{}, gvar->name, LEN_GVAR_NAME);
new ModelTextEdit(line, rect_t{}, gvar->name, LEN_GVAR_NAME, [=]() { refreshTitle = true; });
line = window->newLine(grid);
@@ -511,7 +511,7 @@ void FunctionEditPage::updateSpecialFunctionOneWindow()
auto gvarchoice = new Choice(line, rect_t{}, 0, MAX_GVARS - 1,
GET_SET_DEFAULT(CFN_GVAR_INDEX(cfn)));
gvarchoice->setTextHandler([](int32_t value) {
return std::string(STR_GV) + std::to_string(value + 1);
return std::string(getSourceString(value + MIXSRC_FIRST_GVAR));
});
line = specialFunctionOneWindow->newLine(grid);
@@ -560,7 +560,7 @@ void FunctionEditPage::updateSpecialFunctionOneWindow()
auto gvarchoice = new Choice(line, rect_t{}, 0, MAX_GVARS - 1,
GET_SET_DEFAULT(CFN_PARAM(cfn)));
gvarchoice->setTextHandler([](int32_t value) {
return std::string(STR_GV) + std::to_string(value + 1);
return std::string(getSourceString(value + MIXSRC_FIRST_GVAR));
});
gvarchoice->setAvailableHandler(
[=](int value) { return CFN_GVAR_INDEX(cfn) != value; });