Added action validation

This commit is contained in:
2021-02-16 14:15:40 -05:00
parent 1a6366e164
commit 210644da57
3 changed files with 17 additions and 0 deletions

View File

@@ -10,6 +10,15 @@ void Gui::menu_item(const std::string &action, const std::string &label) {
elts_.push_back(elt);
}
bool Gui::has_action(const std::string &action) const {
for (const GuiElt &elt : elts_) {
if (elt.action_ == action) {
return true;
}
}
return false;
}
LuaDefine(gui_create, "c") {
LuaRet lgui;
LuaStack LS(L, lgui);