menu_toggle

This commit is contained in:
p.kosyh 2011-04-12 11:34:50 +00:00
parent 4e25d88936
commit e1b44b6c26
3 changed files with 8 additions and 2 deletions

View file

@ -22,7 +22,6 @@ static char *last_cmd = NULL;
void game_cursor(int on); void game_cursor(int on);
void mouse_reset(int hl); void mouse_reset(int hl);
static void menu_toggle(void);
void game_err_msg(const char *s) void game_err_msg(const char *s)
{ {
@ -2011,7 +2010,7 @@ void mouse_reset(int hl)
} }
static void menu_toggle(void) void menu_toggle(void)
{ {
mouse_reset(1); mouse_reset(1);
menu_shown ^= 1; menu_shown ^= 1;

View file

@ -80,6 +80,7 @@ extern int game_from_disk(void);
extern int game_pict_modify(img_t p); extern int game_pict_modify(img_t p);
extern int game_pict_coord(int *x, int *y, int *w, int *h); extern int game_pict_coord(int *x, int *y, int *w, int *h);
extern void menu_toggle(void);
#define CURSOR_CLEAR -1 #define CURSOR_CLEAR -1
#define CURSOR_OFF 0 #define CURSOR_OFF 0

View file

@ -1146,6 +1146,11 @@ static int luaB_free_sprite(lua_State *L) {
return 1; return 1;
} }
static int luaB_show_menu(lua_State *L) {
menu_toggle();
return 0;
}
static int luaB_free_font(lua_State *L) { static int luaB_free_font(lua_State *L) {
const char *key = luaL_optstring(L, 1, NULL); const char *key = luaL_optstring(L, 1, NULL);
_fnt_t *fn; _fnt_t *fn;
@ -1173,6 +1178,7 @@ static const luaL_Reg base_funcs[] = {
{"set_timer", luaB_set_timer}, {"set_timer", luaB_set_timer},
{"theme_var", luaB_theme_var}, {"theme_var", luaB_theme_var},
{"readdir", dir_iter_factory}, {"readdir", dir_iter_factory},
{"menu_toggle", luaB_show_menu},
{"font_load", luaB_load_font}, {"font_load", luaB_load_font},
{"font_free", luaB_free_font}, {"font_free", luaB_free_font},