From f064227b7accb6d88185b3bdaf92581f4d32e3c0 Mon Sep 17 00:00:00 2001 From: cracker64 Date: Fri, 22 Jul 2011 06:47:43 -0700 Subject: [PATCH] me4502 luaconsole functions, edited from github. --- src/luaconsole.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/src/luaconsole.c b/src/luaconsole.c index 22e528bc3..7f78949b8 100644 --- a/src/luaconsole.c +++ b/src/luaconsole.c @@ -36,6 +36,12 @@ void luacon_open(){ {"start_getPartIndex", &luatpt_start_getPartIndex}, {"next_getPartIndex", &luatpt_next_getPartIndex}, {"getPartIndex", &luatpt_getPartIndex}, + {"hud", &luatpt_hud}, + {"newtonian_gravity", &luatpt_gravity}, + {"ambient_heat", &luatpt_airheat}, + {"active_menu", &luatpt_active_menu}, + {"decorations_enable", &luatpt_decorations_enable}, + {"display_mode", &luatpt_cmode_set} {NULL,NULL} }; @@ -810,4 +816,50 @@ int luatpt_getPartIndex(lua_State* l) lua_pushinteger(l, getPartIndex_curIdx); return 1; } +int luatpt_hud(lua_State* l) +{ + int hudstate; + hudstate = luaL_optint(l, 1, 0); + hud_enable = (hudstate==0?0:1); + return 0; +} +int luatpt_gravity(lua_State* l) +{ + int gravstate; + gravstate = luaL_optint(l, 1, 0); + if(gravstate) + start_grav_async(); + else + stop_grav_async(); + ngrav_enable = (gravstate==0?0:1); + return 0; +} +int luatpt_airheat(lua_State* l) +{ + int aheatstate; + aheatstate = luaL_optint(l, 1, 0); + aheat_enable = (aheatstate==0?0:1); + return 0; +} +int luatpt_active_menu(lua_State* l) +{ + int aheatstate; + aheatstate = luaL_optint(l, 1, menu_count); + active_menu = aheatstate; + return 0; +} +int luatpt_decorations_enable(lua_State* l) +{ + int aheatstate; + aheatstate = luaL_optint(l, 1, 0); + decorations_enable = (aheatstate==0?0:1); + return 0; +} +int luatpt_cmode_set(lua_State* l) +{ + int aheatstate; + aheatstate = luaL_optint(l, 1, CM_COUNT); + cmode = aheatstate; + return 0; +} #endif