mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-30 19:29:52 +02:00
Allow implicit conversions when setting text property on some Lua API UI elements
This commit is contained in:
@@ -53,7 +53,6 @@ int LuaCheckbox::checked(lua_State * l)
|
||||
int args = lua_gettop(l);
|
||||
if(args)
|
||||
{
|
||||
luaL_checktype(l, 1, LUA_TBOOLEAN);
|
||||
checkbox->SetChecked(lua_toboolean(l, 1));
|
||||
return 0;
|
||||
}
|
||||
@@ -84,7 +83,6 @@ int LuaCheckbox::text(lua_State * l)
|
||||
int args = lua_gettop(l);
|
||||
if(args)
|
||||
{
|
||||
luaL_checktype(l, 1, LUA_TSTRING);
|
||||
checkbox->SetText(lua_tostring(l, 1));
|
||||
return 0;
|
||||
}
|
||||
|
@@ -40,8 +40,7 @@ int LuaLabel::text(lua_State * l)
|
||||
int args = lua_gettop(l);
|
||||
if(args)
|
||||
{
|
||||
luaL_checktype(l, 1, LUA_TSTRING);
|
||||
label->SetText(lua_tostring(l, 1));
|
||||
label->SetText(std::string(lua_tostring(l, 1)));
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
|
@@ -100,8 +100,7 @@ int LuaTextbox::text(lua_State * l)
|
||||
int args = lua_gettop(l);
|
||||
if(args)
|
||||
{
|
||||
luaL_checktype(l, 1, LUA_TSTRING);
|
||||
textbox->SetText(lua_tostring(l, 1));
|
||||
textbox->SetText(std::string(lua_tostring(l, 1)));
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
|
Reference in New Issue
Block a user