Added action validation
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user