Implement item loadout controller compatibility. Added left analog stick map navigation to overworld map. Release Build 7005.

This commit is contained in:
2024-02-10 06:16:28 -06:00
parent 116c3c1a51
commit 5169670b76
9 changed files with 74 additions and 22 deletions
+10 -6
View File
@@ -100,15 +100,16 @@ void State_OverworldMap::OnUserUpdate(AiL*game){
#pragma region Handle Connection Point Clicking and Movement
for(ConnectionPoint&cp:connections){
if(game->GetMouse(Mouse::LEFT).bPressed&&geom2d::overlaps(game->GetWorldMousePos(),cp.rect)
||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))){
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())targetDirection=ConnectionPoint::WEST;
if(game->KEY_RIGHT.Pressed())targetDirection=ConnectionPoint::EAST;
if(game->KEY_UP.Pressed())targetDirection=ConnectionPoint::NORTH;
if(game->KEY_DOWN.Pressed())targetDirection=ConnectionPoint::SOUTH;
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++;
@@ -132,6 +133,7 @@ void State_OverworldMap::OnUserUpdate(AiL*game){
}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++;
@@ -140,7 +142,9 @@ void State_OverworldMap::OnUserUpdate(AiL*game){
}
#pragma endregion
doneNavigating:
int a;
if(abs(game->KEY_SCROLLVERT_L.Analog())<0.2f&&abs(game->KEY_SCROLLHORZ_L.Analog())<0.2f){
analogMove=false;
}
};
void State_OverworldMap::Draw(AiL*game){
currentTime+=game->GetElapsedTime();