make safe mode actually useful

This commit is contained in:
matcool 2024-02-04 11:43:01 -03:00
parent ba0e13f9b2
commit 241ddc317a
3 changed files with 17 additions and 7 deletions

View file

@ -605,13 +605,6 @@ void Loader::Impl::refreshModGraph() {
m_problems.clear();
if (Loader::get()->getLaunchFlag("safe-mode")) {
log::info("Launched in Safe Mode. Any mod loading will be skipped.");
m_loadingState = LoadingState::Done;
log::popNest();
return;
}
m_loadingState = LoadingState::Queue;
log::debug("Queueing mods");
log::pushNest();

View file

@ -357,6 +357,12 @@ bool Mod::Impl::getLaunchFlag(std::string_view const name) const {
// Loading, Toggling, Installing
Result<> Mod::Impl::loadBinary() {
if (!this->isInternal() && Loader::get()->getLaunchFlag("safe-mode")) {
// pretend to have loaded the mod, so that it still shows up on the mod list properly,
// while the user can still toggle/uninstall it
m_enabled = true;
return Ok();
}
log::debug("Loading binary for mod {}", m_metadata.getID());
if (m_enabled)

View file

@ -363,6 +363,17 @@ bool ModListLayer::init() {
// select first tab
this->onTab(nullptr);
// add safe mode label
if (Loader::get()->getLaunchFlag("safe-mode")) {
auto* label = CCLabelBMFont::create("Safe Mode Enabled", "bigFont.fnt");
label->setPosition(winSize.width / 2.f, 17);
label->setScale(0.625f);
label->setZOrder(999);
this->addChild(label);
// reference to windows safe mode
bg->setVisible(false);
}
// enable keyboard
this->setKeyboardEnabled(true);
this->setKeypadEnabled(true);