Fix trainer SF

This commit is contained in:
3djc
2021-04-05 08:46:57 +02:00
parent 766c1f6b79
commit 8ccf3c0437
+12 -3
View File
@@ -82,11 +82,20 @@ class SpecialFunctionEditPage : public Page {
grid.nextLine();
break;
case FUNC_TRAINER:
new StaticText(specialFunctionOneWindow, grid.getLabelSlot(), STR_TIMER);
new SourceChoice(specialFunctionOneWindow, grid.getFieldSlot(), 0, 4, GET_SET_DEFAULT(CFN_TIMER_INDEX(cfn)));
case FUNC_TRAINER: {
new StaticText(specialFunctionOneWindow, grid.getLabelSlot(), STR_VALUE);
auto choice = new Choice(specialFunctionOneWindow, grid.getFieldSlot(), 0,NUM_STICKS + 1,GET_SET_DEFAULT(CFN_PARAM(cfn)));
choice->setTextHandler([=](int32_t value) {
if (value == 0)
return std::string(STR_STICKS);
else if (value == NUM_STICKS + 1)
return std::string(STR_CHANS);
else
return TEXT_AT_INDEX(STR_VSRCRAW, value);;
});
grid.nextLine();
break;
}
case FUNC_RESET:
if (CFN_PARAM(cfn) < FUNC_RESET_PARAM_FIRST_TELEM) {