diff --git a/Adventures in Lestoria/AdventuresInLestoria.cpp b/Adventures in Lestoria/AdventuresInLestoria.cpp index 75232670..57c4fb43 100644 --- a/Adventures in Lestoria/AdventuresInLestoria.cpp +++ b/Adventures in Lestoria/AdventuresInLestoria.cpp @@ -3972,4 +3972,15 @@ const bool AiL::QuitRequested()const{ } void AiL::SetQuitAllowed(bool quittingAllowed){ savingFile=!quittingAllowed; +} + + +const bool AiL::PreviousStageCompleted()const{ + return prevStageCompleted; +} +void AiL::SetCompletedStageFlag(){ + prevStageCompleted=true; +} +void AiL::ResetCompletedStageFlag(){ + prevStageCompleted=false; } \ No newline at end of file diff --git a/Adventures in Lestoria/AdventuresInLestoria.h b/Adventures in Lestoria/AdventuresInLestoria.h index cbd7a6e4..d066687a 100644 --- a/Adventures in Lestoria/AdventuresInLestoria.h +++ b/Adventures in Lestoria/AdventuresInLestoria.h @@ -184,6 +184,7 @@ private: bool displayHud=true; float vignetteDisplayTime=0.f; bool savingFile=false; + bool prevStageCompleted=false; void ValidateGameStatus(); void _PrepareLevel(MapName map,MusicChange changeMusic); @@ -325,6 +326,9 @@ public: void GlobalGameUpdates(); const bool QuitRequested()const; void SetQuitAllowed(bool quittingAllowed); //Locks the game from quitting during sensitive operations such as file saving/loading. + const bool PreviousStageCompleted()const; + void SetCompletedStageFlag(); + void ResetCompletedStageFlag(); struct TileGroupData{ vi2d tilePos; diff --git a/Adventures in Lestoria/PauseMenu.cpp b/Adventures in Lestoria/PauseMenu.cpp index b051c5cc..53322c25 100644 --- a/Adventures in Lestoria/PauseMenu.cpp +++ b/Adventures in Lestoria/PauseMenu.cpp @@ -74,7 +74,7 @@ void Menu::InitializePauseWindow(){ Component(LEVEL_COMPLETE,"Stage Complete Label")->SetLabel("Stage Summary"); Component(LEVEL_COMPLETE,"Level Details Outline")->SetLabel(""); - if(game->GetCurrentMapName()=="HUB")Unlock::UnlockCurrentMap(); //Special unlock for the hub area when leaving. + if(game->GetCurrentMapName()=="HUB"&&game->PreviousStageCompleted())Unlock::UnlockCurrentMap(); //Special unlock for the hub area when leaving. if(Unlock::IsUnlocked("STORY_1_1")){ Component(LEVEL_COMPLETE,"Next Button")->Enable(); diff --git a/Adventures in Lestoria/Player.cpp b/Adventures in Lestoria/Player.cpp index 672cda79..fa18c91f 100644 --- a/Adventures in Lestoria/Player.cpp +++ b/Adventures in Lestoria/Player.cpp @@ -1065,6 +1065,7 @@ void Player::CheckEndZoneCollision(){ endZoneStandTime+=game->GetElapsedTime(); if(endZoneStandTime>="Player.End Zone Wait Time"_F){ Component(LEVEL_COMPLETE,"Stage Complete Label")->SetLabel("Stage Completed"); + game->SetCompletedStageFlag(); Component(LEVEL_COMPLETE,"Level Details Outline")->SetLabel("Complete Bonus\n +10% XP"); if(Unlock::IsUnlocked("STORY_1_1")){ Component(LEVEL_COMPLETE,"Next Button")->Enable(); diff --git a/Adventures in Lestoria/State_OverworldMap.cpp b/Adventures in Lestoria/State_OverworldMap.cpp index 06f6e8fe..dcfff821 100644 --- a/Adventures in Lestoria/State_OverworldMap.cpp +++ b/Adventures in Lestoria/State_OverworldMap.cpp @@ -61,6 +61,8 @@ void State_OverworldMap::OnStateChange(GameState*prevState){ Component(MenuType::PAUSE,"Return to Camp Button")->SetGrayedOut(false); SaveFile::SaveGame(); + game->ResetCompletedStageFlag(); + if(Unlock::IsUnlocked("STORY_1_3")){ game->SetChapter(2); } diff --git a/Adventures in Lestoria/Version.h b/Adventures in Lestoria/Version.h index 04520c37..6d9ca67e 100644 --- a/Adventures in Lestoria/Version.h +++ b/Adventures in Lestoria/Version.h @@ -39,7 +39,7 @@ All rights reserved. #define VERSION_MAJOR 1 #define VERSION_MINOR 1 #define VERSION_PATCH 0 -#define VERSION_BUILD 8655 +#define VERSION_BUILD 8656 #define stringify(a) stringify_(a) #define stringify_(a) #a diff --git a/x64/Release/Adventures in Lestoria.exe b/x64/Release/Adventures in Lestoria.exe index 08c9295f..2a0b3dcb 100644 Binary files a/x64/Release/Adventures in Lestoria.exe and b/x64/Release/Adventures in Lestoria.exe differ