diff --git a/Adventures in Lestoria/AdventuresInLestoria.cpp b/Adventures in Lestoria/AdventuresInLestoria.cpp index f0da1a2b..bb4d22f4 100644 --- a/Adventures in Lestoria/AdventuresInLestoria.cpp +++ b/Adventures in Lestoria/AdventuresInLestoria.cpp @@ -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!"<InputGroup::menuInputGroups; std::vectorInputGroup::gameplayInputGroups; std::arrayInput::steamControllers; uint8_t Input::activeSteamControllerIndex; +uint8_t Input::controllerCount{0}; std::array>,16>Input::enumToActionName; +std::unordered_mapInput::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<GetGlyphPNGForActionOrigin(EInputActionOrigin(i),k_ESteamInputGlyphSize_Small,0U)}; + if(imageName!=nullptr){ + std::string loadImage{imageName}; + if(loadImage.length()>0&&!GFX.count(loadImage)){ + std::cout<GetConnectedControllers(steamControllers.data()); + controllerCount=SteamInput()->GetConnectedControllers(steamControllers.data()); for(int i=0;i(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: diff --git a/Adventures in Lestoria/Key.h b/Adventures in Lestoria/Key.h index 76644255..275e0038 100644 --- a/Adventures in Lestoria/Key.h +++ b/Adventures in Lestoria/Key.h @@ -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>,16>enumToActionName; + static std::unordered_mapsteamIconToGameIcon; static void Initialize(); static void UpdateSteamInput(); static std::arraysteamControllers; static uint8_t activeSteamControllerIndex; + static uint8_t controllerCount; + static void LoadSteamButtonIcons(); public: Input(InputType type,int key); bool Pressed(); diff --git a/Adventures in Lestoria/Version.h b/Adventures in Lestoria/Version.h index 4258e3cf..56831a41 100644 --- a/Adventures in Lestoria/Version.h +++ b/Adventures in Lestoria/Version.h @@ -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 diff --git a/Adventures in Lestoria/controller_config/controller_switch_pro.vdf b/Adventures in Lestoria/controller_config/controller_switch_pro.vdf index d24b9c09..e92b125f 100644 --- a/Adventures in Lestoria/controller_config/controller_switch_pro.vdf +++ b/Adventures in Lestoria/controller_config/controller_switch_pro.vdf @@ -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" diff --git a/Adventures in Lestoria/controller_config/controller_xbox360.vdf b/Adventures in Lestoria/controller_config/controller_xbox360.vdf index a6fb9c4e..8c312fdc 100644 --- a/Adventures in Lestoria/controller_config/controller_xbox360.vdf +++ b/Adventures in Lestoria/controller_config/controller_xbox360.vdf @@ -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" diff --git a/x64/Release/Adventures in Lestoria.exe b/x64/Release/Adventures in Lestoria.exe index fb3b73fd..8deccdde 100644 Binary files a/x64/Release/Adventures in Lestoria.exe and b/x64/Release/Adventures in Lestoria.exe differ