Allow implicit conversions when setting text property on some Lua API UI elements
This commit is contained in:
parent
8d04b260a7
commit
a091f55fec
@ -53,7 +53,6 @@ int LuaCheckbox::checked(lua_State * l)
|
|||||||
int args = lua_gettop(l);
|
int args = lua_gettop(l);
|
||||||
if(args)
|
if(args)
|
||||||
{
|
{
|
||||||
luaL_checktype(l, 1, LUA_TBOOLEAN);
|
|
||||||
checkbox->SetChecked(lua_toboolean(l, 1));
|
checkbox->SetChecked(lua_toboolean(l, 1));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -84,7 +83,6 @@ int LuaCheckbox::text(lua_State * l)
|
|||||||
int args = lua_gettop(l);
|
int args = lua_gettop(l);
|
||||||
if(args)
|
if(args)
|
||||||
{
|
{
|
||||||
luaL_checktype(l, 1, LUA_TSTRING);
|
|
||||||
checkbox->SetText(lua_tostring(l, 1));
|
checkbox->SetText(lua_tostring(l, 1));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -40,8 +40,7 @@ int LuaLabel::text(lua_State * l)
|
|||||||
int args = lua_gettop(l);
|
int args = lua_gettop(l);
|
||||||
if(args)
|
if(args)
|
||||||
{
|
{
|
||||||
luaL_checktype(l, 1, LUA_TSTRING);
|
label->SetText(std::string(lua_tostring(l, 1)));
|
||||||
label->SetText(lua_tostring(l, 1));
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -100,8 +100,7 @@ int LuaTextbox::text(lua_State * l)
|
|||||||
int args = lua_gettop(l);
|
int args = lua_gettop(l);
|
||||||
if(args)
|
if(args)
|
||||||
{
|
{
|
||||||
luaL_checktype(l, 1, LUA_TSTRING);
|
textbox->SetText(std::string(lua_tostring(l, 1)));
|
||||||
textbox->SetText(lua_tostring(l, 1));
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Reference in New Issue
Block a user