diff --git a/src/mn_menu.c b/src/mn_menu.c index 223b8006..4323fe2f 100644 --- a/src/mn_menu.c +++ b/src/mn_menu.c @@ -101,7 +101,7 @@ static int saveCharIndex; // which char we're editing static char saveOldString[SAVESTRINGSIZE]; boolean menuactive; // The menus are up - +static boolean mouse_active_thermo; static boolean options_active; backdrop_t menu_backdrop; @@ -2158,6 +2158,7 @@ static void M_Setup(int choice) void MN_ClearMenus(void) { menuactive = 0; + mouse_active_thermo = false; options_active = false; print_warning_about_changes = 0; // killough 8/15/98 default_verify = 0; // killough 10/98 @@ -2844,18 +2845,16 @@ static boolean MouseResponder(void) return false; } - static boolean active_thermo; - if (M_InputActivated(input_menu_enter)) { - active_thermo = true; + mouse_active_thermo = true; } else if (M_InputDeactivated(input_menu_enter)) { - active_thermo = false; + mouse_active_thermo = false; } - if (active_thermo) + if (mouse_active_thermo) { int dot = mouse_state_x - (rect->x + M_THRM_STEP + video.deltaw); int step = M_MAX_VOL * FRACUNIT / (rect->w - M_THRM_STEP * 3); diff --git a/src/mn_setup.c b/src/mn_setup.c index a28bf2a5..a695885c 100644 --- a/src/mn_setup.c +++ b/src/mn_setup.c @@ -4474,6 +4474,13 @@ boolean MN_SetupResponder(menu_action_t action, int ch) if (action == MENU_ESCAPE || action == MENU_BACKSPACE) { + if (active_thermo && setup_cancel != -1) + { + default_t *def = active_thermo->var.def; + *def->location.i = setup_cancel; + setup_cancel = -1; + } + SetItemOn(set_item_on); SetPageIndex(current_page); @@ -4591,6 +4598,7 @@ boolean MN_SetupMouseResponder(int x, int y) } } active_thermo = NULL; + setup_cancel = -1; } if (M_InputActivated(input_menu_enter)) @@ -4623,6 +4631,11 @@ boolean MN_SetupMouseResponder(int x, int y) if (M_InputActivated(input_menu_enter)) { active_thermo = current_item; + + if (flags & S_ACTION && setup_cancel == -1) + { + setup_cancel = *def->location.i; + } } }