api: Moved menu item adding to a new registry-type API

This commit is contained in:
WerWolv
2022-01-23 02:28:38 +01:00
parent 6c6fe8ad5c
commit 714d421334
48 changed files with 364 additions and 417 deletions

View File

@@ -13,6 +13,13 @@ namespace hex::plugin::builtin {
this->getWindowOpenState() = true;
}
});
ContentRegistry::Interface::addMenuItem("hex.builtin.menu.help", 2000, [&, this] {
if (ImGui::MenuItem("hex.builtin.view.settings.name"_lang)) {
View::doLater([]{ ImGui::OpenPopup(View::toWindowName("hex.builtin.view.settings.name").c_str()); });
this->getWindowOpenState() = true;
}
});
}
ViewSettings::~ViewSettings() {
@@ -45,18 +52,4 @@ namespace hex::plugin::builtin {
}
void ViewSettings::drawMenu() {
if (ImGui::BeginMenu("hex.builtin.menu.help"_lang)) {
ImGui::Separator();
if (ImGui::MenuItem("hex.builtin.view.settings.name"_lang)) {
View::doLater([]{ ImGui::OpenPopup(View::toWindowName("hex.builtin.view.settings.name").c_str()); });
this->getWindowOpenState() = true;
}
ImGui::EndMenu();
}
}
}