impr: Close tutorial view when a tutorial is started
This commit is contained in:
parent
e2ae567b9f
commit
e3e117a14e
@ -22,26 +22,27 @@ namespace hex::plugin::builtin {
|
||||
|
||||
{
|
||||
auto &step = tutorial.addStep();
|
||||
static EventManager::EventList::iterator eventHandle;
|
||||
|
||||
step.setMessage(
|
||||
"hex.builtin.tutorial.introduction.step2.title",
|
||||
"hex.builtin.tutorial.introduction.step2.description",
|
||||
Bottom | Right
|
||||
)
|
||||
.addHighlight("hex.builtin.tutorial.introduction.step2.highlight",
|
||||
{
|
||||
"Welcome Screen/Start##SubWindow_69AA6996",
|
||||
Lang("hex.builtin.welcome.start.create_file")
|
||||
})
|
||||
.onAppear([&step] {
|
||||
EventProviderOpened::subscribe(&step, [&step](prv::Provider *provider) {
|
||||
if (dynamic_cast<MemoryFileProvider*>(provider))
|
||||
step.complete();
|
||||
});
|
||||
})
|
||||
.onComplete([&step] {
|
||||
EventProviderOpened::unsubscribe(&step);
|
||||
"hex.builtin.tutorial.introduction.step2.title",
|
||||
"hex.builtin.tutorial.introduction.step2.description",
|
||||
Bottom | Right
|
||||
)
|
||||
.addHighlight("hex.builtin.tutorial.introduction.step2.highlight",
|
||||
{
|
||||
"Welcome Screen/Start##SubWindow_69AA6996",
|
||||
Lang("hex.builtin.welcome.start.create_file")
|
||||
})
|
||||
.onAppear([&step] {
|
||||
eventHandle = EventProviderOpened::subscribe([&step](prv::Provider *provider) {
|
||||
if (dynamic_cast<MemoryFileProvider*>(provider))
|
||||
step.complete();
|
||||
});
|
||||
})
|
||||
.onComplete([] {
|
||||
EventProviderOpened::unsubscribe(eventHandle);
|
||||
});
|
||||
}
|
||||
|
||||
{
|
||||
|
@ -53,6 +53,7 @@ namespace hex::plugin::builtin {
|
||||
ImGui::BeginDisabled(currTutorial != tutorials.end());
|
||||
if (ImGuiExt::DimmedButton("hex.builtin.view.tutorials.start"_lang, ImVec2(ImGui::GetContentRegionAvail().x, 0))) {
|
||||
TutorialManager::startTutorial(m_selectedTutorial->getUnlocalizedName());
|
||||
this->getWindowOpenState() = false;
|
||||
}
|
||||
ImGui::EndDisabled();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user