impr: Add interactive tutorials button to the welcome screen

This commit is contained in:
WerWolv
2024-02-24 16:10:05 +01:00
parent 0d4d8efe4e
commit 132b211796
3 changed files with 17 additions and 1 deletions

View File

@@ -2,6 +2,7 @@
#include <hex/api/content_registry.hpp>
#include <hex/api/tutorial_manager.hpp>
#include <hex/api/task_manager.hpp>
#include <fonts/codicons_font.h>
@@ -13,6 +14,14 @@ namespace hex::plugin::builtin {
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.help", "hex.builtin.view.tutorials.name" }, ICON_VS_COMPASS, 4000, Shortcut::None, [&, this] {
this->getWindowOpenState() = true;
});
RequestOpenWindow::subscribe(this, [this](const std::string &name) {
if (name == "Tutorials") {
TaskManager::doLater([this] {
this->getWindowOpenState() = true;
});
}
});
}