Hot swapping/plugging controllers now working. Refresh action sets of all active controllers. Release Build 8298.

mac-build
sigonasr2 8 months ago
parent 8f17c3b0fc
commit 3d621fa95b
  1. 10
      Adventures in Lestoria/AdventuresInLestoria.cpp
  2. 1
      Adventures in Lestoria/AdventuresInLestoria.h
  3. 1
      Adventures in Lestoria/Key.cpp
  4. 2
      Adventures in Lestoria/TODO.txt
  5. 2
      Adventures in Lestoria/Version.h
  6. BIN
      x64/Release/Adventures in Lestoria.exe

@ -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;
@ -3797,3 +3797,9 @@ bool AiL::Steam_Init(){
}
return false;
}
void AiL::ActivateActionSetForAllControllers(InputActionSetHandle_t actionSetHandle){
for(int i=0;i<Input::controllerCount;i++){
SteamInput()->ActivateActionSet(Input::steamControllers[i],Input::menuControlsHandle);
}
}

@ -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;

@ -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<<input<<" is active"<<std::endl;}
data.second.bPressed=data.second.bReleased=false;
if(!data.second.bHeld&&buttonData.bState){

@ -47,3 +47,5 @@ Sword attack should linger
Add game file debug logging
Automatically pause if controller is disconnected (while using a controller)
PS5 LED color support

@ -39,7 +39,7 @@ All rights reserved.
#define VERSION_MAJOR 0
#define VERSION_MINOR 5
#define VERSION_PATCH 1
#define VERSION_BUILD 8293
#define VERSION_BUILD 8298
#define stringify(a) stringify_(a)
#define stringify_(a) #a

Loading…
Cancel
Save