Added invoke_plan, removed viewer
This commit is contained in:
@@ -2,10 +2,10 @@
|
||||
|
||||
LuaDefineType(Gui);
|
||||
|
||||
void Gui::add_menu_item(const std::string &id, const std::string &label) {
|
||||
void Gui::menu_item(const std::string &action, const std::string &label) {
|
||||
GuiElt elt;
|
||||
elt.type_ = GuiElt::TYPE_MENU_ITEM;
|
||||
elt.id_ = id;
|
||||
elt.action_ = action;
|
||||
elt.label_ = label;
|
||||
elts_.push_back(elt);
|
||||
}
|
||||
@@ -18,10 +18,11 @@ LuaDefine(gui_create, "c") {
|
||||
}
|
||||
|
||||
LuaDefine(gui_menu_item, "c") {
|
||||
LuaArg lgui, lid;
|
||||
LuaStack LS(L, lgui, lid);
|
||||
LuaArg lgui, laction, llabel;
|
||||
LuaStack LS(L, lgui, laction, llabel);
|
||||
Gui *gui = LS.ckuserdata<Gui>(lgui);
|
||||
std::string id = LS.ckstring(lid);
|
||||
gui->add_menu_item(id, id);
|
||||
std::string action = LS.ckstring(laction);
|
||||
std::string label = LS.ckstring(llabel);
|
||||
gui->menu_item(action, label);
|
||||
return LS.result();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user