From fea9f82cfabf160c3d76ea5613e0ff16ea36a955 Mon Sep 17 00:00:00 2001 From: Alex Szpakowski Date: Mon, 14 Aug 2017 18:41:22 -0300 Subject: [PATCH] Remove the undocumented formatted variant of Text:set (Text:setf still exists). Resolves issue #1329. --HG-- branch : minor --- src/modules/graphics/wrap_Text.cpp | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) diff --git a/src/modules/graphics/wrap_Text.cpp b/src/modules/graphics/wrap_Text.cpp index f003778fc..b5f78078b 100644 --- a/src/modules/graphics/wrap_Text.cpp +++ b/src/modules/graphics/wrap_Text.cpp @@ -36,29 +36,10 @@ int w_Text_set(lua_State *L) { Text *t = luax_checktext(L, 1); - if (lua_isnoneornil(L, 3)) - { - // Single argument: unformatted text. - std::vector newtext; - luax_checkcoloredstring(L, 2, newtext); - luax_catchexcept(L, [&](){ t->set(newtext); }); - } - else - { - // Multiple arguments: formatted text. - float wraplimit = (float) luaL_checknumber(L, 3); - - Font::AlignMode align; - const char *alignstr = luaL_checkstring(L, 4); - if (!Font::getConstant(alignstr, align)) - return luaL_error(L, "Invalid align mode: %s", alignstr); - - std::vector newtext; - luax_checkcoloredstring(L, 2, newtext); - - luax_catchexcept(L, [&](){ t->set(newtext, wraplimit, align); }); - } + std::vector newtext; + luax_checkcoloredstring(L, 2, newtext); + luax_catchexcept(L, [&](){ t->set(newtext); }); return 0; }