Expose remove_child function
This commit is contained in:
parent
a2039557bb
commit
6d821cb361
13
src/luaapi.c
13
src/luaapi.c
@ -2095,6 +2095,17 @@ static int dagame_k3menuitem_add_child(lua_State *L) {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int dagame_k3menuitem_remove_child(lua_State *L) {
|
||||||
|
struct menuitem *parent = lua_touserdata(L, 1);
|
||||||
|
struct menuitem *child = lua_touserdata(L, 2);
|
||||||
|
|
||||||
|
k3MRemoveChild(parent->ptr, child->ptr);
|
||||||
|
|
||||||
|
lua_pushvalue(L, 1);
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
static bool k3menuitem_event_callback(struct k3MEvent *ev, uint8_t *ud_) {
|
static bool k3menuitem_event_callback(struct k3MEvent *ev, uint8_t *ud_) {
|
||||||
void **ud = ud_;
|
void **ud = ud_;
|
||||||
|
|
||||||
@ -2212,6 +2223,8 @@ static int dagame_k3menuitem_get(lua_State *L) {
|
|||||||
lua_pushcfunction(L, dagame_k3menuitem_set_bounds);
|
lua_pushcfunction(L, dagame_k3menuitem_set_bounds);
|
||||||
} else if(!strcmp(lua_tostring(L, 2), "add_child")) {
|
} else if(!strcmp(lua_tostring(L, 2), "add_child")) {
|
||||||
lua_pushcfunction(L, dagame_k3menuitem_add_child);
|
lua_pushcfunction(L, dagame_k3menuitem_add_child);
|
||||||
|
} else if(!strcmp(lua_tostring(L, 2), "remove_child")) {
|
||||||
|
lua_pushcfunction(L, dagame_k3menuitem_remove_child);
|
||||||
} else if(!strcmp(lua_tostring(L, 2), "on")) {
|
} else if(!strcmp(lua_tostring(L, 2), "on")) {
|
||||||
lua_pushcfunction(L, dagame_k3menuitem_on);
|
lua_pushcfunction(L, dagame_k3menuitem_on);
|
||||||
} else if(!strcmp(lua_tostring(L, 2), "measure")) {
|
} else if(!strcmp(lua_tostring(L, 2), "measure")) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user