mirror of
https://github.com/geode-sdk/geode.git
synced 2024-11-27 09:55:34 -05:00
make safe mode actually useful
This commit is contained in:
parent
ba0e13f9b2
commit
241ddc317a
3 changed files with 17 additions and 7 deletions
|
@ -605,13 +605,6 @@ void Loader::Impl::refreshModGraph() {
|
||||||
|
|
||||||
m_problems.clear();
|
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;
|
m_loadingState = LoadingState::Queue;
|
||||||
log::debug("Queueing mods");
|
log::debug("Queueing mods");
|
||||||
log::pushNest();
|
log::pushNest();
|
||||||
|
|
|
@ -357,6 +357,12 @@ bool Mod::Impl::getLaunchFlag(std::string_view const name) const {
|
||||||
// Loading, Toggling, Installing
|
// Loading, Toggling, Installing
|
||||||
|
|
||||||
Result<> Mod::Impl::loadBinary() {
|
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());
|
log::debug("Loading binary for mod {}", m_metadata.getID());
|
||||||
if (m_enabled)
|
if (m_enabled)
|
||||||
|
|
|
@ -363,6 +363,17 @@ bool ModListLayer::init() {
|
||||||
// select first tab
|
// select first tab
|
||||||
this->onTab(nullptr);
|
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
|
// enable keyboard
|
||||||
this->setKeyboardEnabled(true);
|
this->setKeyboardEnabled(true);
|
||||||
this->setKeypadEnabled(true);
|
this->setKeypadEnabled(true);
|
||||||
|
|
Loading…
Reference in a new issue