diff options
| author | jacob1 <jfu614@gmail.com> | 2013-01-09 03:00:45 (GMT) |
|---|---|---|
| committer | jacob1 <jfu614@gmail.com> | 2013-01-09 03:00:45 (GMT) |
| commit | 162a8ecba57a3cea84149aa89d6eee742c1e2cea (patch) | |
| tree | 9ea3a82a3b0ba704769830eebd362e25b02ad5d8 /src/cat | |
| parent | 6dad17c2e170abe561da0ba055c99b0c613e74bc (diff) | |
| download | powder-162a8ecba57a3cea84149aa89d6eee742c1e2cea.zip powder-162a8ecba57a3cea84149aa89d6eee742c1e2cea.tar.gz | |
readd tpt.hud and tpt.set_console commands
Diffstat (limited to 'src/cat')
| -rw-r--r-- | src/cat/LegacyLuaAPI.cpp | 23 | ||||
| -rw-r--r-- | src/cat/LuaScriptHelper.h | 1 | ||||
| -rw-r--r-- | src/cat/LuaScriptInterface.cpp | 2 |
3 files changed, 15 insertions, 11 deletions
diff --git a/src/cat/LegacyLuaAPI.cpp b/src/cat/LegacyLuaAPI.cpp index 8c52bfe..c6a41e1 100644 --- a/src/cat/LegacyLuaAPI.cpp +++ b/src/cat/LegacyLuaAPI.cpp @@ -12,7 +12,7 @@ #include "dialogues/ErrorMessage.h" #include "dialogues/InformationMessage.h" #include "dialogues/TextPrompt.h" -#include "dialogues/ConfirmPrompt.h" +#include "dialogues/ConfirmPrompt.h" #include "simulation/Simulation.h" #include "game/GameModel.h" @@ -803,11 +803,12 @@ int luatpt_togglewater(lua_State* l) int luatpt_setconsole(lua_State* l) { - /*int consolestate; + int consolestate; consolestate = luaL_optint(l, 1, 0); - console_mode = (consolestate==0?0:1); - return 0;*/ - //TODO IMPLEMENT + if (consolestate) + luacon_controller->ShowConsole(); + else + luacon_controller->HideConsole(); return 0; } @@ -1640,12 +1641,12 @@ int luatpt_getPartIndex(lua_State* l) } int luatpt_hud(lua_State* l) { - /*int hudstate; - hudstate = luaL_optint(l, 1, 0); - hud_enable = (hudstate==0?0:1); - return 0;*/ - //TODO IMPLEMENT - return 0; + int hudstate = luaL_optint(l, 1, 0); + if (hudstate) + luacon_controller->SetHudEnable(1); + else + luacon_controller->SetHudEnable(0); + return 0; } int luatpt_gravity(lua_State* l) { diff --git a/src/cat/LuaScriptHelper.h b/src/cat/LuaScriptHelper.h index 1b771e4..b55329f 100644 --- a/src/cat/LuaScriptHelper.h +++ b/src/cat/LuaScriptHelper.h @@ -9,6 +9,7 @@ #define LUASCRIPTHELPER_H_ extern GameModel * luacon_model; +extern GameController * luacon_controller; extern Simulation * luacon_sim; extern LuaScriptInterface * luacon_ci; extern Graphics * luacon_g; diff --git a/src/cat/LuaScriptInterface.cpp b/src/cat/LuaScriptInterface.cpp index 8cf35c3..b529255 100644 --- a/src/cat/LuaScriptInterface.cpp +++ b/src/cat/LuaScriptInterface.cpp @@ -55,6 +55,7 @@ extern "C" } GameModel * luacon_model; +GameController * luacon_controller; Simulation * luacon_sim; LuaScriptInterface * luacon_ci; Graphics * luacon_g; @@ -91,6 +92,7 @@ LuaScriptInterface::LuaScriptInterface(GameController * c, GameModel * m): luacon_mousedown(false) { luacon_model = m; + luacon_controller = c; luacon_sim = m->GetSimulation(); luacon_g = ui::Engine::Ref().g; luacon_ren = m->GetRenderer(); |
