When the game loses focus, the game will autopause during exploration. Release Build 8879.
This commit is contained in:
parent
77e2a654f4
commit
3c65db545d
@ -4075,3 +4075,9 @@ void AiL::ComputeModeColors(TilesetData&tileset){
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void AiL::OnWindowLoseFocus()const{
|
||||
if(!Menu::IsMenuOpen()&&GameState::STATE==GameState::states[States::GAME_RUN]){
|
||||
Menu::OpenMenu(MenuType::PAUSE);
|
||||
}
|
||||
}
|
@ -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;
|
||||
|
@ -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();
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user