mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 03:21:49 +00:00
revert non-throwing 'id' and add 'exists' property & update doc/*/scripting/ui.md
This commit is contained in:
parent
b5e69f1eae
commit
ef656e9ff1
3 changed files with 8 additions and 1 deletions
|
|
@ -546,8 +546,12 @@ static int p_get_options(UINode* node, lua::State* L) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int p_is_exists(UINode* node, lua::State* L) {
|
||||
return lua::pushboolean(L, node != nullptr);
|
||||
}
|
||||
|
||||
static bool is_node_required(std::string_view attr) {
|
||||
return attr != "id";
|
||||
return attr != "exists";
|
||||
}
|
||||
|
||||
static int l_gui_getattr(lua::State* L) {
|
||||
|
|
@ -585,6 +589,7 @@ static int l_gui_getattr(lua::State* L) {
|
|||
std::function<int(UINode*, lua::State*)>>
|
||||
getters {
|
||||
{"id", p_get_id},
|
||||
{"exists", p_is_exists},
|
||||
{"color", p_get_color},
|
||||
{"hoverColor", p_get_hover_color},
|
||||
{"pressedColor", p_get_pressed_color},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue