Implement item loadout controller compatibility. Added left analog stick map navigation to overworld map. Release Build 7005.
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user