CLuaInstance: Add script function 'paramDeprecated'

Origin commit data
------------------
Commit: 35c6121780
Author: Michael Liebmann <tuxcode.bbg@gmail.com>
Date: 2015-11-16 (Mon, 16 Nov 2015)
This commit is contained in:
Michael Liebmann
2015-11-16 13:14:18 +01:00
parent ac966aa88f
commit 2860110c3d
6 changed files with 17 additions and 0 deletions

View File

@@ -871,6 +871,7 @@ lua.boolparam_deprecated3 für einen Boolean Parameter ist veraltet.\n
lua.function_deprecated1 Achtung! lua.function_deprecated1 Achtung!
lua.function_deprecated2 Die Funktion lua.function_deprecated2 Die Funktion
lua.function_deprecated3 ist veraltet,\n bitte nutzen Sie lua.function_deprecated3 ist veraltet,\n bitte nutzen Sie
lua.parameter_deprecated2 Der Parameter
lua.versionscheck1 Ihre Lua API Version ist zu alt lua.versionscheck1 Ihre Lua API Version ist zu alt
lua.versionscheck2 Erforderlich ist mindestens lua.versionscheck2 Erforderlich ist mindestens
mainmenu.audioplayer Audioplayer mainmenu.audioplayer Audioplayer

View File

@@ -872,6 +872,7 @@ lua.boolparam_deprecated3 for a Boolean parameter is deprecated.\n
lua.function_deprecated1 Caution! lua.function_deprecated1 Caution!
lua.function_deprecated2 Function lua.function_deprecated2 Function
lua.function_deprecated3 is deprecated,\n please use lua.function_deprecated3 is deprecated,\n please use
lua.parameter_deprecated2 Parameter
lua.versionscheck1 Your Lua API version is too old lua.versionscheck1 Your Lua API version is too old
lua.versionscheck2 This requires at least lua.versionscheck2 This requires at least
mainmenu.audioplayer Audioplayer mainmenu.audioplayer Audioplayer

View File

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

View File

@@ -212,6 +212,7 @@ private:
static bool _luaL_checkbool(lua_State *L, int numArg); static bool _luaL_checkbool(lua_State *L, int numArg);
static void paramBoolDeprecated(lua_State *L, const char* val); static void paramBoolDeprecated(lua_State *L, const char* val);
static void functionDeprecated(lua_State *L, const char* oldFunc, const char* newFunc); 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 lua_Unsigned checkMagicMask(lua_Unsigned &col);
static int NewWindow(lua_State *L); static int NewWindow(lua_State *L);

View File

@@ -899,6 +899,7 @@ typedef enum
LOCALE_LUA_FUNCTION_DEPRECATED1, LOCALE_LUA_FUNCTION_DEPRECATED1,
LOCALE_LUA_FUNCTION_DEPRECATED2, LOCALE_LUA_FUNCTION_DEPRECATED2,
LOCALE_LUA_FUNCTION_DEPRECATED3, LOCALE_LUA_FUNCTION_DEPRECATED3,
LOCALE_LUA_PARAMETER_DEPRECATED2,
LOCALE_LUA_VERSIONSCHECK1, LOCALE_LUA_VERSIONSCHECK1,
LOCALE_LUA_VERSIONSCHECK2, LOCALE_LUA_VERSIONSCHECK2,
LOCALE_MAINMENU_AUDIOPLAYER, LOCALE_MAINMENU_AUDIOPLAYER,

View File

@@ -899,6 +899,7 @@ const char * locale_real_names[] =
"lua.function_deprecated1", "lua.function_deprecated1",
"lua.function_deprecated2", "lua.function_deprecated2",
"lua.function_deprecated3", "lua.function_deprecated3",
"lua.parameter_deprecated2",
"lua.versionscheck1", "lua.versionscheck1",
"lua.versionscheck2", "lua.versionscheck2",
"mainmenu.audioplayer", "mainmenu.audioplayer",