Added visited connection point alerts to stage plates. Removed save on window close (Deciding that saving the game at smart locations when the game is in a known good state is a better idea). Player XP config fixed.

This commit is contained in:
2024-01-22 02:40:26 -06:00
parent 6907b35e16
commit 8a1689cb07
9 changed files with 52 additions and 6 deletions
@@ -180,6 +180,12 @@ void State_OverworldMap::Draw(AiL*game){
for(ConnectionPoint&cp:connections){
if(!Unlock::IsUnlocked(cp)){
game->view.FillRectDecal(cp.rect.pos,cp.rect.size,{0,0,0,128});
}else{
float exclamationScale=fmod(game->GetRuntime(),1.0f)<0.2f?1.f:1.2f;
if(!cp.Visited()){
game->view.DrawDecal(cp.rect.pos+vf2d{-1.f,0.f},GFX["exclamation.png"].Decal(),{exclamationScale,exclamationScale},BLACK);
game->view.DrawDecal(cp.rect.pos+vf2d{-1.f,-1.f},GFX["exclamation.png"].Decal(),{exclamationScale,exclamationScale});
}
}
}
for(ConnectionPoint&cp:connections){
@@ -248,6 +254,7 @@ ConnectionPoint&State_OverworldMap::GetCurrentConnectionPoint(){
void State_OverworldMap::StartLevel(){
game->UpdateDiscordStatus(State_OverworldMap::GetCurrentConnectionPoint().name,game->GetPlayer()->GetClassName());
State_OverworldMap::GetCurrentConnectionPoint().SetVisited();
SaveFile::SaveGame();
if(State_OverworldMap::GetCurrentConnectionPoint().map.starts_with("STORY")){
VisualNovel::LoadVisualNovel(State_OverworldMap::GetCurrentConnectionPoint().map);
@@ -264,4 +271,16 @@ void State_OverworldMap::UpdateCurrentConnectionPoint(const ConnectionPoint&conn
Component<EncountersSpawnListScrollableWindowComponent>(OVERWORLD_LEVEL_SELECT,"Spawns List")->UpdateSpawns(currentConnectionPoint->spawns);
Component<MenuComponent>(OVERWORLD_LEVEL_SELECT,"Enter Button")->Enable(currentConnectionPoint->levelDataExists);
Component<MenuComponent>(OVERWORLD_LEVEL_SELECT,"Change Loadout Button")->Enable(currentConnectionPoint->levelDataExists&&!(currentConnectionPoint->type=="STORY"||currentConnectionPoint->type=="SHOP"));
}
std::optional<ConnectionPoint*>State_OverworldMap::ConnectionPointFromString(std::string_view mapName){
auto foundItem=std::find_if(connections.begin(),connections.end(),[&](ConnectionPoint&cp){return cp.map==mapName;});
if(foundItem!=connections.end())return &*foundItem;
return {};
}
void State_OverworldMap::ResetConnectionPoints(){
for(ConnectionPoint&cp:connections){
cp.visited=false;
}
}