ingame menu fixed

This commit is contained in:
Magnus Auvinen 2008-08-27 20:23:50 +00:00
parent ef0a301209
commit a47fe88d19
2 changed files with 13 additions and 6 deletions

View file

@ -1,9 +1,5 @@
#include <memory.h> // memcmp
extern "C" {
#include <engine/e_config.h>
}
#include <engine/e_client_interface.h>
#include <game/generated/g_protocol.hpp>
#include <game/generated/gc_data.hpp>

View file

@ -955,6 +955,16 @@ bool MENUS::on_mousemove(float x, float y)
bool MENUS::on_input(INPUT_EVENT e)
{
// if(e.)
//
if(e.flags&INPFLAG_PRESS && e.key == KEY_ESC)
{
menu_active = !menu_active;
return true;
}
if(menu_active)
return true;
return false;
}
@ -982,13 +992,14 @@ void MENUS::on_statechange(int new_state, int old_state)
{
popup = POPUP_NONE;
menu_active = false;
//menu_game_active = true;
//snapshot_count = 0;
}
}
void MENUS::on_render()
{
if(client_state() != CLIENTSTATE_ONLINE)
menu_active = true;
if(!menu_active)
return;