diff --git a/plugins/builtin/source/content/settings_entries.cpp b/plugins/builtin/source/content/settings_entries.cpp index 477c1cf1e..ec2e350bb 100644 --- a/plugins/builtin/source/content/settings_entries.cpp +++ b/plugins/builtin/source/content/settings_entries.cpp @@ -25,6 +25,17 @@ namespace hex::plugin::builtin { return false; }); + ContentRegistry::Settings::add("hex.builtin.setting.general", "hex.builtin.setting.general.auto_load_patterns", 1, [](auto name, nlohmann::json &setting) { + static bool enabled = static_cast(setting); + + if (ImGui::Checkbox(name.data(), &enabled)) { + setting = static_cast(enabled); + return true; + } + + return false; + }); + /* Interface */ ContentRegistry::Settings::add("hex.builtin.setting.interface", "hex.builtin.setting.interface.color", 0, [](auto name, nlohmann::json &setting) { diff --git a/plugins/builtin/source/lang/de_DE.cpp b/plugins/builtin/source/lang/de_DE.cpp index fcf51cd25..ca6b2896e 100644 --- a/plugins/builtin/source/lang/de_DE.cpp +++ b/plugins/builtin/source/lang/de_DE.cpp @@ -627,6 +627,7 @@ namespace hex::plugin::builtin { { "hex.builtin.setting.imhex.recent_files", "Kürzlich geöffnete Dateien" }, { "hex.builtin.setting.general", "Allgemein" }, { "hex.builtin.setting.general.show_tips", "Tipps beim start anzeigen" }, + { "hex.builtin.setting.general.auto_load_patterns", "Unterstützte Pattern automatisch laden" }, { "hex.builtin.setting.interface", "Aussehen" }, { "hex.builtin.setting.interface.color", "Farbthema" }, { "hex.builtin.setting.interface.color.system", "System" }, diff --git a/plugins/builtin/source/lang/en_US.cpp b/plugins/builtin/source/lang/en_US.cpp index 6ee9b6eef..261bf05ee 100644 --- a/plugins/builtin/source/lang/en_US.cpp +++ b/plugins/builtin/source/lang/en_US.cpp @@ -628,6 +628,7 @@ namespace hex::plugin::builtin { { "hex.builtin.setting.imhex.recent_files", "Recent Files" }, { "hex.builtin.setting.general", "General" }, { "hex.builtin.setting.general.show_tips", "Show tips on startup" }, + { "hex.builtin.setting.general.auto_load_patterns", "Auto-load supported pattern" }, { "hex.builtin.setting.interface", "Interface" }, { "hex.builtin.setting.interface.color", "Color theme" }, { "hex.builtin.setting.interface.color.system", "System" }, diff --git a/plugins/builtin/source/lang/it_IT.cpp b/plugins/builtin/source/lang/it_IT.cpp index b153b2e33..702ac32cd 100644 --- a/plugins/builtin/source/lang/it_IT.cpp +++ b/plugins/builtin/source/lang/it_IT.cpp @@ -626,6 +626,7 @@ namespace hex::plugin::builtin { { "hex.builtin.setting.imhex.recent_files", "File recenti" }, { "hex.builtin.setting.general", "Generali" }, { "hex.builtin.setting.general.show_tips", "Mostra consigli all'avvio" }, + //{ "hex.builtin.setting.general.auto_load_patterns", "Auto-load supported pattern" }, { "hex.builtin.setting.interface", "Interfaccia" }, { "hex.builtin.setting.interface.color", "Colore del Tema" }, { "hex.builtin.setting.interface.color.system", "Sistema" }, diff --git a/plugins/builtin/source/lang/zh_CN.cpp b/plugins/builtin/source/lang/zh_CN.cpp index 3a0f5f796..80c400025 100644 --- a/plugins/builtin/source/lang/zh_CN.cpp +++ b/plugins/builtin/source/lang/zh_CN.cpp @@ -628,6 +628,7 @@ namespace hex::plugin::builtin { { "hex.builtin.setting.imhex.recent_files", "最近文件" }, { "hex.builtin.setting.general", "通用" }, { "hex.builtin.setting.general.show_tips", "在启动时显示每日提示" }, + //{ "hex.builtin.setting.general.auto_load_patterns", "Auto-load supported pattern" }, { "hex.builtin.setting.interface", "界面" }, { "hex.builtin.setting.interface.color", "颜色主题" }, { "hex.builtin.setting.interface.color.system", "跟随系统" }, diff --git a/source/views/view_pattern_editor.cpp b/source/views/view_pattern_editor.cpp index 1c6d76591..2608679bb 100644 --- a/source/views/view_pattern_editor.cpp +++ b/source/views/view_pattern_editor.cpp @@ -104,6 +104,9 @@ namespace hex { }); EventManager::subscribe(this, [this](const std::string &path) { + if (!ContentRegistry::Settings::read("hex.builtin.setting.general", "hex.builtin.setting.general.auto_load_patterns", 1)) + return; + pl::Preprocessor preprocessor; if (!ImHexApi::Provider::isValid())