From 6d802759d211c9f8e1f66deee6bdd86c79928c3c Mon Sep 17 00:00:00 2001 From: "p.kosyh" Date: Mon, 25 Jul 2011 19:58:31 +0000 Subject: [PATCH] theme_name added --- src/sdl-instead/instead.c | 8 ++++++++ stead/theme.lua | 3 +++ 2 files changed, 11 insertions(+) diff --git a/src/sdl-instead/instead.c b/src/sdl-instead/instead.c index 0c45281..7ecc48c 100644 --- a/src/sdl-instead/instead.c +++ b/src/sdl-instead/instead.c @@ -578,6 +578,13 @@ static int luaB_theme_var(lua_State *L) { return 0; } +static int luaB_theme_name(lua_State *L) { + if (game_own_theme && opt_owntheme) + return 0; + lua_pushstring(L, curtheme_dir); + return 1; +} + extern int dir_iter_factory (lua_State *L); extern int luaopen_lfs (lua_State *L); @@ -1549,6 +1556,7 @@ static const luaL_Reg base_funcs[] = { {"get_steadpath", luaB_get_steadpath}, {"set_timer", luaB_set_timer}, {"theme_var", luaB_theme_var}, + {"theme_name", luaB_theme_name}, {"readdir", dir_iter_factory}, {"menu_toggle", luaB_show_menu}, diff --git a/stead/theme.lua b/stead/theme.lua index cece535..4b20d92 100644 --- a/stead/theme.lua +++ b/stead/theme.lua @@ -33,6 +33,9 @@ theme = { theme.vars[name] = tostring(val); end end; + name = function() + return theme_name(name); + end; get = function(name) return theme_var(name); end;