mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-12 14:31:50 +00:00
add 'uinode:reposition()'
This commit is contained in:
parent
209490192c
commit
731c72da7c
1 changed files with 11 additions and 0 deletions
|
|
@ -101,6 +101,12 @@ static int l_node_destruct(lua::State* L) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int l_node_reposition(lua::State* L) {
|
||||||
|
auto docnode = get_document_node(L);
|
||||||
|
docnode.node->reposition();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static int l_container_clear(lua::State* L) {
|
static int l_container_clear(lua::State* L) {
|
||||||
auto node = get_document_node(L, 1);
|
auto node = get_document_node(L, 1);
|
||||||
if (auto container = std::dynamic_pointer_cast<Container>(node.node)) {
|
if (auto container = std::dynamic_pointer_cast<Container>(node.node)) {
|
||||||
|
|
@ -328,6 +334,10 @@ static int p_get_destruct(UINode*, lua::State* L) {
|
||||||
return lua::pushcfunction(L, lua::wrap<l_node_destruct>);
|
return lua::pushcfunction(L, lua::wrap<l_node_destruct>);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int p_get_reposition(UINode*, lua::State* L) {
|
||||||
|
return lua::pushcfunction(L, lua::wrap<l_node_reposition>);
|
||||||
|
}
|
||||||
|
|
||||||
static int p_get_clear(UINode* node, lua::State* L) {
|
static int p_get_clear(UINode* node, lua::State* L) {
|
||||||
if (dynamic_cast<Container*>(node)) {
|
if (dynamic_cast<Container*>(node)) {
|
||||||
return lua::pushcfunction(L, lua::wrap<l_container_clear>);
|
return lua::pushcfunction(L, lua::wrap<l_container_clear>);
|
||||||
|
|
@ -424,6 +434,7 @@ static int l_gui_getattr(lua::State* L) {
|
||||||
{"moveInto", p_move_into},
|
{"moveInto", p_move_into},
|
||||||
{"add", p_get_add},
|
{"add", p_get_add},
|
||||||
{"destruct", p_get_destruct},
|
{"destruct", p_get_destruct},
|
||||||
|
{"reposition", p_get_reposition},
|
||||||
{"clear", p_get_clear},
|
{"clear", p_get_clear},
|
||||||
{"setInterval", p_set_interval},
|
{"setInterval", p_set_interval},
|
||||||
{"placeholder", p_get_placeholder},
|
{"placeholder", p_get_placeholder},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue