diff --git a/Aquaria/AnimationEditor.cpp b/Aquaria/AnimationEditor.cpp index 1365537..9c3a80d 100644 --- a/Aquaria/AnimationEditor.cpp +++ b/Aquaria/AnimationEditor.cpp @@ -1363,7 +1363,7 @@ void AnimationEditor::goToTitle() if (!dsq->returnToScene.empty()) game->transitionToScene(dsq->returnToScene); else - dsq->title(); + dsq->title(false); } void AnimationEditor::quit() diff --git a/Aquaria/BitBlotLogo.cpp b/Aquaria/BitBlotLogo.cpp index f209832..c4f61c1 100644 --- a/Aquaria/BitBlotLogo.cpp +++ b/Aquaria/BitBlotLogo.cpp @@ -62,7 +62,7 @@ void BitBlotLogo::doShortBitBlot() void BitBlotLogo::getOut() { - dsq->title(); + dsq->title(false); } void BitBlotLogo::applyState() diff --git a/Aquaria/DSQ.cpp b/Aquaria/DSQ.cpp index ea09d97..bd9c8c9 100644 --- a/Aquaria/DSQ.cpp +++ b/Aquaria/DSQ.cpp @@ -1364,11 +1364,11 @@ void DSQ::init() // Go directly to the title in dev mode if(isDeveloperKeys()) - title(); + title(false); else if (dsq->user.demo.intro != 0) enqueueJumpState("Intro"); else if(dsq->user.demo.shortLogos) - title(); + title(false); else enqueueJumpState("BitBlotLogo"); } @@ -2664,16 +2664,12 @@ void DSQ::title(bool fade) if (fade) { sound->fadeMusic(SFT_OUT, 1); + run(1); + resetTimer(); + sound->stopMusic(); } - run(1); - - resetTimer(); - - if (fade) - sound->stopMusic(); - - user.save(); + //user.save(); if (mod.isActive()) { diff --git a/Aquaria/DSQ.h b/Aquaria/DSQ.h index 584ffb7..81600a6 100644 --- a/Aquaria/DSQ.h +++ b/Aquaria/DSQ.h @@ -167,7 +167,7 @@ public: void action(int id, int state, int source, InputDevice device); - void title(bool fadeMusic=true); + void title(bool fadeMusic); void cutsceneEffects(bool on); diff --git a/Aquaria/InGameMenu.cpp b/Aquaria/InGameMenu.cpp index dd38b99..5a9957b 100644 --- a/Aquaria/InGameMenu.cpp +++ b/Aquaria/InGameMenu.cpp @@ -3203,7 +3203,7 @@ void InGameMenu::onExitCheckYes() { dsq->sound->stopAllVoice(); dsq->toggleCursor(0, 0.25); - dsq->title(); + dsq->title(true); } void InGameMenu::onExitCheckNo() diff --git a/Aquaria/Intro.cpp b/Aquaria/Intro.cpp index 9be361b..c92b2ea 100644 --- a/Aquaria/Intro.cpp +++ b/Aquaria/Intro.cpp @@ -83,7 +83,7 @@ void Intro::endIntro() dsq->setCutscene(0); - dsq->title(); + dsq->title(true); } bool Intro::waitQuit(float t) diff --git a/Aquaria/Mod.cpp b/Aquaria/Mod.cpp index 5bcee5c..8035924 100644 --- a/Aquaria/Mod.cpp +++ b/Aquaria/Mod.cpp @@ -106,7 +106,7 @@ bool Mod::loadSavedGame(const std::string& path) debugLog("MOD: loadSavedGame/compatScript failed"); setActive(false); - dsq->title(); + dsq->title(false); return false; } @@ -226,13 +226,21 @@ void Mod::applyStart() dsq->continuity.reset(); dsq->scriptInterface.reset(); + if(!tryStart()) + { + setActive(false); + dsq->title(false); + } +} + +bool Mod::tryStart() +{ + // Before loading init.lua, load a compatibility layer, if necessary if(!loadCompatScript()) { debugLog("MOD: compatScript failed"); - setActive(false); - dsq->title(); - return; + return false; } // load the mod-init.lua file @@ -243,17 +251,12 @@ void Mod::applyStart() if (!dsq->runScript(scriptPath, "init")) { debugLog("MOD: runscript failed"); - setActive(false); - dsq->title(); + return false; } if (isActive() && game->sceneToLoad.empty()) { debugLog("MOD: no scene loaded in mod-init"); - setActive(false); - dsq->title(); - } - else if (isActive()) - { + return false; } } diff --git a/Aquaria/Mod.h b/Aquaria/Mod.h index 1e1245c..5065163 100644 --- a/Aquaria/Mod.h +++ b/Aquaria/Mod.h @@ -70,6 +70,7 @@ protected: int debugMenu; int enqueueModStart; void applyStart(); + bool tryStart(); std::string name; std::string path; diff --git a/Aquaria/ParticleEditor.cpp b/Aquaria/ParticleEditor.cpp index 0db9cdb..3e6415c 100644 --- a/Aquaria/ParticleEditor.cpp +++ b/Aquaria/ParticleEditor.cpp @@ -122,7 +122,7 @@ void ParticleEditor::goToTitle() if (!dsq->returnToScene.empty()) game->transitionToScene(dsq->returnToScene); else - dsq->title(); + dsq->title(false); } void ParticleEditor::load() diff --git a/Aquaria/ScriptInterface.cpp b/Aquaria/ScriptInterface.cpp index 1db3aea..ed1c7a3 100644 --- a/Aquaria/ScriptInterface.cpp +++ b/Aquaria/ScriptInterface.cpp @@ -3877,7 +3877,7 @@ luaFunc(jumpState) luaFunc(goToTitle) { - dsq->title(); + dsq->title(true); luaReturnNil(); } diff --git a/Aquaria/States.cpp b/Aquaria/States.cpp index 1bda990..7bcc69c 100644 --- a/Aquaria/States.cpp +++ b/Aquaria/States.cpp @@ -239,7 +239,7 @@ void GameOver::applyState() game->transitionToScene(game->sceneToLoad); } else - dsq->title(); + dsq->title(false); } void GameOver::removeState() @@ -252,7 +252,7 @@ void GameOver::removeState() void GameOver::onClick() { if (timer == 0) - dsq->title(); + dsq->title(true); } void GameOver::update(float dt) @@ -426,7 +426,7 @@ void Nag::onExit() switch (dsq->nagType) { case NAG_TOTITLE: - dsq->title(); + dsq->title(true); break; default: case NAG_QUIT: