diff options
| author | Magnus Auvinen <magnus.auvinen@gmail.com> | 2008-10-21 18:21:55 +0000 |
|---|---|---|
| committer | Magnus Auvinen <magnus.auvinen@gmail.com> | 2008-10-21 18:21:55 +0000 |
| commit | daf9a100eb03846f4ebe0de19361dcfab25d0b28 (patch) | |
| tree | 953d23915862ebeb05319e44b96f03a4051c7c82 | |
| parent | d3f7de62f1b7503a7789fdc95d9fefcdeaabc305 (diff) | |
| download | zcatch-daf9a100eb03846f4ebe0de19361dcfab25d0b28.tar.gz zcatch-daf9a100eb03846f4ebe0de19361dcfab25d0b28.zip | |
fixed error when menu takes over enter key
| -rw-r--r-- | src/game/client/components/menus.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/game/client/components/menus.cpp b/src/game/client/components/menus.cpp index 7a639429..2fe150e4 100644 --- a/src/game/client/components/menus.cpp +++ b/src/game/client/components/menus.cpp @@ -930,24 +930,24 @@ bool MENUS::on_input(INPUT_EVENT e) { last_input = time_get(); - // special handle esc and enter for popup purposes - if(e.flags&INPFLAG_PRESS) + if(is_active()) { - if(e.key == KEY_ESC) - { - escape_pressed = true; - set_active(!is_active()); - return true; - } - else if(e.key == KEY_ENTER) + // special handle esc and enter for popup purposes + if(e.flags&INPFLAG_PRESS) { - enter_pressed = true; - return true; + 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; + } } - } - - if(is_active()) - { + if(num_inputevents < MAX_INPUTEVENTS) inputevents[num_inputevents++] = e; return true; |