mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-01 21:17:44 -05:00
api: Moved menu item adding to a new registry-type API
This commit is contained in:
@@ -9,6 +9,19 @@
|
||||
namespace hex::plugin::builtin {
|
||||
|
||||
ViewHelp::ViewHelp() : View("hex.builtin.view.help.about.name") {
|
||||
|
||||
ContentRegistry::Interface::addMenuItem("hex.builtin.menu.help", 1000, [&, this] {
|
||||
if (ImGui::MenuItem("hex.builtin.view.help.about.name"_lang, "")) {
|
||||
View::doLater([] { ImGui::OpenPopup(View::toWindowName("hex.builtin.view.help.about.name").c_str()); });
|
||||
this->m_aboutWindowOpen = true;
|
||||
this->getWindowOpenState() = true;
|
||||
}
|
||||
|
||||
if (ImGui::MenuItem("hex.builtin.view.help.documentation"_lang, "")) {
|
||||
hex::openWebpage("https://imhex.werwolv.net/docs");
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
ViewHelp::~ViewHelp() {
|
||||
@@ -171,18 +184,4 @@ namespace hex::plugin::builtin {
|
||||
this->drawAboutPopup();
|
||||
}
|
||||
|
||||
void ViewHelp::drawMenu() {
|
||||
if (ImGui::BeginMenu("hex.builtin.menu.help"_lang)) {
|
||||
if (ImGui::MenuItem("hex.builtin.view.help.about.name"_lang, "")) {
|
||||
View::doLater([] { ImGui::OpenPopup(View::toWindowName("hex.builtin.view.help.about.name").c_str()); });
|
||||
this->m_aboutWindowOpen = true;
|
||||
this->getWindowOpenState() = true;
|
||||
}
|
||||
if (ImGui::MenuItem("hex.builtin.view.help.documentation"_lang, "")) {
|
||||
hex::openWebpage("https://imhex.werwolv.net/docs");
|
||||
}
|
||||
ImGui::EndMenu();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user