From 60921031bd385935419a44abe53fe90488a5f25a Mon Sep 17 00:00:00 2001 From: WerWolv Date: Mon, 26 Feb 2024 21:43:28 +0100 Subject: [PATCH] fix: Opening project files through the command line opening them as regular files --- plugins/builtin/source/content/events.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/plugins/builtin/source/content/events.cpp b/plugins/builtin/source/content/events.cpp index 5f97ab36d..a93479080 100644 --- a/plugins/builtin/source/content/events.cpp +++ b/plugins/builtin/source/content/events.cpp @@ -25,6 +25,13 @@ namespace hex::plugin::builtin { static void openFile(const std::fs::path &path) { + if (path.extension() == ".hexproj") { + if (!ProjectFile::load(path)) { + ui::ToastError::open(hex::format("hex.builtin.popup.error.project.load"_lang, wolv::util::toUTF8String(path))); + } + return; + } + auto provider = ImHexApi::Provider::createProvider("hex.builtin.provider.file", true); if (auto *fileProvider = dynamic_cast(provider); fileProvider != nullptr) { fileProvider->setPath(path);