diff --git a/es-app/src/guis/GuiMenu.cpp b/es-app/src/guis/GuiMenu.cpp index 6412e1aa8..f0b805bc6 100644 --- a/es-app/src/guis/GuiMenu.cpp +++ b/es-app/src/guis/GuiMenu.cpp @@ -1090,6 +1090,7 @@ void GuiMenu::openInputDeviceOptions() inputControllerType->add("PLAYSTATION 3", "ps3", selectedPlayer == "ps3"); inputControllerType->add("PLAYSTATION 4", "ps4", selectedPlayer == "ps4"); inputControllerType->add("PLAYSTATION 5", "ps5", selectedPlayer == "ps5"); + inputControllerType->add("SWITCH PRO", "switchpro", selectedPlayer == "switchpro"); inputControllerType->add("SNES", "snes", selectedPlayer == "snes"); // If there are no objects returned, then there must be a manually modified entry in the // configuration file. Simply set the controller type to "xbox" in this case. diff --git a/es-core/src/HelpStyle.cpp b/es-core/src/HelpStyle.cpp index 1d669a8d1..51b11d1c1 100644 --- a/es-core/src/HelpStyle.cpp +++ b/es-core/src/HelpStyle.cpp @@ -117,6 +117,20 @@ void HelpStyle::applyTheme(const std::shared_ptr& theme, const std::s if (elem->has(PREFIX "button_start_SNES")) mCustomButtons.button_start_SNES = elem->get(PREFIX "button_start_SNES"); + // Switch Pro. + if (elem->has(PREFIX "button_a_switch")) + mCustomButtons.button_a_switch = elem->get(PREFIX "button_a_switch"); + if (elem->has(PREFIX "button_b_switch")) + mCustomButtons.button_b_switch = elem->get(PREFIX "button_b_switch"); + if (elem->has(PREFIX "button_x_switch")) + mCustomButtons.button_x_switch = elem->get(PREFIX "button_x_switch"); + if (elem->has(PREFIX "button_y_switch")) + mCustomButtons.button_y_switch = elem->get(PREFIX "button_y_switch"); + if (elem->has(PREFIX "button_back_switch")) + mCustomButtons.button_back_switch = elem->get(PREFIX "button_back_switch"); + if (elem->has(PREFIX "button_start_switch")) + mCustomButtons.button_start_switch = elem->get(PREFIX "button_start_switch"); + // PlayStation. if (elem->has(PREFIX "button_a_PS")) mCustomButtons.button_a_PS = elem->get(PREFIX "button_a_PS"); diff --git a/es-core/src/HelpStyle.h b/es-core/src/HelpStyle.h index 360c6f815..b84c324c1 100644 --- a/es-core/src/HelpStyle.h +++ b/es-core/src/HelpStyle.h @@ -52,6 +52,14 @@ struct HelpStyle { std::string button_back_SNES; std::string button_start_SNES; + // Switch Pro + std::string button_a_switch; + std::string button_b_switch; + std::string button_x_switch; + std::string button_y_switch; + std::string button_back_switch; + std::string button_start_switch; + // PlayStation std::string button_a_PS; std::string button_b_PS; diff --git a/es-core/src/components/HelpComponent.cpp b/es-core/src/components/HelpComponent.cpp index 190647f58..79671c218 100644 --- a/es-core/src/components/HelpComponent.cpp +++ b/es-core/src/components/HelpComponent.cpp @@ -81,6 +81,26 @@ void HelpComponent::assignIcons() ":/graphics/help/button_start_SNES.svg" : mStyle.mCustomButtons.button_start_SNES; } + else if (controllerType == "switchpro") { + sIconPathMap["a"] = mStyle.mCustomButtons.button_a_switch.empty() ? + ":/graphics/help/button_a_switch.svg" : + mStyle.mCustomButtons.button_a_switch; + sIconPathMap["b"] = mStyle.mCustomButtons.button_b_switch.empty() ? + ":/graphics/help/button_b_switch.svg" : + mStyle.mCustomButtons.button_b_switch; + sIconPathMap["x"] = mStyle.mCustomButtons.button_x_switch.empty() ? + ":/graphics/help/button_x_switch.svg" : + mStyle.mCustomButtons.button_x_switch; + sIconPathMap["y"] = mStyle.mCustomButtons.button_y_switch.empty() ? + ":/graphics/help/button_y_switch.svg" : + mStyle.mCustomButtons.button_y_switch; + sIconPathMap["back"] = mStyle.mCustomButtons.button_back_switch.empty() ? + ":/graphics/help/button_back_switch.svg" : + mStyle.mCustomButtons.button_back_switch; + sIconPathMap["start"] = mStyle.mCustomButtons.button_start_switch.empty() ? + ":/graphics/help/button_start_switch.svg" : + mStyle.mCustomButtons.button_start_switch; + } else if (controllerType == "ps3") { sIconPathMap["a"] = mStyle.mCustomButtons.button_a_PS.empty() ? ":/graphics/help/button_a_PS.svg" : diff --git a/es-core/src/guis/GuiInputConfig.cpp b/es-core/src/guis/GuiInputConfig.cpp index 9c63ea013..6bb871a1d 100644 --- a/es-core/src/guis/GuiInputConfig.cpp +++ b/es-core/src/guis/GuiInputConfig.cpp @@ -205,10 +205,18 @@ void GuiInputConfig::populateConfigList() if (controllerType == "snes") { sGuiInputConfigList[4] = {"Back", false, "SELECT", ":/graphics/help/button_back_SNES.svg"}; sGuiInputConfigList[5] = {"Start", false, "START", ":/graphics/help/button_start_SNES.svg"}; - sGuiInputConfigList[6] = {"A", false, "B", ":/graphics/help/mbuttons_a_SNES.svg"}; - sGuiInputConfigList[7] = {"B", false, "A", ":/graphics/help/mbuttons_b_SNES.svg"}; - sGuiInputConfigList[8] = {"X", true, "Y", ":/graphics/help/mbuttons_x_SNES.svg"}; - sGuiInputConfigList[9] = {"Y", true, "X", ":/graphics/help/mbuttons_y_SNES.svg"}; + sGuiInputConfigList[6] = {"A", false, "B", ":/graphics/help/mbuttons_b_SNES.svg"}; + sGuiInputConfigList[7] = {"B", false, "A", ":/graphics/help/mbuttons_a_SNES.svg"}; + sGuiInputConfigList[8] = {"X", true, "Y", ":/graphics/help/mbuttons_y_SNES.svg"}; + sGuiInputConfigList[9] = {"Y", true, "X", ":/graphics/help/mbuttons_x_SNES.svg"}; + } + else if (controllerType == "switchpro") { + sGuiInputConfigList[4] = {"Back", false, "MINUS", ":/graphics/help/button_back_switch.svg"}; + sGuiInputConfigList[5] = {"Start", false, "PLUS", ":/graphics/help/button_start_switch.svg"}; + sGuiInputConfigList[7] = {"A", false, "A", ":/graphics/help/mbuttons_a_switch.svg"}; + sGuiInputConfigList[6] = {"B", false, "B", ":/graphics/help/mbuttons_b_switch.svg"}; + sGuiInputConfigList[9] = {"X", true, "X", ":/graphics/help/mbuttons_x_switch.svg"}; + sGuiInputConfigList[8] = {"Y", true, "Y", ":/graphics/help/mbuttons_y_switch.svg"}; } else if (controllerType == "ps3") { sGuiInputConfigList[4] = {"Back", false, "SELECT", ":/graphics/help/button_back_PS3.svg"}; diff --git a/resources/graphics/help/button_a_switch.svg b/resources/graphics/help/button_a_switch.svg new file mode 100644 index 000000000..c88ad1a3c --- /dev/null +++ b/resources/graphics/help/button_a_switch.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/resources/graphics/help/button_b_switch.svg b/resources/graphics/help/button_b_switch.svg new file mode 100644 index 000000000..115fd1919 --- /dev/null +++ b/resources/graphics/help/button_b_switch.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/resources/graphics/help/button_back_switch.svg b/resources/graphics/help/button_back_switch.svg new file mode 100644 index 000000000..ac0963be3 --- /dev/null +++ b/resources/graphics/help/button_back_switch.svg @@ -0,0 +1,30 @@ + + + + + + image/svg+xml + + + + + + + diff --git a/resources/graphics/help/button_start_switch.svg b/resources/graphics/help/button_start_switch.svg new file mode 100644 index 000000000..5e173bc1d --- /dev/null +++ b/resources/graphics/help/button_start_switch.svg @@ -0,0 +1,30 @@ + + + + + + image/svg+xml + + + + + + + diff --git a/resources/graphics/help/button_x_switch.svg b/resources/graphics/help/button_x_switch.svg new file mode 100644 index 000000000..c0898eb23 --- /dev/null +++ b/resources/graphics/help/button_x_switch.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/resources/graphics/help/button_y_switch.svg b/resources/graphics/help/button_y_switch.svg new file mode 100644 index 000000000..11ef2d2b8 --- /dev/null +++ b/resources/graphics/help/button_y_switch.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/resources/graphics/help/mbuttons_a_SNES.svg b/resources/graphics/help/mbuttons_a_SNES.svg index 8d3814634..a2d210e0f 100644 --- a/resources/graphics/help/mbuttons_a_SNES.svg +++ b/resources/graphics/help/mbuttons_a_SNES.svg @@ -4,5 +4,5 @@ - + diff --git a/resources/graphics/help/mbuttons_a_switch.svg b/resources/graphics/help/mbuttons_a_switch.svg new file mode 100644 index 000000000..a2d210e0f --- /dev/null +++ b/resources/graphics/help/mbuttons_a_switch.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/resources/graphics/help/mbuttons_b_SNES.svg b/resources/graphics/help/mbuttons_b_SNES.svg index a2d210e0f..8d3814634 100644 --- a/resources/graphics/help/mbuttons_b_SNES.svg +++ b/resources/graphics/help/mbuttons_b_SNES.svg @@ -4,5 +4,5 @@ - + diff --git a/resources/graphics/help/mbuttons_b_switch.svg b/resources/graphics/help/mbuttons_b_switch.svg new file mode 100644 index 000000000..8d3814634 --- /dev/null +++ b/resources/graphics/help/mbuttons_b_switch.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/resources/graphics/help/mbuttons_x_SNES.svg b/resources/graphics/help/mbuttons_x_SNES.svg index fb5970c98..bec23c811 100644 --- a/resources/graphics/help/mbuttons_x_SNES.svg +++ b/resources/graphics/help/mbuttons_x_SNES.svg @@ -4,5 +4,5 @@ - + diff --git a/resources/graphics/help/mbuttons_x_switch.svg b/resources/graphics/help/mbuttons_x_switch.svg new file mode 100644 index 000000000..bec23c811 --- /dev/null +++ b/resources/graphics/help/mbuttons_x_switch.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/resources/graphics/help/mbuttons_y_SNES.svg b/resources/graphics/help/mbuttons_y_SNES.svg index bec23c811..fb5970c98 100644 --- a/resources/graphics/help/mbuttons_y_SNES.svg +++ b/resources/graphics/help/mbuttons_y_SNES.svg @@ -4,5 +4,5 @@ - + diff --git a/resources/graphics/help/mbuttons_y_switch.svg b/resources/graphics/help/mbuttons_y_switch.svg new file mode 100644 index 000000000..fb5970c98 --- /dev/null +++ b/resources/graphics/help/mbuttons_y_switch.svg @@ -0,0 +1,8 @@ + + + + + + + +