Minimap can only be toggled when it's actually visible (e.g. not during boss fights)

mac-build
sigonasr2 8 months ago
parent 3215414e11
commit ae72a05fe0
  1. 8
      Adventures in Lestoria/Minimap.cpp
  2. 2
      Adventures in Lestoria/Minimap.h

@ -162,7 +162,7 @@ void Minimap::Reset(){
}
void Minimap::Update(){
if(game->KEY_TOGGLE_MAP.Pressed()){
if(game->KEY_TOGGLE_MAP.Pressed()&&MinimapVisible()){
if(displayMode==MinimapMode::SMALL)displayMode=MinimapMode::LARGE;
else if(displayMode==MinimapMode::LARGE)displayMode=MinimapMode::OFF;
else if(displayMode==MinimapMode::OFF)displayMode=MinimapMode::SMALL;
@ -212,7 +212,7 @@ void Minimap::UpdateChunk(const MapName map,const vi2d chunkPos){
void Minimap::Draw(){
const vf2d minimapPos=vf2d{float("Minimap.Minimap HUD Size"_I),float("Minimap.Minimap HUD Size"_I)}/2;
if(!game->InBossEncounter()){
if(MinimapVisible()){
switch(displayMode){
case MinimapMode::SMALL:{
mapCircleHud.DrawRotatedDecal(minimapPos,cover.Decal(),0.f,game->camera.GetPosition()/game->GetCurrentMapData().tilewidth,vf2d{0.5f,0.5f});
@ -242,3 +242,7 @@ const MinimapMode&Minimap::GetMinimapMode()const{
void Minimap::SetMinimapMode(MinimapMode newMode){
displayMode=newMode;
}
bool Minimap::MinimapVisible(){
return !game->InBossEncounter();
}

@ -67,4 +67,6 @@ private:
Renderable coverOutline;
std::unordered_map<MapName,std::unordered_set<std::string>>loadedChunks;
MinimapMode displayMode=MinimapMode::SMALL;
bool MinimapVisible();
};
Loading…
Cancel
Save