diff --git a/Adventures in Lestoria/AdventuresInLestoria.cpp b/Adventures in Lestoria/AdventuresInLestoria.cpp index 6d927949..79e7ed05 100644 --- a/Adventures in Lestoria/AdventuresInLestoria.cpp +++ b/Adventures in Lestoria/AdventuresInLestoria.cpp @@ -4074,4 +4074,10 @@ void AiL::ComputeModeColors(TilesetData&tileset){ #pragma endregion } } +} + +void AiL::OnWindowLoseFocus()const{ + if(!Menu::IsMenuOpen()&&GameState::STATE==GameState::states[States::GAME_RUN]){ + Menu::OpenMenu(MenuType::PAUSE); + } } \ No newline at end of file diff --git a/Adventures in Lestoria/AdventuresInLestoria.h b/Adventures in Lestoria/AdventuresInLestoria.h index 3f0aae6f..48e41589 100644 --- a/Adventures in Lestoria/AdventuresInLestoria.h +++ b/Adventures in Lestoria/AdventuresInLestoria.h @@ -205,6 +205,7 @@ public: bool OnUserCreate() override; bool OnUserUpdate(float fElapsedTime) override; bool OnUserDestroy() override; + void OnWindowLoseFocus()const override final; void GetAnyKeyPress(Key key)override final; void GetAnyKeyRelease(Key key)override final; void GetAnyMousePress(int32_t mouseButton)override final; diff --git a/Adventures in Lestoria/Minimap.cpp b/Adventures in Lestoria/Minimap.cpp index b743ae96..4ef7ae8b 100644 --- a/Adventures in Lestoria/Minimap.cpp +++ b/Adventures in Lestoria/Minimap.cpp @@ -136,6 +136,19 @@ void Minimap::Reset(){ } } } + + if(game->GetZones().count("EndZone")){ + for(const ZoneData&zone:game->GetZones().at("EndZone")){ + vf2d ringPos=zone.zone.pos/game->GetCurrentMapData().TileSize; + vf2d ringSize=zone.zone.size/game->GetCurrentMapData().TileSize; + for(int y=0;y<=ringSize.y;y++){ + for(int x=0;x<=ringSize.x;x++){ + minimap.Sprite()->SetPixel(ringPos+vi2d{x,y},GREEN); + } + } + } + } + game->SetDrawTarget(nullptr); minimap.Decal()->Update(); diff --git a/Adventures in Lestoria/Version.h b/Adventures in Lestoria/Version.h index a714dae4..74123f8b 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 8875 +#define VERSION_BUILD 8879 #define stringify(a) stringify_(a) #define stringify_(a) #a diff --git a/Adventures in Lestoria/olcPixelGameEngine.h b/Adventures in Lestoria/olcPixelGameEngine.h index 1b82ed05..aa126699 100644 --- a/Adventures in Lestoria/olcPixelGameEngine.h +++ b/Adventures in Lestoria/olcPixelGameEngine.h @@ -1021,6 +1021,7 @@ namespace olc // Called when a console command is executed virtual bool OnConsoleCommand(const std::string& sCommand); virtual void OnRequestCompleted(const std::string_view receivedData)const; + virtual void OnWindowLoseFocus()const; virtual olc::rcode SendRequest(std::string_view url,std::string_view data); @@ -4619,6 +4620,7 @@ namespace olc bool PixelGameEngine::OnConsoleCommand(const std::string& sCommand) { UNUSED(sCommand); return false; } void PixelGameEngine::OnRequestCompleted(const std::string_view receivedData)const{} + void PixelGameEngine::OnWindowLoseFocus()const{} olc::rcode PixelGameEngine::SendRequest(std::string_view url,std::string_view data){platform->SendRequest(url,data);return olc::rcode::OK;}; @@ -4698,6 +4700,7 @@ namespace olc olc_UpdateKeyState(i,false); } } + if(!state)OnWindowLoseFocus(); bHasInputFocus = state; } diff --git a/x64/Release/Adventures in Lestoria.exe b/x64/Release/Adventures in Lestoria.exe index d3f5d392..dd393502 100644 Binary files a/x64/Release/Adventures in Lestoria.exe and b/x64/Release/Adventures in Lestoria.exe differ