feat(color): show global variable names in UI (#5526)
This commit is contained in:
@@ -334,7 +334,7 @@ class GVarEditWindow : public Page
|
|||||||
refreshTitle = false;
|
refreshTitle = false;
|
||||||
lastFlightMode = curFM;
|
lastFlightMode = curFM;
|
||||||
lastGVar = fmData->gvars[index];
|
lastGVar = fmData->gvars[index];
|
||||||
sprintf(label, "%s%d=", STR_GV, index + 1);
|
sprintf(label, "%s=", getSourceString(index + MIXSRC_FIRST_GVAR));
|
||||||
if (lastGVar > GVAR_MAX) {
|
if (lastGVar > GVAR_MAX) {
|
||||||
uint8_t fm = lastGVar - GVAR_MAX - 1;
|
uint8_t fm = lastGVar - GVAR_MAX - 1;
|
||||||
if (fm >= curFM) fm++;
|
if (fm >= curFM) fm++;
|
||||||
@@ -425,7 +425,7 @@ class GVarEditWindow : public Page
|
|||||||
|
|
||||||
new StaticText(line, rect_t{}, STR_NAME);
|
new StaticText(line, rect_t{}, STR_NAME);
|
||||||
grid.nextCell();
|
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);
|
line = window->newLine(grid);
|
||||||
|
|
||||||
|
|||||||
@@ -511,7 +511,7 @@ void FunctionEditPage::updateSpecialFunctionOneWindow()
|
|||||||
auto gvarchoice = new Choice(line, rect_t{}, 0, MAX_GVARS - 1,
|
auto gvarchoice = new Choice(line, rect_t{}, 0, MAX_GVARS - 1,
|
||||||
GET_SET_DEFAULT(CFN_GVAR_INDEX(cfn)));
|
GET_SET_DEFAULT(CFN_GVAR_INDEX(cfn)));
|
||||||
gvarchoice->setTextHandler([](int32_t value) {
|
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);
|
line = specialFunctionOneWindow->newLine(grid);
|
||||||
|
|
||||||
@@ -560,7 +560,7 @@ void FunctionEditPage::updateSpecialFunctionOneWindow()
|
|||||||
auto gvarchoice = new Choice(line, rect_t{}, 0, MAX_GVARS - 1,
|
auto gvarchoice = new Choice(line, rect_t{}, 0, MAX_GVARS - 1,
|
||||||
GET_SET_DEFAULT(CFN_PARAM(cfn)));
|
GET_SET_DEFAULT(CFN_PARAM(cfn)));
|
||||||
gvarchoice->setTextHandler([](int32_t value) {
|
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(
|
gvarchoice->setAvailableHandler(
|
||||||
[=](int value) { return CFN_GVAR_INDEX(cfn) != value; });
|
[=](int value) { return CFN_GVAR_INDEX(cfn) != value; });
|
||||||
|
|||||||
Reference in New Issue
Block a user