From bf09116059d7a712b42a0a352df54a4057b40fa6 Mon Sep 17 00:00:00 2001 From: Magnus Auvinen Date: Tue, 21 Oct 2008 18:25:28 +0000 Subject: fixed esc key that I broke recently --- src/game/client/components/menus.cpp | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/src/game/client/components/menus.cpp b/src/game/client/components/menus.cpp index 2fe150e4..e4351260 100644 --- a/src/game/client/components/menus.cpp +++ b/src/game/client/components/menus.cpp @@ -930,23 +930,22 @@ bool MENUS::on_input(INPUT_EVENT e) { last_input = time_get(); - if(is_active()) + // special handle esc and enter for popup purposes + if(e.flags&INPFLAG_PRESS) { - // special handle esc and enter for popup purposes - if(e.flags&INPFLAG_PRESS) + if(e.key == KEY_ESC) { - if(e.key == KEY_ESC) - { - escape_pressed = true; - set_active(!is_active()); - return true; - } - else if(e.key == KEY_ENTER) - { - enter_pressed = true; - return true; - } + escape_pressed = true; + set_active(!is_active()); + return true; } + } + + if(is_active()) + { + // special for popups + if(e.flags&INPFLAG_PRESS || e.key == KEY_ENTER) + enter_pressed = true; if(num_inputevents < MAX_INPUTEVENTS) inputevents[num_inputevents++] = e; -- cgit 1.4.1