diff --git a/Adventures in Lestoria/AdventuresInLestoria.cpp b/Adventures in Lestoria/AdventuresInLestoria.cpp index bb4d22f4..3492ec7c 100644 --- a/Adventures in Lestoria/AdventuresInLestoria.cpp +++ b/Adventures in Lestoria/AdventuresInLestoria.cpp @@ -353,7 +353,7 @@ bool AiL::OnUserUpdate(float fElapsedTime){ Input::ingameControlsHandle=SteamInput()->GetActionSetHandle("InGameControls"); Input::menuControlsHandle=SteamInput()->GetActionSetHandle("MenuControls"); } - SteamInput()->ActivateActionSet(STEAM_INPUT_HANDLE_ALL_CONTROLLERS,Input::menuControlsHandle); + ActivateActionSetForAllControllers(Input::menuControlsHandle); Input::UpdateSteamInput(); } @@ -434,7 +434,7 @@ bool AiL::DownPressed(){ void AiL::HandleUserInput(float fElapsedTime){ if(!Menu::stack.empty())return; //A window being opened means there's no user input allowed. - if(SteamInput())SteamInput()->ActivateActionSet(STEAM_INPUT_HANDLE_ALL_CONTROLLERS,Input::ingameControlsHandle); + if(SteamInput())ActivateActionSetForAllControllers(Input::ingameControlsHandle); if(GetKey(SCROLL).bPressed)displayHud=!displayHud; @@ -3796,4 +3796,10 @@ bool AiL::Steam_Init(){ return true; } return false; +} + +void AiL::ActivateActionSetForAllControllers(InputActionSetHandle_t actionSetHandle){ + for(int i=0;iActivateActionSet(Input::steamControllers[i],Input::menuControlsHandle); + } } \ No newline at end of file diff --git a/Adventures in Lestoria/AdventuresInLestoria.h b/Adventures in Lestoria/AdventuresInLestoria.h index 1f7ff245..b07ecbf9 100644 --- a/Adventures in Lestoria/AdventuresInLestoria.h +++ b/Adventures in Lestoria/AdventuresInLestoria.h @@ -304,6 +304,7 @@ public: rcode LoadResource(Renderable&renderable,std::string_view imgPath,bool filter=false,bool clamp=true); void UpdateMonsters(); bool Steam_Init(); + void ActivateActionSetForAllControllers(InputActionSetHandle_t actionSetHandle); struct TileGroupData{ vi2d tilePos; diff --git a/Adventures in Lestoria/Key.cpp b/Adventures in Lestoria/Key.cpp index 7b5247ed..a133bd3e 100644 --- a/Adventures in Lestoria/Key.cpp +++ b/Adventures in Lestoria/Key.cpp @@ -197,6 +197,7 @@ void Input::UpdateSteamInput(){ InputDigitalActionHandle_t inputHnd=SteamInput()->GetDigitalActionHandle(data.first.c_str()); InputDigitalActionData_t buttonData=SteamInput()->GetDigitalActionData(steamControllers[i],inputHnd); if(!buttonData.bActive)continue; //Ignore inputs that are not active. + if(buttonData.bActive){std::cout<