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. 57
      Adventures in Lestoria/State_OverworldMap.cpp
  2. 2
      Adventures in Lestoria/Version.h
  3. BIN
      x64/Release/Adventures in Lestoria.exe

@ -111,23 +111,10 @@ void State_OverworldMap::OnUserUpdate(AiL*game){
||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))){
bool mouseUsed=game->GetMouse(Mouse::LEFT).bPressed&&geom2d::overlaps(game->GetWorldMousePos(),cp.rect);
for(int directionInd=0;int neighborInd:currentConnectionPoint->neighbors){
int targetDirection=-1;
if(game->KEY_LEFT.Pressed()||game->KEY_SCROLLHORZ_L.Analog()<=-0.2f)targetDirection=ConnectionPoint::WEST;
if(game->KEY_RIGHT.Pressed()||game->KEY_SCROLLHORZ_L.Analog()>=0.2f)targetDirection=ConnectionPoint::EAST;
if(game->KEY_UP.Pressed()||game->KEY_SCROLLVERT_L.Analog()<=-0.2f)targetDirection=ConnectionPoint::NORTH;
if(game->KEY_DOWN.Pressed()||game->KEY_SCROLLVERT_L.Analog()>=0.2f)targetDirection=ConnectionPoint::SOUTH;
if(neighborInd==-1){
directionInd++;
continue;
}
ConnectionPoint&neighbor=ConnectionPointFromIndex(neighborInd);
if(Unlock::IsUnlocked(neighbor.unlockCondition)&&&cp==&neighbor
&&(mouseUsed||targetDirection==directionInd)){
UpdateCurrentConnectionPoint(neighbor);
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){
@ -143,8 +130,42 @@ void State_OverworldMap::OnUserUpdate(AiL*game){
}
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){
int targetDirection=-1;
if(game->KEY_LEFT.Pressed()||game->KEY_SCROLLHORZ_L.Analog()<=-0.2f)targetDirection=ConnectionPoint::WEST;
if(game->KEY_RIGHT.Pressed()||game->KEY_SCROLLHORZ_L.Analog()>=0.2f)targetDirection=ConnectionPoint::EAST;
if(game->KEY_UP.Pressed()||game->KEY_SCROLLVERT_L.Analog()<=-0.2f)targetDirection=ConnectionPoint::NORTH;
if(game->KEY_DOWN.Pressed()||game->KEY_SCROLLVERT_L.Analog()>=0.2f)targetDirection=ConnectionPoint::SOUTH;
if(neighborInd==-1){
directionInd++;
continue;
}
ConnectionPoint&neighbor=ConnectionPointFromIndex(neighborInd);
if(Unlock::IsUnlocked(neighbor.unlockCondition)&&targetDirection==directionInd){
UpdateCurrentConnectionPoint(neighbor);
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;
}
directionInd++;
}
}
directionInd++;
}
}
}
@ -172,7 +193,7 @@ void State_OverworldMap::Draw(AiL*game){
}
bool highlightedAStage=false;
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);
highlightedAStage=true;
break;

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

Loading…
Cancel
Save