impr: Disable some more menu items when they're not useful

This commit is contained in:
WerWolv
2023-11-24 20:57:37 +01:00
parent b050039e35
commit 3c36ef2c69
4 changed files with 46 additions and 39 deletions

View File

@@ -241,7 +241,9 @@ namespace hex {
if (ImGui::MenuItem(Lang(name), shortcut.toString().c_str(), false, enabledCallback()))
callback();
} else {
if (ImGui::BeginMenu(Lang(name), *(menuItems.begin() + 1) == ContentRegistry::Interface::impl::SubMenuValue ? enabledCallback() : true)) {
bool isSubmenu = *(menuItems.begin() + 1) == ContentRegistry::Interface::impl::SubMenuValue;
if (ImGui::BeginMenu(Lang(name), isSubmenu ? enabledCallback() : true)) {
createNestedMenu({ menuItems.begin() + 1, menuItems.end() }, shortcut, callback, enabledCallback);
ImGui::EndMenu();
}