From ccb4c19d789b741c4cf8bd69dd5a1aaf7445591d Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Sun, 23 May 2021 20:31:15 +0200 Subject: [PATCH] Changed input type 'select' to 'back' to align with the SDL naming conventions. --- es-app/src/guis/GuiGamelistOptions.cpp | 8 ++-- es-app/src/views/SystemView.cpp | 4 +- .../src/views/gamelist/BasicGameListView.cpp | 2 +- .../src/views/gamelist/GridGameListView.cpp | 2 +- es-app/src/views/gamelist/IGameListView.cpp | 2 +- es-core/src/HelpPrompt.h | 2 +- es-core/src/InputManager.cpp | 44 +++++++++---------- es-core/src/Window.cpp | 4 +- es-core/src/components/HelpComponent.cpp | 10 ++--- es-core/src/guis/GuiInputConfig.cpp | 12 ++--- 10 files changed, 45 insertions(+), 45 deletions(-) diff --git a/es-app/src/guis/GuiGamelistOptions.cpp b/es-app/src/guis/GuiGamelistOptions.cpp index 74a641843..dd1e99e83 100644 --- a/es-app/src/guis/GuiGamelistOptions.cpp +++ b/es-app/src/guis/GuiGamelistOptions.cpp @@ -499,11 +499,11 @@ void GuiGamelistOptions::jumpToFirstRow() bool GuiGamelistOptions::input(InputConfig* config, Input input) { - if (input.value != 0 && config->isMappedTo("select", input)) + if (input.value != 0 && config->isMappedTo("back", input)) mCancelled = true; if (input.value != 0 && (config->isMappedTo("b", input) || - config->isMappedTo("select", input))) { + config->isMappedTo("back", input))) { delete this; return true; } @@ -527,11 +527,11 @@ std::vector GuiGamelistOptions::getHelpPrompts() prompts.push_back(HelpPrompt("a", "select")); if (mSystem->getRootFolder()->getChildren().size() > 0 && mSystem->getName() != "recent") { prompts.push_back(HelpPrompt("b", "close (apply)")); - prompts.push_back(HelpPrompt("select", "close (cancel)")); + prompts.push_back(HelpPrompt("back", "close (cancel)")); } else { prompts.push_back(HelpPrompt("b", "close")); - prompts.push_back(HelpPrompt("select", "close")); + prompts.push_back(HelpPrompt("back", "close")); } return prompts; } diff --git a/es-app/src/views/SystemView.cpp b/es-app/src/views/SystemView.cpp index 8f2494e13..0b9a692a3 100644 --- a/es-app/src/views/SystemView.cpp +++ b/es-app/src/views/SystemView.cpp @@ -242,7 +242,7 @@ bool SystemView::input(InputConfig* config, Input input) } if (!UIModeController::getInstance()->isUIModeKid() && - config->isMappedTo("select", input) && + config->isMappedTo("back", input) && Settings::getInstance()->getBool("ScreensaverControls")) { if (!mWindow->isScreensaverActive()) { ViewController::get()->stopScrolling(); @@ -431,7 +431,7 @@ std::vector SystemView::getHelpPrompts() if (!UIModeController::getInstance()->isUIModeKid() && Settings::getInstance()->getBool("ScreensaverControls")) - prompts.push_back(HelpPrompt("select", "toggle screensaver")); + prompts.push_back(HelpPrompt("back", "toggle screensaver")); return prompts; } diff --git a/es-app/src/views/gamelist/BasicGameListView.cpp b/es-app/src/views/gamelist/BasicGameListView.cpp index 2385d5835..6a358d219 100644 --- a/es-app/src/views/gamelist/BasicGameListView.cpp +++ b/es-app/src/views/gamelist/BasicGameListView.cpp @@ -324,7 +324,7 @@ std::vector BasicGameListView::getHelpPrompts() prompts.push_back(HelpPrompt("x", "view media")); if (!UIModeController::getInstance()->isUIModeKid()) - prompts.push_back(HelpPrompt("select", "options")); + prompts.push_back(HelpPrompt("back", "options")); if (mRoot->getSystem()->isGameSystem() && Settings::getInstance()->getBool("RandomAddButton")) prompts.push_back(HelpPrompt("thumbstickclick", "random")); diff --git a/es-app/src/views/gamelist/GridGameListView.cpp b/es-app/src/views/gamelist/GridGameListView.cpp index b50eabc2a..d1e06622c 100644 --- a/es-app/src/views/gamelist/GridGameListView.cpp +++ b/es-app/src/views/gamelist/GridGameListView.cpp @@ -717,7 +717,7 @@ std::vector GridGameListView::getHelpPrompts() prompts.push_back(HelpPrompt("x", "view media")); if (!UIModeController::getInstance()->isUIModeKid()) - prompts.push_back(HelpPrompt("select", "options")); + prompts.push_back(HelpPrompt("back", "options")); if (mRoot->getSystem()->isGameSystem() && Settings::getInstance()->getBool("RandomAddButton")) prompts.push_back(HelpPrompt("thumbstickclick", "random")); diff --git a/es-app/src/views/gamelist/IGameListView.cpp b/es-app/src/views/gamelist/IGameListView.cpp index e2d8d4a07..f41cb5e53 100644 --- a/es-app/src/views/gamelist/IGameListView.cpp +++ b/es-app/src/views/gamelist/IGameListView.cpp @@ -19,7 +19,7 @@ bool IGameListView::input(InputConfig* config, Input input) { // Select button opens GuiGamelistOptions. if (!UIModeController::getInstance()->isUIModeKid() && - config->isMappedTo("select", input) && input.value) { + config->isMappedTo("back", input) && input.value) { ViewController::get()->cancelViewTransitions(); stopListScrolling(); mWindow->pushGui(new GuiGamelistOptions(mWindow, this->mRoot->getSystem())); diff --git a/es-core/src/HelpPrompt.h b/es-core/src/HelpPrompt.h index ec7ad0626..5e312498a 100644 --- a/es-core/src/HelpPrompt.h +++ b/es-core/src/HelpPrompt.h @@ -3,7 +3,7 @@ // EmulationStation Desktop Edition // HelpPrompt.h // -// Definition of the pair used by help prompts to display a button and its mapped function. +// Definition of the pair used by help prompts to display an icon and its mapped function. // #ifndef ES_CORE_HELP_PROMPT_H diff --git a/es-core/src/InputManager.cpp b/es-core/src/InputManager.cpp index 7eacad5d0..59de6139e 100644 --- a/es-core/src/InputManager.cpp +++ b/es-core/src/InputManager.cpp @@ -534,29 +534,29 @@ void InputManager::loadDefaultKBConfig() return; cfg->clear(); - cfg->mapInput("up", Input(DEVICE_KEYBOARD, TYPE_KEY, SDLK_UP, 1, true)); - cfg->mapInput("down", Input(DEVICE_KEYBOARD, TYPE_KEY, SDLK_DOWN, 1, true)); - cfg->mapInput("left", Input(DEVICE_KEYBOARD, TYPE_KEY, SDLK_LEFT, 1, true)); - cfg->mapInput("right", Input(DEVICE_KEYBOARD, TYPE_KEY, SDLK_RIGHT, 1, true)); + cfg->mapInput("Up", Input(DEVICE_KEYBOARD, TYPE_KEY, SDLK_UP, 1, true)); + cfg->mapInput("Down", Input(DEVICE_KEYBOARD, TYPE_KEY, SDLK_DOWN, 1, true)); + cfg->mapInput("Left", Input(DEVICE_KEYBOARD, TYPE_KEY, SDLK_LEFT, 1, true)); + cfg->mapInput("Right", Input(DEVICE_KEYBOARD, TYPE_KEY, SDLK_RIGHT, 1, true)); - cfg->mapInput("a", Input(DEVICE_KEYBOARD, TYPE_KEY, SDLK_RETURN, 1, true)); - cfg->mapInput("b", Input(DEVICE_KEYBOARD, TYPE_KEY, SDLK_BACKSPACE, 1, true)); - cfg->mapInput("x", Input(DEVICE_KEYBOARD, TYPE_KEY, SDLK_DELETE, 1, true)); + cfg->mapInput("A", Input(DEVICE_KEYBOARD, TYPE_KEY, SDLK_RETURN, 1, true)); + cfg->mapInput("B", Input(DEVICE_KEYBOARD, TYPE_KEY, SDLK_BACKSPACE, 1, true)); + cfg->mapInput("X", Input(DEVICE_KEYBOARD, TYPE_KEY, SDLK_DELETE, 1, true)); #if defined(__APPLE__) - cfg->mapInput("y", Input(DEVICE_KEYBOARD, TYPE_KEY, SDLK_PRINTSCREEN, 1, true)); + cfg->mapInput("Y", Input(DEVICE_KEYBOARD, TYPE_KEY, SDLK_PRINTSCREEN, 1, true)); #else - cfg->mapInput("y", Input(DEVICE_KEYBOARD, TYPE_KEY, SDLK_INSERT, 1, true)); + cfg->mapInput("Y", Input(DEVICE_KEYBOARD, TYPE_KEY, SDLK_INSERT, 1, true)); #endif - cfg->mapInput("start", Input(DEVICE_KEYBOARD, TYPE_KEY, SDLK_ESCAPE, 1, true)); - cfg->mapInput("select", Input(DEVICE_KEYBOARD, TYPE_KEY, SDLK_F1, 1, true)); + cfg->mapInput("Start", Input(DEVICE_KEYBOARD, TYPE_KEY, SDLK_ESCAPE, 1, true)); + cfg->mapInput("Back", Input(DEVICE_KEYBOARD, TYPE_KEY, SDLK_F1, 1, true)); - cfg->mapInput("leftshoulder", Input(DEVICE_KEYBOARD, TYPE_KEY, SDLK_PAGEUP, 1, true)); - cfg->mapInput("rightshoulder", Input(DEVICE_KEYBOARD, TYPE_KEY, SDLK_PAGEDOWN, 1, true)); - cfg->mapInput("lefttrigger", Input(DEVICE_KEYBOARD, TYPE_KEY, SDLK_HOME, 1, true)); - cfg->mapInput("righttrigger", Input(DEVICE_KEYBOARD, TYPE_KEY, SDLK_END, 1, true)); + cfg->mapInput("LeftShoulder", Input(DEVICE_KEYBOARD, TYPE_KEY, SDLK_PAGEUP, 1, true)); + cfg->mapInput("RightShoulder", Input(DEVICE_KEYBOARD, TYPE_KEY, SDLK_PAGEDOWN, 1, true)); + cfg->mapInput("LeftTrigger", Input(DEVICE_KEYBOARD, TYPE_KEY, SDLK_HOME, 1, true)); + cfg->mapInput("RightTrigger", Input(DEVICE_KEYBOARD, TYPE_KEY, SDLK_END, 1, true)); - cfg->mapInput("leftthumbstickclick", Input(DEVICE_KEYBOARD, TYPE_KEY, SDLK_F2, 1, true)); - cfg->mapInput("rightthumbstickclick", Input(DEVICE_KEYBOARD, TYPE_KEY, SDLK_F3, 1, true)); + cfg->mapInput("LeftThumbstickClick", Input(DEVICE_KEYBOARD, TYPE_KEY, SDLK_F2, 1, true)); + cfg->mapInput("RightThumbstickClick", Input(DEVICE_KEYBOARD, TYPE_KEY, SDLK_F3, 1, true)); } void InputManager::loadDefaultControllerConfig(SDL_JoystickID deviceIndex) @@ -566,12 +566,12 @@ void InputManager::loadDefaultControllerConfig(SDL_JoystickID deviceIndex) if (cfg->isConfigured()) return; - cfg->mapInput("up", Input(deviceIndex, TYPE_BUTTON, SDL_CONTROLLER_BUTTON_DPAD_UP, 1, true)); - cfg->mapInput("down", Input(deviceIndex, TYPE_BUTTON, SDL_CONTROLLER_BUTTON_DPAD_DOWN, 1, true)); - cfg->mapInput("left", Input(deviceIndex, TYPE_BUTTON, SDL_CONTROLLER_BUTTON_DPAD_LEFT, 1, true)); - cfg->mapInput("right", Input(deviceIndex, TYPE_BUTTON, SDL_CONTROLLER_BUTTON_DPAD_RIGHT, 1, true)); + cfg->mapInput("Up", Input(deviceIndex, TYPE_BUTTON, SDL_CONTROLLER_BUTTON_DPAD_UP, 1, true)); + cfg->mapInput("Down", Input(deviceIndex, TYPE_BUTTON, SDL_CONTROLLER_BUTTON_DPAD_DOWN, 1, true)); + cfg->mapInput("Left", Input(deviceIndex, TYPE_BUTTON, SDL_CONTROLLER_BUTTON_DPAD_LEFT, 1, true)); + cfg->mapInput("Right", Input(deviceIndex, TYPE_BUTTON, SDL_CONTROLLER_BUTTON_DPAD_RIGHT, 1, true)); cfg->mapInput("Start", Input(deviceIndex, TYPE_BUTTON, SDL_CONTROLLER_BUTTON_START, 1, true)); - cfg->mapInput("Select", Input(deviceIndex, TYPE_BUTTON, SDL_CONTROLLER_BUTTON_BACK, 1, true)); + cfg->mapInput("Back", Input(deviceIndex, TYPE_BUTTON, SDL_CONTROLLER_BUTTON_BACK, 1, true)); cfg->mapInput("A", Input(deviceIndex, TYPE_BUTTON, SDL_CONTROLLER_BUTTON_A, 1, true)); cfg->mapInput("B", Input(deviceIndex, TYPE_BUTTON, SDL_CONTROLLER_BUTTON_B, 1, true)); cfg->mapInput("X", Input(deviceIndex, TYPE_BUTTON, SDL_CONTROLLER_BUTTON_X, 1, true)); diff --git a/es-core/src/Window.cpp b/es-core/src/Window.cpp index ceb73e3e1..1c48ed692 100644 --- a/es-core/src/Window.cpp +++ b/es-core/src/Window.cpp @@ -621,7 +621,7 @@ void Window::setHelpPrompts(const std::vector& prompts, const HelpSt } } - // Sort prompts so it goes [dpad_all] [dpad_u/d] [dpad_l/r] [a/b/x/y/l/r] [start/select]. + // Sort prompts so it goes [dpad_all] [dpad_u/d] [dpad_l/r] [a/b/x/y/l/r] [start/back]. std::sort(addPrompts.begin(), addPrompts.end(), [](const HelpPrompt& a, const HelpPrompt& b) -> bool { @@ -630,7 +630,7 @@ void Window::setHelpPrompts(const std::vector& prompts, const HelpSt "up/down", "left/right", "a", "b", "x", "y", "l", "r", - "start", "select" + "start", "back" }; int i = 0; diff --git a/es-core/src/components/HelpComponent.cpp b/es-core/src/components/HelpComponent.cpp index 5350dce40..df4381a9c 100644 --- a/es-core/src/components/HelpComponent.cpp +++ b/es-core/src/components/HelpComponent.cpp @@ -51,7 +51,7 @@ void HelpComponent::assignIcons() sIconPathMap["x"] = ":/help/button_x_SNES.svg"; sIconPathMap["y"] = ":/help/button_y_SNES.svg"; sIconPathMap["start"] = ":/help/button_start_SNES.svg"; - sIconPathMap["select"] = ":/help/button_back_SNES.svg"; + sIconPathMap["back"] = ":/help/button_back_SNES.svg"; } else if (controllerType == "ps4") { sIconPathMap["a"] = ":/help/button_a_PS.svg"; @@ -59,7 +59,7 @@ void HelpComponent::assignIcons() sIconPathMap["x"] = ":/help/button_x_PS.svg"; sIconPathMap["y"] = ":/help/button_y_PS.svg"; sIconPathMap["start"] = ":/help/button_start_PS4.svg"; - sIconPathMap["select"] = ":/help/button_back_PS4.svg"; + sIconPathMap["back"] = ":/help/button_back_PS4.svg"; } else if (controllerType == "ps5") { sIconPathMap["a"] = ":/help/button_a_PS.svg"; @@ -67,7 +67,7 @@ void HelpComponent::assignIcons() sIconPathMap["x"] = ":/help/button_x_PS.svg"; sIconPathMap["y"] = ":/help/button_y_PS.svg"; sIconPathMap["start"] = ":/help/button_start_PS5.svg"; - sIconPathMap["select"] = ":/help/button_back_PS5.svg"; + sIconPathMap["back"] = ":/help/button_back_PS5.svg"; } else if (controllerType == "xbox360") { sIconPathMap["a"] = ":/help/button_a_XBOX.svg"; @@ -75,7 +75,7 @@ void HelpComponent::assignIcons() sIconPathMap["x"] = ":/help/button_x_XBOX.svg"; sIconPathMap["y"] = ":/help/button_y_XBOX.svg"; sIconPathMap["start"] = ":/help/button_start_XBOX360.svg"; - sIconPathMap["select"] = ":/help/button_back_XBOX360.svg"; + sIconPathMap["back"] = ":/help/button_back_XBOX360.svg"; } else { // Xbox One and later. @@ -84,7 +84,7 @@ void HelpComponent::assignIcons() sIconPathMap["x"] = ":/help/button_x_XBOX.svg"; sIconPathMap["y"] = ":/help/button_y_XBOX.svg"; sIconPathMap["start"] = ":/help/button_start_XBOX.svg"; - sIconPathMap["select"] = ":/help/button_back_XBOX.svg"; + sIconPathMap["back"] = ":/help/button_back_XBOX.svg"; } } diff --git a/es-core/src/guis/GuiInputConfig.cpp b/es-core/src/guis/GuiInputConfig.cpp index b6ca90728..efab129ff 100644 --- a/es-core/src/guis/GuiInputConfig.cpp +++ b/es-core/src/guis/GuiInputConfig.cpp @@ -194,7 +194,7 @@ GuiInputConfig::GuiInputConfig( // "PLEASE ANSWER YES TO USE SELECT OR NO TO NOT SET A HOTKEY ENABLE BUTTON.", // "YES", [this, okFunction] { // Input input; -// mTargetConfig->getInputByName("Select", &input); +// mTargetConfig->getInputByName("Back", &input); // mTargetConfig->mapInput("HotKeyEnable", input); // okFunction(); // }, @@ -241,7 +241,7 @@ void GuiInputConfig::populateConfigList() sGuiInputConfigList[4] = { "Start", false, "START", ":/help/button_start_SNES.svg" }; sGuiInputConfigList[5] = - { "Select", false, "SELECT", ":/help/button_back_SNES.svg" }; + { "Back", false, "SELECT", ":/help/button_back_SNES.svg" }; sGuiInputConfigList[6] = { "A", false, "B", ":/help/mbuttons_a_SNES.svg" }; sGuiInputConfigList[7] = @@ -255,7 +255,7 @@ void GuiInputConfig::populateConfigList() sGuiInputConfigList[4] = { "Start", false, "OPTIONS", ":/help/button_start_PS4.svg" }; sGuiInputConfigList[5] = - { "Select", false, "SHARE", ":/help/button_back_PS4.svg" }; + { "Back", false, "SHARE", ":/help/button_back_PS4.svg" }; sGuiInputConfigList[6] = { "A", false, "CROSS", ":/help/mbuttons_a_PS.svg" }; sGuiInputConfigList[7] = @@ -269,7 +269,7 @@ void GuiInputConfig::populateConfigList() sGuiInputConfigList[4] = { "Start", false, "OPTIONS", ":/help/button_start_PS5.svg" }; sGuiInputConfigList[5] = - { "Select", false, "CREATE", ":/help/button_back_PS5.svg" }; + { "Back", false, "CREATE", ":/help/button_back_PS5.svg" }; sGuiInputConfigList[6] = { "A", false, "CROSS", ":/help/mbuttons_a_PS.svg" }; sGuiInputConfigList[7] = @@ -283,7 +283,7 @@ void GuiInputConfig::populateConfigList() sGuiInputConfigList[4] = { "Start", false, "START", ":/help/button_start_XBOX360.svg" }; sGuiInputConfigList[5] = - { "Select", false, "BACK", ":/help/button_back_XBOX360.svg" }; + { "Back", false, "BACK", ":/help/button_back_XBOX360.svg" }; sGuiInputConfigList[6] = { "A", false, "A", ":/help/mbuttons_a_XBOX.svg" }; sGuiInputConfigList[7] = @@ -298,7 +298,7 @@ void GuiInputConfig::populateConfigList() sGuiInputConfigList[4] = { "Start", false, "MENU", ":/help/button_start_XBOX.svg" }; sGuiInputConfigList[5] = - { "Select", false, "VIEW", ":/help/button_back_XBOX.svg" }; + { "Back", false, "VIEW", ":/help/button_back_XBOX.svg" }; sGuiInputConfigList[6] = { "A", false, "A", ":/help/mbuttons_a_XBOX.svg" }; sGuiInputConfigList[7] =