summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/l_crawl.cc
diff options
context:
space:
mode:
authorRaphael Langella <raphael.langella@gmail.com>2012-09-24 21:27:49 +0200
committerRaphael Langella <raphael.langella@gmail.com>2012-09-24 21:27:49 +0200
commitef187830f0fa2275001ec4dd5aaa70aab9b48e5e (patch)
tree0483149f092da8b7ed50d2c1f1a63b446d52a783 /crawl-ref/source/l_crawl.cc
parentbccc4d36c1001773a408df19251698085b9f8162 (diff)
downloadcrawl-ref-ef187830f0fa2275001ec4dd5aaa70aab9b48e5e.tar.gz
crawl-ref-ef187830f0fa2275001ec4dd5aaa70aab9b48e5e.zip
Add a lua call to check for touch UI.
Can be useful to share a config file between desktop and android version.
Diffstat (limited to 'crawl-ref/source/l_crawl.cc')
-rw-r--r--crawl-ref/source/l_crawl.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/crawl-ref/source/l_crawl.cc b/crawl-ref/source/l_crawl.cc
index 63cf420dd6..fefcec7909 100644
--- a/crawl-ref/source/l_crawl.cc
+++ b/crawl-ref/source/l_crawl.cc
@@ -683,6 +683,17 @@ static int crawl_is_webtiles(lua_State *ls)
return 1;
}
+static int crawl_is_touch_ui(lua_State *ls)
+{
+#ifdef TOUCH_UI
+ lua_pushboolean(ls, true);
+#else
+ lua_pushboolean(ls, false);
+#endif
+
+ return 1;
+}
+
static int crawl_get_command(lua_State *ls)
{
if (lua_gettop(ls) == 0)
@@ -915,6 +926,7 @@ static const struct luaL_reg crawl_clib[] =
{ "stat_gain_prompt", crawl_stat_gain_prompt },
{ "is_tiles", crawl_is_tiles },
{ "is_webtiles", crawl_is_webtiles },
+ { "is_touch_ui", crawl_is_touch_ui },
{ "err_trace", crawl_err_trace },
{ "get_command", crawl_get_command },
{ "endgame", crawl_endgame },