More refactoring and cleanup
This commit is contained in:
@@ -36,12 +36,22 @@ bool Gui::has_action(const std::string &action) const {
|
||||
}
|
||||
|
||||
std::string Gui::get_action(int index) {
|
||||
if ((index < 0) || (index >= elts_.size())) {
|
||||
if ((index < 0) || (index >= int(elts_.size()))) {
|
||||
return "";
|
||||
}
|
||||
return elts_[index].action();
|
||||
}
|
||||
|
||||
std::string Gui::menu_debug_string() const {
|
||||
std::ostringstream oss;
|
||||
int index = 0;
|
||||
for (const GuiElt &elt : elts()) {
|
||||
oss << index << " " << elt.label() << std::endl;
|
||||
index += 1;
|
||||
}
|
||||
return oss.str();
|
||||
}
|
||||
|
||||
LuaDefine(gui_menu_item, "c") {
|
||||
Gui *gui = Gui::fetch_global_pointer(L);
|
||||
LuaArg laction, llabel;
|
||||
|
||||
Reference in New Issue
Block a user