mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-02 05:27:41 -05:00
sys: Save project backup if ImHex crashes
This commit is contained in:
@@ -198,10 +198,6 @@ namespace hex {
|
||||
}
|
||||
});
|
||||
|
||||
EventManager::subscribe<EventFileLoaded>(this, [](std::string path) {
|
||||
EventManager::post<RequestChangeWindowTitle>(std::filesystem::path(path).filename().string());
|
||||
});
|
||||
|
||||
EventManager::subscribe<EventSettingsChanged>(this, [this] {
|
||||
auto alpha = ContentRegistry::Settings::getSetting("hex.builtin.setting.interface", "hex.builtin.setting.interface.highlight_alpha");
|
||||
|
||||
@@ -217,7 +213,6 @@ namespace hex {
|
||||
EventManager::unsubscribe<EventWindowClosing>(this);
|
||||
EventManager::unsubscribe<EventPatternChanged>(this);
|
||||
EventManager::unsubscribe<RequestOpenWindow>(this);
|
||||
EventManager::unsubscribe<EventFileLoaded>(this);
|
||||
EventManager::unsubscribe<EventSettingsChanged>(this);
|
||||
}
|
||||
|
||||
@@ -442,8 +437,6 @@ namespace hex {
|
||||
}
|
||||
|
||||
if (ImGui::MenuItem("hex.view.hexeditor.menu.file.save_project"_lang, "", false, provider != nullptr && provider->isWritable())) {
|
||||
EventManager::post<EventProjectFileStore>();
|
||||
|
||||
if (ProjectFile::getProjectFilePath() == "") {
|
||||
View::openFileBrowser("hex.view.hexeditor.save_project"_lang, DialogMode::Save, { { "Project File", "hexproj" } }, [](auto path) {
|
||||
if (path.ends_with(".hexproj")) {
|
||||
|
||||
@@ -43,6 +43,9 @@ namespace hex {
|
||||
View::doLater([]{ ImGui::OpenPopup(View::toWindowName("hex.view.settings.name").c_str()); });
|
||||
this->getWindowOpenState() = true;
|
||||
}
|
||||
if (ImGui::MenuItem("Crash")) {
|
||||
*reinterpret_cast<int*>(8) = 16;
|
||||
}
|
||||
ImGui::EndMenu();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user