mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-28 07:47:03 -05:00
fix: Debug mode only being enabled after everything has been initialized already
This commit is contained in:
@@ -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<bool>("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<bool>("hex.builtin.setting.general", "hex.builtin.setting.general.debug_mode_enabled", false);
|
||||
dbg::setDebugModeEnabled(enabled);
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user