CLuaInstance: Add script function 'paramDeprecated'

This commit is contained in:
M. Liebmann
2015-11-16 13:14:18 +01:00
parent 09881321e2
commit 35c6121780
6 changed files with 17 additions and 0 deletions

View File

@@ -418,6 +418,18 @@ void CLuaInstance::functionDeprecated(lua_State *L, const char* oldFunc, const c
ar.short_src, ar.currentline);
}
void CLuaInstance::paramDeprecated(lua_State *L, const char* oldParam, const char* newParam)
{
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_PARAMETER_DEPRECATED2), oldParam,
g_Locale->getText(LOCALE_LUA_FUNCTION_DEPRECATED3), newParam,
ar.short_src, ar.currentline);
}
lua_Unsigned CLuaInstance::checkMagicMask(lua_Unsigned &col)
{
if ((col & MAGIC_MASK) == MAGIC_COLOR)

View File

@@ -212,6 +212,7 @@ private:
static bool _luaL_checkbool(lua_State *L, int numArg);
static void paramBoolDeprecated(lua_State *L, const char* val);
static void functionDeprecated(lua_State *L, const char* oldFunc, const char* newFunc);
static void paramDeprecated(lua_State *L, const char* oldParam, const char* newParam);
static lua_Unsigned checkMagicMask(lua_Unsigned &col);
static int NewWindow(lua_State *L);