fix: Stop all views from opening automatically on launch

This commit is contained in:
WerWolv 2021-04-12 21:08:36 +02:00
parent 907f25c231
commit 959988a670
2 changed files with 10 additions and 6 deletions

View file

@ -63,7 +63,7 @@ namespace hex {
private:
std::string m_unlocalizedViewName;
bool m_windowOpen = this->hasViewMenuItemEntry();
bool m_windowOpen = false;
};
}

View file

@ -47,7 +47,7 @@ namespace hex {
buf->appendf("[%s][General]\n", handler->TypeName);
for (auto &view : ContentRegistry::Views::getEntries()) {
buf->appendf("%s=%d\n", typeid(*view).name(), view->getWindowOpenState());
buf->appendf("%s=%d\n", view->getUnlocalizedName().data(), view->getWindowOpenState());
}
buf->append("\n");
@ -102,6 +102,13 @@ namespace hex {
if (targetFps.is_number())
this->m_targetFps = targetFps;
}
{
if (ContentRegistry::Settings::read("hex.builtin.setting.imhex", "hex.builtin.setting.imhex.launched", 0) == 1)
this->m_layoutConfigured = true;
else
ContentRegistry::Settings::write("hex.builtin.setting.imhex", "hex.builtin.setting.imhex.launched", 1);
}
});
EventManager::subscribe<EventFileLoaded>(this, [this](const std::string &path){
@ -370,10 +377,7 @@ namespace hex {
ImGui::End();
} else if (!this->m_layoutConfigured) {
this->m_layoutConfigured = true;
if (ContentRegistry::Settings::read("hex.builtin.setting.imhex", "hex.builtin.setting.imhex.launched", 0) == 0) {
ContentRegistry::Settings::write("hex.builtin.setting.imhex", "hex.builtin.setting.imhex.launched", 1);
this->resetLayout();
}
this->resetLayout();
}
}