Allow clicking to any unlocked locations on the Overworld Map rather than being forced to step through every adjacent stage to reach desired level. Release Build 9551.

mac-build
sigonasr2 6 months ago
parent a1e04d38d9
commit ba7ccf72b0
  1. 27
      Adventures in Lestoria/State_OverworldMap.cpp
  2. 2
      Adventures in Lestoria/Version.h
  3. BIN
      x64/Release/Adventures in Lestoria.exe

@ -111,6 +111,26 @@ void State_OverworldMap::OnUserUpdate(AiL*game){
||game->KEY_LEFT.Pressed()||game->KEY_RIGHT.Pressed()||game->KEY_UP.Pressed()||game->KEY_DOWN.Pressed() ||game->KEY_LEFT.Pressed()||game->KEY_RIGHT.Pressed()||game->KEY_UP.Pressed()||game->KEY_DOWN.Pressed()
||(!analogMove&&(abs(game->KEY_SCROLLHORZ_L.Analog())>=0.2f||abs(game->KEY_SCROLLVERT_L.Analog())>=0.2f))){ ||(!analogMove&&(abs(game->KEY_SCROLLHORZ_L.Analog())>=0.2f||abs(game->KEY_SCROLLVERT_L.Analog())>=0.2f))){
bool mouseUsed=game->GetMouse(Mouse::LEFT).bPressed&&geom2d::overlaps(game->GetWorldMousePos(),cp.rect); bool mouseUsed=game->GetMouse(Mouse::LEFT).bPressed&&geom2d::overlaps(game->GetWorldMousePos(),cp.rect);
if(Unlock::IsUnlocked(cp)){
if(mouseUsed){
UpdateCurrentConnectionPoint(cp);
playerTargetPos=currentConnectionPoint->rect.pos+currentConnectionPoint->rect.size/2+vf2d{0,16};
float angleTo=util::angleTo(game->GetPlayer()->GetPos(),playerTargetPos);
if(angleTo>=-3*PI/4&&angleTo<-PI/4){
game->GetPlayer()->UpdateWalkingAnimation(UP);
}else
if(angleTo<PI/4&&angleTo>=-PI/4){
game->GetPlayer()->UpdateWalkingAnimation(RIGHT);
}else
if(angleTo>=PI/4&&angleTo<3*PI/4){
game->GetPlayer()->UpdateWalkingAnimation(DOWN);
}else{
game->GetPlayer()->UpdateWalkingAnimation(LEFT);
}
if(abs(game->KEY_SCROLLHORZ_L.Analog())>=0.2f||abs(game->KEY_SCROLLVERT_L.Analog()>=0.2f))analogMove=true;
goto doneNavigating;
}else{
for(int directionInd=0;int neighborInd:currentConnectionPoint->neighbors){ for(int directionInd=0;int neighborInd:currentConnectionPoint->neighbors){
int targetDirection=-1; int targetDirection=-1;
@ -125,8 +145,7 @@ void State_OverworldMap::OnUserUpdate(AiL*game){
} }
ConnectionPoint&neighbor=ConnectionPointFromIndex(neighborInd); ConnectionPoint&neighbor=ConnectionPointFromIndex(neighborInd);
if(Unlock::IsUnlocked(neighbor.unlockCondition)&&&cp==&neighbor if(Unlock::IsUnlocked(neighbor.unlockCondition)&&targetDirection==directionInd){
&&(mouseUsed||targetDirection==directionInd)){
UpdateCurrentConnectionPoint(neighbor); UpdateCurrentConnectionPoint(neighbor);
playerTargetPos=currentConnectionPoint->rect.pos+currentConnectionPoint->rect.size/2+vf2d{0,16}; playerTargetPos=currentConnectionPoint->rect.pos+currentConnectionPoint->rect.size/2+vf2d{0,16};
float angleTo=util::angleTo(game->GetPlayer()->GetPos(),playerTargetPos); float angleTo=util::angleTo(game->GetPlayer()->GetPos(),playerTargetPos);
@ -148,6 +167,8 @@ void State_OverworldMap::OnUserUpdate(AiL*game){
} }
} }
} }
}
}
#pragma endregion #pragma endregion
doneNavigating: doneNavigating:
if(abs(game->KEY_SCROLLVERT_L.Analog())<0.2f&&abs(game->KEY_SCROLLHORZ_L.Analog())<0.2f){ if(abs(game->KEY_SCROLLVERT_L.Analog())<0.2f&&abs(game->KEY_SCROLLHORZ_L.Analog())<0.2f){
@ -172,7 +193,7 @@ void State_OverworldMap::Draw(AiL*game){
} }
bool highlightedAStage=false; bool highlightedAStage=false;
for(ConnectionPoint&cp:connections){ for(ConnectionPoint&cp:connections){
if(Unlock::IsUnlocked(cp)&&geom2d::overlaps(game->GetWorldMousePos(),cp.rect)&&(&cp==currentConnectionPoint||cp.IsNeighbor(*currentConnectionPoint))){ if(Unlock::IsUnlocked(cp)&&geom2d::overlaps(game->GetWorldMousePos(),cp.rect)){
drawutil::DrawCrosshairDecalTransformedView(game->view,cp.rect,currentTime); drawutil::DrawCrosshairDecalTransformedView(game->view,cp.rect,currentTime);
highlightedAStage=true; highlightedAStage=true;
break; break;

@ -39,7 +39,7 @@ All rights reserved.
#define VERSION_MAJOR 1 #define VERSION_MAJOR 1
#define VERSION_MINOR 2 #define VERSION_MINOR 2
#define VERSION_PATCH 3 #define VERSION_PATCH 3
#define VERSION_BUILD 9546 #define VERSION_BUILD 9551
#define stringify(a) stringify_(a) #define stringify(a) stringify_(a)
#define stringify_(a) #a #define stringify_(a) #a

Loading…
Cancel
Save