diff --git a/lib/libimhex/source/api/localization.cpp b/lib/libimhex/source/api/localization.cpp index f91d79f23..bd161e4ac 100644 --- a/lib/libimhex/source/api/localization.cpp +++ b/lib/libimhex/source/api/localization.cpp @@ -108,10 +108,11 @@ namespace hex { void LangEntry::resetLanguageStrings() { LangEntry::s_currStrings.clear(); + LangEntry::s_selectedLanguage.clear(); } const std::string &LangEntry::getSelectedLanguage() { - return s_selectedLanguage; + return LangEntry::s_selectedLanguage; } } \ No newline at end of file diff --git a/main/source/init/tasks.cpp b/main/source/init/tasks.cpp index e6801bdb5..ea2035ec5 100644 --- a/main/source/init/tasks.cpp +++ b/main/source/init/tasks.cpp @@ -419,6 +419,11 @@ namespace hex::init { } bool loadPlugins() { + // Load all plugins + for (const auto &dir : fs::getDefaultPaths(fs::ImHexPath::Plugins)) { + PluginManager::load(dir); + } + // Get loaded plugins auto &plugins = PluginManager::getPlugins(); diff --git a/main/source/main.cpp b/main/source/main.cpp index b560ab343..264471b26 100644 --- a/main/source/main.cpp +++ b/main/source/main.cpp @@ -21,12 +21,6 @@ using namespace hex; -void loadPlugins() { - for (const auto &dir : fs::getDefaultPaths(fs::ImHexPath::Plugins)) { - PluginManager::load(dir); - } -} - int main(int argc, char **argv) { Window::initNative(); @@ -34,10 +28,16 @@ int main(int argc, char **argv) { std::vector args(argv + 1, argv + argc); - loadPlugins(); + if (argc > 1) { + for (const auto &dir : fs::getDefaultPaths(fs::ImHexPath::Plugins)) { + PluginManager::load(dir); + } - hex::messaging::setupMessaging(); - hex::subcommands::processArguments(args); + hex::messaging::setupMessaging(); + hex::subcommands::processArguments(args); + + PluginManager::unload(); + } log::info("Welcome to ImHex {}!", ImHexApi::System::getImHexVersion()); log::info("Compiled using commit {}@{}", ImHexApi::System::getCommitBranch(), ImHexApi::System::getCommitHash()); diff --git a/plugins/builtin/source/content/welcome_screen.cpp b/plugins/builtin/source/content/welcome_screen.cpp index 7ba0880d9..a43bffe4c 100644 --- a/plugins/builtin/source/content/welcome_screen.cpp +++ b/plugins/builtin/source/content/welcome_screen.cpp @@ -218,6 +218,7 @@ namespace hex::plugin::builtin { ImGui::TableNextColumn(); ImGui::UnderlinedText("hex.builtin.welcome.header.help"_lang); ImGui::SetCursorPosY(ImGui::GetCursorPosY() + 5_scaled); + ImGui::Dummy({0, 0}); { if (ImGui::IconHyperlink(ICON_VS_GITHUB, "hex.builtin.welcome.help.repo"_lang)) hex::openWebpage("hex.builtin.welcome.help.repo.link"_lang); if (ImGui::IconHyperlink(ICON_VS_ORGANIZATION, "hex.builtin.welcome.help.gethelp"_lang)) hex::openWebpage("hex.builtin.welcome.help.gethelp.link"_lang);