mirror of
https://github.com/fabiangreffrath/woof.git
synced 2025-09-22 11:22:18 -04:00
Fix mouse driven thermos (#2207)
* Deactivate mouse driven thermo when clearing menu * Restore value of mouse driven, deferred action thermos when canceled
This commit is contained in:
parent
2f21b4e7cf
commit
0f2363c19d
@ -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);
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user