diff --git a/src/sdl-instead/game.c b/src/sdl-instead/game.c index fb7e181..407b913 100644 --- a/src/sdl-instead/game.c +++ b/src/sdl-instead/game.c @@ -22,7 +22,6 @@ static char *last_cmd = NULL; void game_cursor(int on); void mouse_reset(int hl); -static void menu_toggle(void); 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); menu_shown ^= 1; diff --git a/src/sdl-instead/game.h b/src/sdl-instead/game.h index a27cdce..9831a2b 100644 --- a/src/sdl-instead/game.h +++ b/src/sdl-instead/game.h @@ -80,6 +80,7 @@ extern int game_from_disk(void); extern int game_pict_modify(img_t p); extern int game_pict_coord(int *x, int *y, int *w, int *h); +extern void menu_toggle(void); #define CURSOR_CLEAR -1 #define CURSOR_OFF 0 diff --git a/src/sdl-instead/instead.c b/src/sdl-instead/instead.c index 00ac545..fcd62f1 100644 --- a/src/sdl-instead/instead.c +++ b/src/sdl-instead/instead.c @@ -1146,6 +1146,11 @@ static int luaB_free_sprite(lua_State *L) { return 1; } +static int luaB_show_menu(lua_State *L) { + menu_toggle(); + return 0; +} + static int luaB_free_font(lua_State *L) { const char *key = luaL_optstring(L, 1, NULL); _fnt_t *fn; @@ -1173,6 +1178,7 @@ static const luaL_Reg base_funcs[] = { {"set_timer", luaB_set_timer}, {"theme_var", luaB_theme_var}, {"readdir", dir_iter_factory}, + {"menu_toggle", luaB_show_menu}, {"font_load", luaB_load_font}, {"font_free", luaB_free_font},