Skip to content

Commit

Permalink
change to use language strings for MIN/MAX instead of instance
Browse files Browse the repository at this point in the history
updated CN and TX language file for MIN�use -RESX for MIN instead of magi number�code cleanup
  • Loading branch information
mha1 committed Aug 5, 2023
1 parent af57d0f commit 32606b3
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
4 changes: 1 addition & 3 deletions radio/src/gui/gui_common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -313,9 +313,7 @@ bool isSourceAvailableInInputs(int source)
if (source >= MIXSRC_FIRST_SPACEMOUSE && source <= MIXSRC_LAST_SPACEMOUSE)
return true;
#endif
if (source == MIXSRC_MIN)
return true;
if (source == MIXSRC_MAX)
if (source == MIXSRC_MIN || source == MIXSRC_MAX)
return true;

if (source >= MIXSRC_FIRST_TRIM && source <= MIXSRC_LAST_TRIM) {
Expand Down
2 changes: 1 addition & 1 deletion radio/src/mixer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ getvalue_t getValue(mixsrc_t i, bool* valid)
#endif

else if (i == MIXSRC_MIN) {
return -1024;
return -RESX;
}
else if (i == MIXSRC_MAX) {
return RESX;
Expand Down
4 changes: 2 additions & 2 deletions radio/src/strhelpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -700,10 +700,10 @@ char *getSourceString(char (&dest)[L], mixsrc_t idx)
}
#endif
else if (idx == MIXSRC_MIN) {
copyToTerminated(dest, "MIN");
strncpy(dest, STR_MENU_MIN, dest_len - 1);
}
else if (idx == MIXSRC_MAX) {
copyToTerminated(dest, "MAX");
strncpy(dest, STR_MENU_MAX, dest_len - 1);
} else if (idx <= MIXSRC_LAST_HELI) {
idx -= MIXSRC_FIRST_HELI;
getStringAtIndex(dest, STR_CYC_VSRCRAW, idx);
Expand Down
2 changes: 1 addition & 1 deletion radio/src/translations/tw.h
Original file line number Diff line number Diff line change
Expand Up @@ -1096,7 +1096,7 @@
#define TR_MENU_LUA STR_CHAR_LUA "LUA腳本"
#define TR_MENU_STICKS STR_CHAR_STICK "搖桿"
#define TR_MENU_POTS STR_CHAR_POT "旋鈕"
#define TR_MENU_MIN STR_CHAR_FUNCTION ""固定值MIN"
#define TR_MENU_MIN STR_CHAR_FUNCTION "固定值MIN"
#define TR_MENU_MAX STR_CHAR_FUNCTION "固定值MAX"
#define TR_MENU_HELI STR_CHAR_CYC "斜盤混控CYC"
#define TR_MENU_TRIMS STR_CHAR_TRIM "微調"
Expand Down

0 comments on commit 32606b3

Please sign in to comment.