mirror of
https://github.com/enduro2d/enduro2d.git
synced 2025-12-15 00:11:55 +07:00
HOTFIX: dirty label flag script access
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
---@class label
|
||||
local label = {
|
||||
---@type boolean
|
||||
dirty = false,
|
||||
|
||||
---@type string
|
||||
text = "",
|
||||
|
||||
|
||||
@@ -15,6 +15,19 @@ namespace e2d::bindings::high
|
||||
l.new_usertype<gcomponent<label>>("label",
|
||||
sol::no_constructor,
|
||||
|
||||
"dirty", sol::property(
|
||||
[](const gcomponent<label>& c) -> bool {
|
||||
return c.owner().component<label::dirty>().exists();
|
||||
},
|
||||
[](gcomponent<label>& c, bool yesno){
|
||||
if ( yesno ) {
|
||||
c.owner().component<label::dirty>().ensure();
|
||||
} else {
|
||||
c.owner().component<label::dirty>().remove();
|
||||
}
|
||||
}
|
||||
),
|
||||
|
||||
"text", sol::property(
|
||||
[](const gcomponent<label>& c) -> str {
|
||||
return c->text();
|
||||
|
||||
Reference in New Issue
Block a user