diff --git a/src/buttons.c b/src/buttons.c index a6a92256..28661e20 100644 --- a/src/buttons.c +++ b/src/buttons.c @@ -5208,12 +5208,14 @@ void Button_Text(int btn) } clicked_button=Window_clicked_button(); + if (Quit_is_required) + clicked_button = 12; // cancel if (clicked_button==0) { if (Is_shortcut(Key,0x100+BUTTON_HELP)) Window_help(BUTTON_TEXT, NULL); else if (Is_shortcut(Key,0x100+BUTTON_TEXT)) - clicked_button=12; + clicked_button = 12; // cancel } switch(clicked_button) { diff --git a/src/factory.c b/src/factory.c index babc3742..317464cc 100644 --- a/src/factory.c +++ b/src/factory.c @@ -1155,6 +1155,8 @@ int L_InputBox(lua_State* L) while (!close_window) { + if (Quit_is_required) + close_window = CONTROL_CANCEL; clicked_button=Window_clicked_button(); if (clicked_button>0) { @@ -1338,7 +1340,7 @@ int L_SelectBox(lua_State* L) do { clicked_button=Window_clicked_button(); - } while (clicked_button<1 && Key != KEY_ESC); + } while (clicked_button<1 && Key != KEY_ESC && !Quit_is_required); Close_window(); Cursor_shape=CURSOR_SHAPE_HOURGLASS; @@ -2839,8 +2841,10 @@ void Button_Brush_Factory(void) break; } - } while (clicked_button != 1 && clicked_button != 5); - + } while (clicked_button != 1 && clicked_button != 5 && !Quit_is_required); + + if (Quit_is_required) + clicked_button = 1; // Cancel if (clicked_button==1) break; diff --git a/src/filesel.c b/src/filesel.c index 8e5603c3..c5a369ad 100644 --- a/src/filesel.c +++ b/src/filesel.c @@ -2637,7 +2637,7 @@ byte Button_Load_or_Save(T_Selector_settings *settings, byte load, T_IO_Context Timer_state=2; // On arrĂȘte le chrono } } - while ( (!has_clicked_ok) && (clicked_button!=2) ); + while ( (!has_clicked_ok) && (clicked_button!=2) && !Quit_is_required); if (has_clicked_ok) { diff --git a/src/transform.c b/src/transform.c index 4963a2e8..1c71d3c5 100644 --- a/src/transform.c +++ b/src/transform.c @@ -337,7 +337,7 @@ void Button_Transform_menu(int btn) break; } } - while (clicked_button<=0 || clicked_button>=8); + while ((clicked_button<=0 || clicked_button>=8) && !Quit_is_required); Close_window(); @@ -345,7 +345,7 @@ void Button_Transform_menu(int btn) if (Current_operation != OPERATION_SCROLL) Unselect_button(btn); - if (clicked_button != 1) // 1 is Cancel + if (clicked_button != 1 && !Quit_is_required) // 1 is Cancel { short old_width; short old_height;