更新 'src/Main/options.cxx'

This commit is contained in:
zhongjin 2024-09-01 17:37:17 +08:00
parent 648c2146a2
commit a04febaa92

View File

@ -2921,32 +2921,21 @@ OptionResult Options::processOptions()
//zhongjin Addon //zhongjin Addon
const auto& addonManager = addons::AddonManager::instance(); const auto& addonManager = addons::AddonManager::instance();
SGPath addonPath = globals->get_fg_root();
addonPath.append("Addon/fgcom-mumble");
try { try {
addonManager->registerAddon(addonPath); addonManager->registerAddon(globals->get_fg_root().append("Addon/fgcom-mumble"));
} catch (const sg_exception &e) { } catch (const sg_exception &e) {
string msg = "Error registering an add-on: " + e.getFormattedMessage(); string msg = "Error registering an add-on: " + e.getFormattedMessage();
SG_LOG(SG_GENERAL, SG_ALERT, msg); SG_LOG(SG_GENERAL, SG_ALERT, msg);
} }
SGPath addonPath = globals->get_fg_root();
addonPath.append("Addon/addon-littlenavmap");
try { try {
addonManager->registerAddon(addonPath); addonManager->registerAddon(globals->get_fg_root().append("Addon/addon-littlenavmap"));
} catch (const sg_exception &e) { } catch (const sg_exception &e) {
string msg = "Error registering an add-on: " + e.getFormattedMessage(); string msg = "Error registering an add-on: " + e.getFormattedMessage();
SG_LOG(SG_GENERAL, SG_ALERT, msg); SG_LOG(SG_GENERAL, SG_ALERT, msg);
} }
//end //end
return FG_OPTIONS_OK; return FG_OPTIONS_OK;
} }