Add in controller rumble for steam API controllers. Release Build 8398.

pull/57/head
sigonasr2 8 months ago
parent 81d6e103cc
commit 8a3a101d28
  1. 12
      Adventures in Lestoria/Key.cpp
  2. 2
      Adventures in Lestoria/TODO.txt
  3. 2
      Adventures in Lestoria/Version.h
  4. BIN
      x64/Release/Adventures in Lestoria.exe

@ -427,7 +427,7 @@ float Input::Analog(){
std::string Input::GetDisplayName()const{ std::string Input::GetDisplayName()const{
if(type==STEAM){ if(type==STEAM){
return std::format("STEAM:{}",key); return std::format("{}",enumToActionName[activeSteamControllerIndex][Steam::SteamInput(key)].first);
} }
if(!GenericKey::keyLiteral.count({type,key}))return ""; if(!GenericKey::keyLiteral.count({type,key}))return "";
return GenericKey::keyLiteral.at({type,key}).displayName; return GenericKey::keyLiteral.at({type,key}).displayName;
@ -1083,6 +1083,9 @@ const bool Input::AxesActive(){
void Input::StartVibration(const bool override){ void Input::StartVibration(const bool override){
if(!GameSettings::RumbleEnabled(override))return; if(!GameSettings::RumbleEnabled(override))return;
if(UsingGamepad()){ if(UsingGamepad()){
if(SteamInput()){
SteamInput()->TriggerVibration(steamControllers[activeSteamControllerIndex],std::numeric_limits<unsigned short>::max(),std::numeric_limits<unsigned short>::max());
}else{
for(GamePad*gamepad:GamePad::getGamepads()){ for(GamePad*gamepad:GamePad::getGamepads()){
if(gamepad->stillConnected){ if(gamepad->stillConnected){
gamepad->startVibration(); gamepad->startVibration();
@ -1090,13 +1093,20 @@ void Input::StartVibration(const bool override){
} }
} }
} }
}
void Input::StopVibration(){ void Input::StopVibration(){
if(SteamInput()){
for(int i=0;i<controllerCount;i++){
SteamInput()->TriggerVibration(steamControllers[i],0U,0U);
}
}else{
for(GamePad*gamepad:GamePad::getGamepads()){ for(GamePad*gamepad:GamePad::getGamepads()){
if(gamepad->stillConnected){ if(gamepad->stillConnected){
gamepad->stopVibration(); gamepad->stopVibration();
} }
} }
} }
}
const bool operator<(const InputGroup&group1,const InputGroup&group2){ const bool operator<(const InputGroup&group1,const InputGroup&group2){
return &group1<&group2; return &group1<&group2;

@ -19,7 +19,7 @@ Remove Unlock All Button
Sword attack should linger Sword attack should linger
Add game file debug logging Add game file debug logging
Automatically pause if controller is disconnected (while using a controller) Controller Vibration
PS5 LED color support PS5 LED color support

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

Loading…
Cancel
Save