CLuaInstance: Add function 'functionDeprecated()' for debug output...

...when a script function is deprecated.


Origin commit data
------------------
Branch: ni/coolstream
Commit: 5136563035
Author: Michael Liebmann <tuxcode.bbg@gmail.com>
Date: 2014-03-16 (Sun, 16 Mar 2014)



------------------
This commit was generated by Migit
This commit is contained in:
Michael Liebmann
2014-03-16 11:57:01 +01:00
parent 0b0b1c144f
commit b7d78cf315
6 changed files with 26 additions and 0 deletions

View File

@@ -307,6 +307,18 @@ CLuaInstance::~CLuaInstance()
}
}
void CLuaInstance::functionDeprecated(lua_State *L, const char* oldFunc, const char* newFunc)
{
lua_Debug ar;
lua_getstack(L, 1, &ar);
lua_getinfo(L, "Sl", &ar);
printf("[Lua Script] \33[1;31m%s\33[0m %s \33[33m%s\33[0m %s \33[1;33m%s\33[0m.\n (%s:%d)\n",
g_Locale->getText(LOCALE_LUA_FUNCTION_DEPRECATED1),
g_Locale->getText(LOCALE_LUA_FUNCTION_DEPRECATED2), oldFunc,
g_Locale->getText(LOCALE_LUA_FUNCTION_DEPRECATED3), newFunc,
ar.short_src, ar.currentline);
}
#define SET_VAR1(NAME) \
lua_pushinteger(lua, NAME); \
lua_setglobal(lua, #NAME);