feat(color): show global variable names in UI (#5526)
This commit is contained in:
@@ -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; });
|
||||
|
||||
Reference in New Issue
Block a user