From 1eee31fdbb4d48221c2e38f7c8206655348cb8cf Mon Sep 17 00:00:00 2001 From: WerWolv Date: Sat, 25 Jan 2025 16:54:16 +0100 Subject: [PATCH] fix: Debug mode only being enabled after everything has been initialized already --- plugins/builtin/source/plugin_builtin.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/plugins/builtin/source/plugin_builtin.cpp b/plugins/builtin/source/plugin_builtin.cpp index 39f57e445..66e045b5d 100644 --- a/plugins/builtin/source/plugin_builtin.cpp +++ b/plugins/builtin/source/plugin_builtin.cpp @@ -85,6 +85,15 @@ IMHEX_PLUGIN_SUBCOMMANDS() { IMHEX_PLUGIN_SETUP("Built-in", "WerWolv", "Default ImHex functionality") { using namespace hex::plugin::builtin; + // Show a warning banner on debug builds + #if defined(DEBUG) + ui::BannerIcon::open(ICON_VS_ERROR, "You're running a Debug build of ImHex. Performance will be degraded!", ImColor(153, 58, 58)); + dbg::setDebugModeEnabled(true); + #else + const auto enabled = ContentRegistry::Settings::read("hex.builtin.setting.general", "hex.builtin.setting.general.debug_mode_enabled", false); + dbg::setDebugModeEnabled(enabled); + #endif + hex::log::debug("Using romfs: '{}'", romfs::name()); for (auto &path : romfs::list("lang")) hex::ContentRegistry::Language::addLocalization(nlohmann::json::parse(romfs::get(path).string())); @@ -132,13 +141,4 @@ IMHEX_PLUGIN_SETUP("Built-in", "WerWolv", "Default ImHex functionality") { createWelcomeScreen(); setupOutOfBoxExperience(); - - // Show a warning banner on debug builds - #if defined(DEBUG) - ui::BannerIcon::open(ICON_VS_ERROR, "You're running a Debug build of ImHex. Performance will be degraded!", ImColor(153, 58, 58)); - dbg::setDebugModeEnabled(true); - #else - const auto enabled = ContentRegistry::Settings::read("hex.builtin.setting.general", "hex.builtin.setting.general.debug_mode_enabled", false); - dbg::setDebugModeEnabled(enabled); - #endif }