From d7a55f1f50bf7eaefdaf7c5758430b68e733680a Mon Sep 17 00:00:00 2001 From: Bryan Hoyle Date: Sat, 30 Jul 2011 20:31:34 -0400 Subject: [PATCH] me4502 added tpt.throw_error and tpt.heat as lua commands --- includes/luaconsole.h | 2 ++ src/luaconsole.c | 17 +++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/includes/luaconsole.h b/includes/luaconsole.h index 55e2d47f5..53043f070 100644 --- a/includes/luaconsole.h +++ b/includes/luaconsole.h @@ -57,4 +57,6 @@ int luatpt_airheat(lua_State* l); int luatpt_active_menu(lua_State* l); int luatpt_decorations_enable(lua_State* l); int luatpt_cmode_set(lua_State* l); +int luatpt_error(lua_State* l); +int luatpt_heat(lua_State* l); #endif diff --git a/src/luaconsole.c b/src/luaconsole.c index c854d6751..02ec11b8b 100644 --- a/src/luaconsole.c +++ b/src/luaconsole.c @@ -42,6 +42,8 @@ void luacon_open(){ {"active_menu", &luatpt_active_menu}, {"decorations_enable", &luatpt_decorations_enable}, {"display_mode", &luatpt_cmode_set}, + {"throw_error", &luatpt_error}, + {"heat", &luatpt_heat}, {NULL,NULL} }; @@ -138,6 +140,13 @@ int luatpt_test(lua_State* l) printf("Test successful, got %d\n", testint); return 0; } +int luatpt_error(lua_State* l) +{ + char *error = ""; + error = luaL_optstring(l, 1, 0); + error_ui(vid_buf, 0, error); + return 0; +} int luatpt_drawtext(lua_State* l) { char *string; @@ -853,6 +862,14 @@ int luatpt_decorations_enable(lua_State* l) decorations_enable = (aheatstate==0?0:1); return 0; } + +int luatpt_heat(lua_State* l) +{ + int heatstate; + heatstate = luaL_optint(l, 1, 0); + legacy_enable = (heatstate==1?0:1); + return 0; +} int luatpt_cmode_set(lua_State* l) { int aheatstate;