lua_cc_text.cpp: use 'text_mode' instead 'mode' in api

Prevent possible ambiguity of text mode parameter.
Parameter 'mode' deprecated, but still available for
downward compatibility.
This commit is contained in:
2019-09-10 10:08:50 +02:00
parent e74181dee0
commit 06e6fd5904
2 changed files with 4 additions and 2 deletions

View File

@@ -4,4 +4,4 @@
* to luainstance.h changes * to luainstance.h changes
*/ */
#define LUA_API_VERSION_MAJOR 1 #define LUA_API_VERSION_MAJOR 1
#define LUA_API_VERSION_MINOR 81 #define LUA_API_VERSION_MINOR 82

View File

@@ -95,7 +95,9 @@ int CLuaInstCCText::CCTextNew(lua_State *L)
tableLookup(L, "dx", dx); tableLookup(L, "dx", dx);
tableLookup(L, "dy", dy); tableLookup(L, "dy", dy);
tableLookup(L, "text", text); tableLookup(L, "text", text);
tableLookup(L, "mode", tmpMode); //to prevent possible ambiguity of text mode, use 'text_mode' instead 'mode' in api
tableLookup(L, "text_mode", tmpMode);
tableLookup(L, "mode", tmpMode); //NOTE: parameter 'mode' deprecated, but still available for downward compatibility
tableLookup(L, "font_text", font_text); tableLookup(L, "font_text", font_text);
if (font_text >= SNeutrinoSettings::FONT_TYPE_COUNT || font_text < 0) if (font_text >= SNeutrinoSettings::FONT_TYPE_COUNT || font_text < 0)
font_text = SNeutrinoSettings::FONT_TYPE_MENU; font_text = SNeutrinoSettings::FONT_TYPE_MENU;