Retrieve Steam icons from steam platform files. Update official controller configs. Release Build 8290.

pull/57/head
sigonasr2 8 months ago
parent bdad7cf186
commit 3be02315a5
  1. 1
      Adventures in Lestoria/AdventuresInLestoria.cpp
  2. 125
      Adventures in Lestoria/Key.cpp
  3. 7
      Adventures in Lestoria/Key.h
  4. 2
      Adventures in Lestoria/Version.h
  5. 167
      Adventures in Lestoria/controller_config/controller_switch_pro.vdf
  6. 194
      Adventures in Lestoria/controller_config/controller_xbox360.vdf
  7. BIN
      x64/Release/Adventures in Lestoria.exe

@ -326,6 +326,7 @@ bool AiL::OnUserCreate(){
if(SteamAPI_RestartAppIfNecessary(2895980U))return false; //Immediately quit if steam is detected and can be started through it.
if(Steam_Init()){
std::cout<<"Steam API Initialized successfully!"<<std::endl;
Input::LoadSteamButtonIcons();
}else{
std::cout<<"Steam API failed to initialize!"<<std::endl;
}

@ -54,8 +54,88 @@ std::vector<std::string>InputGroup::menuInputGroups;
std::vector<std::string>InputGroup::gameplayInputGroups;
std::array<InputHandle_t,16>Input::steamControllers;
uint8_t Input::activeSteamControllerIndex;
uint8_t Input::controllerCount{0};
std::array<std::unordered_map<Steam::SteamInput,std::pair<std::string,HWButton>>,16>Input::enumToActionName;
std::unordered_map<EInputActionOrigin,std::string>Input::steamIconToGameIcon{
{k_EInputActionOrigin_SteamController_A,"themes/button_d_xb.png"},
{k_EInputActionOrigin_XBoxOne_A,"themes/button_d_xb.png"},
{k_EInputActionOrigin_XBox360_A,"themes/button_d_xb.png"},
{k_EInputActionOrigin_Switch_A,"themes/button_d_xb.png"},
{k_EInputActionOrigin_Switch_JoyConButton_S,"themes/button_d_xb.png"},
{k_EInputActionOrigin_SteamDeck_A,"themes/button_d_xb.png"},
{k_EInputActionOrigin_SteamController_B,"themes/button_r_xb.png"},
{k_EInputActionOrigin_XBoxOne_B,"themes/button_r_xb.png"},
{k_EInputActionOrigin_XBox360_B,"themes/button_r_xb.png"},
{k_EInputActionOrigin_Switch_B,"themes/button_r_xb.png"},
{k_EInputActionOrigin_Switch_JoyConButton_W,"themes/button_r_xb.png"},
{k_EInputActionOrigin_SteamDeck_B,"themes/button_r_xb.png"},
{k_EInputActionOrigin_SteamController_X,"themes/button_l_xb.png"},
{k_EInputActionOrigin_XBoxOne_X,"themes/button_l_xb.png"},
{k_EInputActionOrigin_XBox360_X,"themes/button_l_xb.png"},
{k_EInputActionOrigin_Switch_X,"themes/button_l_xb.png"},
{k_EInputActionOrigin_Switch_JoyConButton_E,"themes/button_l_xb.png"},
{k_EInputActionOrigin_SteamDeck_X,"themes/button_l_xb.png"},
{k_EInputActionOrigin_SteamController_Y,"themes/button_u_xb.png"},
{k_EInputActionOrigin_XBoxOne_Y,"themes/button_u_xb.png"},
{k_EInputActionOrigin_XBox360_Y,"themes/button_u_xb.png"},
{k_EInputActionOrigin_Switch_Y,"themes/button_u_xb.png"},
{k_EInputActionOrigin_Switch_JoyConButton_N,"themes/button_u_xb.png"},
{k_EInputActionOrigin_SteamDeck_Y,"themes/button_u_xb.png"},
{k_EInputActionOrigin_SteamController_LeftBumper,"themes/button_l1.png"},
{k_EInputActionOrigin_PS4_LeftBumper,"themes/button_l1.png"},
{k_EInputActionOrigin_XBoxOne_LeftBumper,"themes/button_l1.png"},
{k_EInputActionOrigin_XBox360_LeftBumper,"themes/button_l1.png"},
{k_EInputActionOrigin_Switch_LeftBumper,"themes/button_l1.png"},
{k_EInputActionOrigin_SteamDeck_L1,"themes/button_l1.png"},
{k_EInputActionOrigin_SteamController_RightBumper,"themes/button_r1.png"},
{k_EInputActionOrigin_PS4_RightBumper,"themes/button_r1.png"},
{k_EInputActionOrigin_XBoxOne_RightBumper,"themes/button_r1.png"},
{k_EInputActionOrigin_XBox360_RightBumper,"themes/button_r1.png"},
{k_EInputActionOrigin_Switch_RightBumper,"themes/button_r1.png"},
{k_EInputActionOrigin_SteamDeck_R1,"themes/button_r1.png"},
{k_EInputActionOrigin_SteamController_RightTrigger_Pull,"themes/button_r2.png"},
{k_EInputActionOrigin_PS4_RightTrigger_Pull,"themes/button_r2.png"},
{k_EInputActionOrigin_XBoxOne_RightTrigger_Pull,"themes/button_r2.png"},
{k_EInputActionOrigin_XBox360_RightTrigger_Pull,"themes/button_r2.png"},
{k_EInputActionOrigin_Switch_RightTrigger_Pull,"themes/button_r2.png"},
{k_EInputActionOrigin_SteamDeck_R2_SoftPull,"themes/button_r2.png"},
{k_EInputActionOrigin_SteamController_RightTrigger_Click,"themes/button_r2.png"},
{k_EInputActionOrigin_PS4_RightTrigger_Click,"themes/button_r2.png"},
{k_EInputActionOrigin_XBoxOne_RightTrigger_Click,"themes/button_r2.png"},
{k_EInputActionOrigin_XBox360_RightTrigger_Click,"themes/button_r2.png"},
{k_EInputActionOrigin_Switch_RightTrigger_Click,"themes/button_r2.png"},
{k_EInputActionOrigin_SteamDeck_R2,"themes/button_r2.png"},
{k_EInputActionOrigin_SteamController_LeftTrigger_Pull,"themes/button_l2.png"},
{k_EInputActionOrigin_PS4_LeftTrigger_Pull,"themes/button_l2.png"},
{k_EInputActionOrigin_XBoxOne_LeftTrigger_Pull,"themes/button_l2.png"},
{k_EInputActionOrigin_XBox360_LeftTrigger_Pull,"themes/button_l2.png"},
{k_EInputActionOrigin_Switch_LeftTrigger_Pull,"themes/button_l2.png"},
{k_EInputActionOrigin_SteamDeck_L2_SoftPull,"themes/button_l2.png"},
{k_EInputActionOrigin_SteamController_LeftTrigger_Click,"themes/button_l2.png"},
{k_EInputActionOrigin_PS4_LeftTrigger_Click,"themes/button_l2.png"},
{k_EInputActionOrigin_XBoxOne_LeftTrigger_Click,"themes/button_l2.png"},
{k_EInputActionOrigin_XBox360_LeftTrigger_Click,"themes/button_l2.png"},
{k_EInputActionOrigin_Switch_LeftTrigger_Click,"themes/button_l2.png"},
{k_EInputActionOrigin_SteamDeck_L2,"themes/button_l2.png"},
{k_EInputActionOrigin_PS4_X,"themes/button_d_ps.png"},
{k_EInputActionOrigin_PS4_Circle,"themes/button_r_ps.png"},
{k_EInputActionOrigin_PS4_Triangle,"themes/button_u_ps.png"},
{k_EInputActionOrigin_PS4_Square,"themes/button_l_ps.png"},
{k_EInputActionOrigin_SteamController_LeftStick_Move,"themes/button_analogstick.png"},
{k_EInputActionOrigin_PS4_LeftStick_Move,"themes/button_analogstick.png"},
{k_EInputActionOrigin_PS4_RightStick_Move,"themes/button_analogstick.png"},
{k_EInputActionOrigin_XBoxOne_LeftStick_Move,"themes/button_analogstick.png"},
{k_EInputActionOrigin_XBoxOne_RightStick_Move,"themes/button_analogstick.png"},
{k_EInputActionOrigin_XBox360_LeftStick_Move,"themes/button_analogstick.png"},
{k_EInputActionOrigin_XBox360_RightStick_Move,"themes/button_analogstick.png"},
{k_EInputActionOrigin_Switch_LeftStick_Move,"themes/button_analogstick.png"},
{k_EInputActionOrigin_Switch_RightStick_Move,"themes/button_analogstick.png"},
{k_EInputActionOrigin_PS5_LeftStick_Move,"themes/button_analogstick.png"},
{k_EInputActionOrigin_PS5_RightStick_Move,"themes/button_analogstick.png"},
{k_EInputActionOrigin_SteamDeck_LeftStick_Move,"themes/button_analogstick.png"},
{k_EInputActionOrigin_SteamDeck_RightStick_Move,"themes/button_analogstick.png"},
};
Input::Input(InputType type,int key)
:type(type),key(key){}
@ -90,9 +170,25 @@ void Input::Initialize(){
}
}
void Input::LoadSteamButtonIcons(){
GFX.Unlock();
std::cout<<std::format("Steam Icons may be required... Loading in {} icons",int(k_EInputActionOrigin_Count))<<std::endl;
for(int i=1;i<k_EInputActionOrigin_Count;i++){
const char*imageName{SteamInput()->GetGlyphPNGForActionOrigin(EInputActionOrigin(i),k_ESteamInputGlyphSize_Small,0U)};
if(imageName!=nullptr){
std::string loadImage{imageName};
if(loadImage.length()>0&&!GFX.count(loadImage)){
std::cout<<std::format("Loading steam image {}",loadImage)<<std::endl;
GFX[loadImage].Load(loadImage);
}
}
}
GFX.SetInitialized();
}
void Input::UpdateSteamInput(){
if(SteamInput()){
int controllerCount=SteamInput()->GetConnectedControllers(steamControllers.data());
controllerCount=SteamInput()->GetConnectedControllers(steamControllers.data());
for(int i=0;i<controllerCount;i++){
for(auto&[input,data]:enumToActionName[i]){
HWButton prevState=data.second;
@ -232,7 +328,34 @@ float Input::Analog(){
}
}
}else{
for(int i=0;i<controllerCount;i++){
switch(static_cast<GPAxes>(key)){
case GPAxes::LX:{
InputDigitalActionHandle_t inputHnd=SteamInput()->GetDigitalActionHandle("");
}break;
case GPAxes::LY:{
}break;
case GPAxes::RX:{
}break;
case GPAxes::RY:{
}break;
case GPAxes::TL:{
}break;
case GPAxes::TR:{
}break;
case GPAxes::DX:{
}break;
case GPAxes::DY:{
}break;
}
}
}
}break;
case KEY:

@ -63,7 +63,7 @@ namespace Steam{
enum SteamInput{
//Gameplay Inputs
MOVE, //This is the left stick analog input. Whenever we use this, we assume left stick is being used.
MANUAL_AIM,
MANUAL_AIM, //This is the right stick analog input. Whenever we use this, we assume right stick is being used.
BASIC_ATTACK,
DEFENSIVE,
MENU_PAUSE,
@ -75,7 +75,7 @@ namespace Steam{
ITEM_2,
ITEM_3,
//Menu Inputs
NAVIGATE,
NAVIGATE, //This is the left stick analog input. Whenever we use this, we assume left stick is being used.
SCROLL, //This is the right stick analog input. Whenever we use this, we assume right stick is being used.
CONFIRM,
BACK,
@ -103,10 +103,13 @@ class Input{
static bool usingGamepad;
static void SetUsingGamepad(const bool usingGamepad);
static std::array<std::unordered_map<Steam::SteamInput,std::pair<std::string,HWButton>>,16>enumToActionName;
static std::unordered_map<EInputActionOrigin,std::string>steamIconToGameIcon;
static void Initialize();
static void UpdateSteamInput();
static std::array<InputHandle_t,16>steamControllers;
static uint8_t activeSteamControllerIndex;
static uint8_t controllerCount;
static void LoadSteamButtonIcons();
public:
Input(InputType type,int key);
bool Pressed();

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

@ -1,7 +1,7 @@
"controller_mappings"
{
"version" "3"
"revision" "33"
"revision" "44"
"title" "Switch"
"description" "Default Switch controller setup."
"creator" "76561198025675819"
@ -12,7 +12,7 @@
"controller_caps" "613772287"
"major_revision" "0"
"minor_revision" "0"
"Timestamp" "1711238146"
"Timestamp" "1711284115"
"actions"
{
"InGameControls"
@ -570,6 +570,163 @@
}
}
"group"
{
"id" "18"
"mode" "dpad"
"name" ""
"description" ""
"inputs"
{
"dpad_north"
{
"activators"
{
"Full_Press"
{
"bindings"
{
"binding" "game_action MenuControls Up, , "
}
}
}
"disabled_activators"
{
}
}
"dpad_south"
{
"activators"
{
"Full_Press"
{
"bindings"
{
"binding" "game_action MenuControls Down, , "
}
}
}
"disabled_activators"
{
}
}
"dpad_east"
{
"activators"
{
"Full_Press"
{
"bindings"
{
"binding" "game_action MenuControls Right, , "
}
}
}
"disabled_activators"
{
}
}
"dpad_west"
{
"activators"
{
"Full_Press"
{
"bindings"
{
"binding" "game_action MenuControls Left, , "
}
}
}
"disabled_activators"
{
}
}
}
"settings"
{
"requires_click" "0"
"haptic_intensity_override" "0"
}
}
"group"
{
"id" "19"
"mode" "dpad"
"name" ""
"description" ""
"inputs"
{
"dpad_north"
{
"activators"
{
"Full_Press"
{
"bindings"
{
"binding" "game_action MenuControls Up, , "
}
}
}
"disabled_activators"
{
}
}
"dpad_south"
{
"activators"
{
"Full_Press"
{
"bindings"
{
"binding" "game_action MenuControls Down, , "
}
}
}
"disabled_activators"
{
}
}
"dpad_east"
{
"activators"
{
"Full_Press"
{
"bindings"
{
"binding" "game_action MenuControls Right, , "
}
}
}
"disabled_activators"
{
}
}
"dpad_west"
{
"activators"
{
"Full_Press"
{
"bindings"
{
"binding" "game_action MenuControls Left, , "
}
}
}
"disabled_activators"
{
}
}
}
"settings"
{
"requires_click" "0"
}
}
"group"
{
"id" "0"
"mode" "switches"
@ -774,9 +931,11 @@
"5" "button_diamond active"
"6" "left_trigger active"
"7" "right_trigger active"
"12" "joystick active"
"12" "joystick inactive"
"19" "joystick active"
"13" "right_joystick active"
"11" "dpad active"
"11" "dpad inactive"
"18" "dpad active"
}
}
"settings"

@ -1,18 +1,18 @@
"controller_mappings"
{
"version" "3"
"revision" "26"
"title" "Xbox/Playstation/Switch"
"description" "Default Xbox/Playstation/Switch controller setup."
"revision" "37"
"title" "XBox/Playstation"
"description" "Default Xbox/Playstation controller setup."
"creator" "76561198025675819"
"progenitor" ""
"url" "autosave://C:\\Program Files (x86)\\Steam\\steamapps\\common\\Steam Controller Configs\\65410091\\config\\2895980\\controller_xbox360.vdf"
"export_type" "personal_cloud"
"export_type" "personal_local"
"controller_type" "controller_xbox360"
"controller_caps" "1590271"
"major_revision" "0"
"minor_revision" "0"
"Timestamp" "1711221628"
"Timestamp" "1711284058"
"actions"
{
"InGameControls"
@ -55,11 +55,6 @@
"legacy_set" "0"
"StickPadGyro"
{
"Navigate"
{
"title" "#Gameplay_Move"
"input_mode" "joystick_move"
}
"Scroll"
{
"title" "#Menu_Scroll"
@ -117,10 +112,10 @@
"Menu_Function1" "Function 1"
"Menu_Function2" "Function 2"
"Menu_Menu" "Menu/Pause"
"Menu_Up" "Up"
"Menu_Down" "Down"
"Menu_Left" "Left"
"Menu_Right" "Right"
"Menu_Up" "Menu Up"
"Menu_Down" "Menu Down"
"Menu_Left" "Menu Left"
"Menu_Right" "Menu Right"
"Menu_Scroll" "Scroll"
"Menu_ScrollUp" "Fast Scroll Up"
"Menu_ScrollDown" "Fast Scroll Down"
@ -487,10 +482,6 @@
{
"virtual_mode" "1"
}
"gameactions"
{
"MenuControls" "Navigate"
}
}
"group"
{
@ -505,10 +496,6 @@
{
"virtual_mode" "1"
}
"gameactions"
{
"MenuControls" "Navigate"
}
}
"group"
{
@ -583,6 +570,163 @@
}
}
"group"
{
"id" "17"
"mode" "dpad"
"name" ""
"description" ""
"inputs"
{
"dpad_north"
{
"activators"
{
"Full_Press"
{
"bindings"
{
"binding" "game_action MenuControls Up, , "
}
}
}
"disabled_activators"
{
}
}
"dpad_south"
{
"activators"
{
"Full_Press"
{
"bindings"
{
"binding" "game_action MenuControls Down, , "
}
}
}
"disabled_activators"
{
}
}
"dpad_east"
{
"activators"
{
"Full_Press"
{
"bindings"
{
"binding" "game_action MenuControls Right, , "
}
}
}
"disabled_activators"
{
}
}
"dpad_west"
{
"activators"
{
"Full_Press"
{
"bindings"
{
"binding" "game_action MenuControls Left, , "
}
}
}
"disabled_activators"
{
}
}
}
"settings"
{
"requires_click" "0"
"haptic_intensity_override" "0"
}
}
"group"
{
"id" "18"
"mode" "dpad"
"name" ""
"description" ""
"inputs"
{
"dpad_north"
{
"activators"
{
"Full_Press"
{
"bindings"
{
"binding" "game_action MenuControls Up, , "
}
}
}
"disabled_activators"
{
}
}
"dpad_south"
{
"activators"
{
"Full_Press"
{
"bindings"
{
"binding" "game_action MenuControls Down, , "
}
}
}
"disabled_activators"
{
}
}
"dpad_east"
{
"activators"
{
"Full_Press"
{
"bindings"
{
"binding" "game_action MenuControls Right, , "
}
}
}
"disabled_activators"
{
}
}
"dpad_west"
{
"activators"
{
"Full_Press"
{
"bindings"
{
"binding" "game_action MenuControls Left, , "
}
}
}
"disabled_activators"
{
}
}
}
"settings"
{
"requires_click" "0"
}
}
"group"
{
"id" "0"
"mode" "switches"
@ -755,9 +899,11 @@
"5" "button_diamond active"
"6" "left_trigger active"
"7" "right_trigger active"
"12" "joystick active"
"12" "joystick inactive"
"18" "joystick active"
"13" "right_joystick active"
"11" "dpad active"
"11" "dpad inactive"
"17" "dpad active"
}
}
"settings"

Loading…
Cancel
Save