diff options
| author | jacob1 <jfu614@gmail.com> | 2013-01-16 19:05:31 (GMT) |
|---|---|---|
| committer | jacob1 <jfu614@gmail.com> | 2013-01-16 19:05:31 (GMT) |
| commit | 639d4fc43c7b89593fc0fa33886c4949bc754c01 (patch) | |
| tree | 167ddfa6ec73fbd75d808d87b51fab14c99cb367 /src/cat/LegacyLuaAPI.cpp | |
| parent | e9b86365c8e6bbb27332ad352ad5f1453dc1870e (diff) | |
| download | powder-639d4fc43c7b89593fc0fa33886c4949bc754c01.zip powder-639d4fc43c7b89593fc0fa33886c4949bc754c01.tar.gz | |
implement tpt.set_shortcuts
Diffstat (limited to 'src/cat/LegacyLuaAPI.cpp')
| -rw-r--r-- | src/cat/LegacyLuaAPI.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/cat/LegacyLuaAPI.cpp b/src/cat/LegacyLuaAPI.cpp index ca43fc8..7b2aa23 100644 --- a/src/cat/LegacyLuaAPI.cpp +++ b/src/cat/LegacyLuaAPI.cpp @@ -488,6 +488,7 @@ int luacon_elementwrite(lua_State* l){ free(key); return 0; } +bool shortcuts = true; int luacon_keyevent(int key, int modifier, int event){ int i = 0, kpcontinue = 1, callret; char tempkey[] = {key, 0}; @@ -509,7 +510,7 @@ int luacon_keyevent(int key, int modifier, int event){ lua_pop(luacon_ci->l, 1); } } - return kpcontinue; + return kpcontinue && shortcuts; } int luacon_mouseevent(int mx, int my, int mb, int event, int mouse_wheel){ int i = 0, mpcontinue = 1, callret; @@ -1409,7 +1410,12 @@ int luatpt_get_name(lua_State* l) int luatpt_set_shortcuts(lua_State* l) { - return luaL_error(l, "set_shortcuts: deprecated"); + int shortcut = luaL_optint(l, 1, 0); + if (shortcut) + shortcuts = true; + else + shortcuts = false; + return 0; } int luatpt_delete(lua_State* l) @@ -1713,7 +1719,7 @@ int luatpt_setfire(lua_State* l) } int luatpt_setdebug(lua_State* l) { - return luaL_error(l, "setdebug: Deprecated"); + return luaL_error(l, "setdebug: Deprecated"); //TODO: maybe use the debugInfo thing in GameController to implement this } int luatpt_setfpscap(lua_State* l) { |
