mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 11:01:49 +00:00
xml is spreading...
This commit is contained in:
parent
0dc3ab50a2
commit
a155b80643
2 changed files with 79 additions and 59 deletions
|
|
@ -141,6 +141,13 @@ static int menu_back(lua_State* L) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int menu_reset(lua_State* L) {
|
||||
auto node = getDocumentNode(L);
|
||||
auto menu = dynamic_cast<gui::Menu*>(node.node);
|
||||
menu->reset();
|
||||
return 0;
|
||||
}
|
||||
|
||||
static bool getattr(lua_State* L, gui::Menu* menu, const std::string& attr) {
|
||||
if (menu == nullptr)
|
||||
return false;
|
||||
|
|
@ -150,6 +157,9 @@ static bool getattr(lua_State* L, gui::Menu* menu, const std::string& attr) {
|
|||
} else if (attr == "back") {
|
||||
lua_pushcfunction(L, menu_back);
|
||||
return true;
|
||||
} else if (attr == "reset") {
|
||||
lua_pushcfunction(L, menu_reset);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue