1
0
mirror of synced 2024-11-13 18:50:53 +01:00

fix: Loading of plugins and localizations after restart

This commit is contained in:
WerWolv 2023-07-22 18:38:14 +02:00
parent a99f8f78d0
commit 8aec382440
4 changed files with 17 additions and 10 deletions

View File

@ -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;
}
}

View File

@ -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();

View File

@ -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<std::string> 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());

View File

@ -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);