Enhance EditorManager: add assembly and palette editors to the view menu, and improve menu initialization for better readability
This commit is contained in:
@@ -77,7 +77,7 @@ struct MenuItem {
|
||||
std::function<bool()> enabled_condition = kDefaultEnabledCondition;
|
||||
std::vector<MenuItem> subitems;
|
||||
};
|
||||
using Menu = std::vector<MenuItem>;
|
||||
using Menu = std::array<MenuItem, 5>;
|
||||
|
||||
void DrawMenu(Menu ¶ms);
|
||||
|
||||
@@ -124,6 +124,11 @@ inline void AddToViewMenu(const std::string &label, const std::string &shortcut,
|
||||
kMainMenu[MenuType::kView].subitems.emplace_back(label, shortcut, callback);
|
||||
}
|
||||
|
||||
inline void AddToHelpMenu(const std::string &label, const std::string &shortcut,
|
||||
std::function<void()> callback) {
|
||||
kMainMenu[MenuType::kHelp].subitems.emplace_back(label, shortcut, callback);
|
||||
}
|
||||
|
||||
} // namespace gui
|
||||
} // namespace yaze
|
||||
|
||||
|
||||
Reference in New Issue
Block a user