Skip to content

Commit

Permalink
Fix multiple choice
Browse files Browse the repository at this point in the history
  • Loading branch information
3d-gussner committed Dec 16, 2024
1 parent d3f9559 commit 7e3d1c2
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions Firmware/ultralcd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2266,11 +2266,25 @@ void show_preheat_nozzle_warning()

void lcd_load_filament_color_check()
{
uint8_t clean = lcd_show_multiscreen_message_with_choices_and_wait_P(_T(MSG_FILAMENT_CLEAN), false, LCD_LEFT_BUTTON_CHOICE, _T(MSG_YES), _T(MSG_NO), _T(MSG_EJECT), 8);
// The total length of the individual messages MSG_YES c=4, MSG_NO c=4 and MSG_EJECT c=8 with the selectors and spaces between
// exceeds the LCD width.
// 01234567890123456789
// >yyyy >nnnn >eeeeeeee
// As long the translations of MSG_YES, MSG_NO and MSG_EJECT combined length do not exceed 15 chars, we don't have to shorten
// the MSG_EJECT message/translation. We can set the second_col value to the length of the first choice + the selector and space.
// Examples:
// German
// 01234567890123456789
// >Ja >Nein >Auswerf.
// Hungarian
// 01234567890123456789
// >Igen >Nem >Kiadás

uint8_t clean = lcd_show_multiscreen_message_with_choices_and_wait_P(_T(MSG_FILAMENT_CLEAN), false, LCD_LEFT_BUTTON_CHOICE, _T(MSG_YES), _T(MSG_NO), _T(MSG_EJECT), strlen_P(_T(MSG_YES))+2);
while (clean == LCD_MIDDLE_BUTTON_CHOICE) {
load_filament_final_feed();
st_synchronize();
clean = lcd_show_multiscreen_message_with_choices_and_wait_P(_T(MSG_FILAMENT_CLEAN), false, LCD_LEFT_BUTTON_CHOICE, _T(MSG_YES), _T(MSG_NO), _T(MSG_EJECT), 8);
clean = lcd_show_multiscreen_message_with_choices_and_wait_P(_T(MSG_FILAMENT_CLEAN), false, LCD_LEFT_BUTTON_CHOICE, _T(MSG_YES), _T(MSG_NO), _T(MSG_EJECT), strlen_P(_T(MSG_YES))+2);
}
if (clean == LCD_RIGHT_BUTTON_CHOICE) {
unload_filament(FILAMENTCHANGE_FINALRETRACT);
Expand Down

0 comments on commit 7e3d1c2

Please sign in to comment.