From 7b28c80b742842f17c22b2b64054a13e69a5682c Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 12 Dec 2015 14:42:01 +0100 Subject: [PATCH] lua instances: adopt for last rebases with splitted lua source files TODO: check/fix lua functionality, not tested yet --- src/gui/lua/lua_cc_picture.cpp | 5 +++-- src/gui/lua/lua_cc_text.cpp | 13 +++++++------ src/gui/lua/lua_cc_window.cpp | 5 +++-- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/gui/lua/lua_cc_picture.cpp b/src/gui/lua/lua_cc_picture.cpp index d58062c7b..84eceb74b 100644 --- a/src/gui/lua/lua_cc_picture.cpp +++ b/src/gui/lua/lua_cc_picture.cpp @@ -148,7 +148,7 @@ int CLuaInstCCPicture::CCPictureHide(lua_State *L) lua_assert(lua_istable(L,1)); CLuaCCPicture *D = CCPictureCheck(L, 1); if (!D) return 0; - +#if 0 bool no_restore = false; if (!tableLookup(L, "no_restore", no_restore)) { std::string tmp = "false"; @@ -156,11 +156,12 @@ int CLuaInstCCPicture::CCPictureHide(lua_State *L) paramBoolDeprecated(L, tmp.c_str()); no_restore = (tmp == "true" || tmp == "1" || tmp == "yes"); } +#endif if (D->parent) { D->cp->setPicture(""); D->cp->paint(); } else - D->cp->hide(no_restore); + D->cp->hide(); return 0; } diff --git a/src/gui/lua/lua_cc_text.cpp b/src/gui/lua/lua_cc_text.cpp index 57b907e60..294df354d 100644 --- a/src/gui/lua/lua_cc_text.cpp +++ b/src/gui/lua/lua_cc_text.cpp @@ -98,12 +98,12 @@ int CLuaInstCCText::CCTextNew(lua_State *L) if (font_text >= SNeutrinoSettings::FONT_TYPE_COUNT || font_text < 0) font_text = SNeutrinoSettings::FONT_TYPE_MENU; - bool has_shadow = false; - if (!tableLookup(L, "has_shadow", has_shadow)) { + int shadow_mode = CC_SHADOW_OFF; + if (!tableLookup(L, "has_shadow", shadow_mode)) { std::string tmp1 = "false"; if (tableLookup(L, "has_shadow", tmp1)) paramBoolDeprecated(L, tmp1.c_str()); - has_shadow = (tmp1 == "true" || tmp1 == "1" || tmp1 == "yes"); + shadow_mode = (tmp1 == "true" || tmp1 == "1" || tmp1 == "yes"); } tableLookup(L, "color_text", color_text); @@ -142,7 +142,7 @@ int CLuaInstCCText::CCTextNew(lua_State *L) CLuaCCText **udata = (CLuaCCText **) lua_newuserdata(L, sizeof(CLuaCCText *)); *udata = new CLuaCCText(); - (*udata)->ct = new CComponentsText(x, y, dx, dy, text, mode, g_Font[font_text], pw, has_shadow, (fb_pixel_t)color_text, (fb_pixel_t)color_frame, (fb_pixel_t)color_body, (fb_pixel_t)color_shadow); + (*udata)->ct = new CComponentsText(x, y, dx, dy, text, mode, g_Font[font_text], 0 /*TODO: style not passed*/, pw, shadow_mode, (fb_pixel_t)color_text, (fb_pixel_t)color_frame, (fb_pixel_t)color_body, (fb_pixel_t)color_shadow); (*udata)->parent = pw; (*udata)->mode = mode; (*udata)->font_text = font_text; @@ -173,7 +173,7 @@ int CLuaInstCCText::CCTextHide(lua_State *L) lua_assert(lua_istable(L,1)); CLuaCCText *D = CCTextCheck(L, 1); if (!D) return 0; - +#if 0 bool no_restore = false; if (!tableLookup(L, "no_restore", no_restore)) { std::string tmp = "false"; @@ -181,11 +181,12 @@ int CLuaInstCCText::CCTextHide(lua_State *L) paramBoolDeprecated(L, tmp.c_str()); no_restore = (tmp == "true" || tmp == "1" || tmp == "yes"); } +#endif if (D->parent) { D->ct->setText("", D->mode, g_Font[D->font_text]); D->ct->paint(); } else - D->ct->hide(no_restore); + D->ct->hide(); return 0; } diff --git a/src/gui/lua/lua_cc_window.cpp b/src/gui/lua/lua_cc_window.cpp index fd08b0802..dacba8780 100644 --- a/src/gui/lua/lua_cc_window.cpp +++ b/src/gui/lua/lua_cc_window.cpp @@ -196,7 +196,7 @@ int CLuaInstCCWindow::CCWindowHide(lua_State *L) lua_assert(lua_istable(L,1)); CLuaCCWindow *D = CCWindowCheck(L, 1); if (!D) return 0; - +#if 0 bool no_restore = false; if (!tableLookup(L, "no_restore", no_restore)) { std::string tmp = "false"; @@ -204,7 +204,8 @@ int CLuaInstCCWindow::CCWindowHide(lua_State *L) paramBoolDeprecated(L, tmp.c_str()); no_restore = (tmp == "true" || tmp == "1" || tmp == "yes"); } - D->w->hide(no_restore); +#endif + D->w->hide(); return 0; }