Changed input type 'select' to 'back' to align with the SDL naming conventions.

This commit is contained in:
Leon Styhre 2021-05-23 20:31:15 +02:00
parent 881ee1647f
commit ccb4c19d78
10 changed files with 45 additions and 45 deletions

View file

@ -499,11 +499,11 @@ void GuiGamelistOptions::jumpToFirstRow()
bool GuiGamelistOptions::input(InputConfig* config, Input input) 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; mCancelled = true;
if (input.value != 0 && (config->isMappedTo("b", input) || if (input.value != 0 && (config->isMappedTo("b", input) ||
config->isMappedTo("select", input))) { config->isMappedTo("back", input))) {
delete this; delete this;
return true; return true;
} }
@ -527,11 +527,11 @@ std::vector<HelpPrompt> GuiGamelistOptions::getHelpPrompts()
prompts.push_back(HelpPrompt("a", "select")); prompts.push_back(HelpPrompt("a", "select"));
if (mSystem->getRootFolder()->getChildren().size() > 0 && mSystem->getName() != "recent") { if (mSystem->getRootFolder()->getChildren().size() > 0 && mSystem->getName() != "recent") {
prompts.push_back(HelpPrompt("b", "close (apply)")); prompts.push_back(HelpPrompt("b", "close (apply)"));
prompts.push_back(HelpPrompt("select", "close (cancel)")); prompts.push_back(HelpPrompt("back", "close (cancel)"));
} }
else { else {
prompts.push_back(HelpPrompt("b", "close")); prompts.push_back(HelpPrompt("b", "close"));
prompts.push_back(HelpPrompt("select", "close")); prompts.push_back(HelpPrompt("back", "close"));
} }
return prompts; return prompts;
} }

View file

@ -242,7 +242,7 @@ bool SystemView::input(InputConfig* config, Input input)
} }
if (!UIModeController::getInstance()->isUIModeKid() && if (!UIModeController::getInstance()->isUIModeKid() &&
config->isMappedTo("select", input) && config->isMappedTo("back", input) &&
Settings::getInstance()->getBool("ScreensaverControls")) { Settings::getInstance()->getBool("ScreensaverControls")) {
if (!mWindow->isScreensaverActive()) { if (!mWindow->isScreensaverActive()) {
ViewController::get()->stopScrolling(); ViewController::get()->stopScrolling();
@ -431,7 +431,7 @@ std::vector<HelpPrompt> SystemView::getHelpPrompts()
if (!UIModeController::getInstance()->isUIModeKid() && if (!UIModeController::getInstance()->isUIModeKid() &&
Settings::getInstance()->getBool("ScreensaverControls")) Settings::getInstance()->getBool("ScreensaverControls"))
prompts.push_back(HelpPrompt("select", "toggle screensaver")); prompts.push_back(HelpPrompt("back", "toggle screensaver"));
return prompts; return prompts;
} }

View file

@ -324,7 +324,7 @@ std::vector<HelpPrompt> BasicGameListView::getHelpPrompts()
prompts.push_back(HelpPrompt("x", "view media")); prompts.push_back(HelpPrompt("x", "view media"));
if (!UIModeController::getInstance()->isUIModeKid()) if (!UIModeController::getInstance()->isUIModeKid())
prompts.push_back(HelpPrompt("select", "options")); prompts.push_back(HelpPrompt("back", "options"));
if (mRoot->getSystem()->isGameSystem() && Settings::getInstance()->getBool("RandomAddButton")) if (mRoot->getSystem()->isGameSystem() && Settings::getInstance()->getBool("RandomAddButton"))
prompts.push_back(HelpPrompt("thumbstickclick", "random")); prompts.push_back(HelpPrompt("thumbstickclick", "random"));

View file

@ -717,7 +717,7 @@ std::vector<HelpPrompt> GridGameListView::getHelpPrompts()
prompts.push_back(HelpPrompt("x", "view media")); prompts.push_back(HelpPrompt("x", "view media"));
if (!UIModeController::getInstance()->isUIModeKid()) if (!UIModeController::getInstance()->isUIModeKid())
prompts.push_back(HelpPrompt("select", "options")); prompts.push_back(HelpPrompt("back", "options"));
if (mRoot->getSystem()->isGameSystem() && if (mRoot->getSystem()->isGameSystem() &&
Settings::getInstance()->getBool("RandomAddButton")) Settings::getInstance()->getBool("RandomAddButton"))
prompts.push_back(HelpPrompt("thumbstickclick", "random")); prompts.push_back(HelpPrompt("thumbstickclick", "random"));

View file

@ -19,7 +19,7 @@ bool IGameListView::input(InputConfig* config, Input input)
{ {
// Select button opens GuiGamelistOptions. // Select button opens GuiGamelistOptions.
if (!UIModeController::getInstance()->isUIModeKid() && if (!UIModeController::getInstance()->isUIModeKid() &&
config->isMappedTo("select", input) && input.value) { config->isMappedTo("back", input) && input.value) {
ViewController::get()->cancelViewTransitions(); ViewController::get()->cancelViewTransitions();
stopListScrolling(); stopListScrolling();
mWindow->pushGui(new GuiGamelistOptions(mWindow, this->mRoot->getSystem())); mWindow->pushGui(new GuiGamelistOptions(mWindow, this->mRoot->getSystem()));

View file

@ -3,7 +3,7 @@
// EmulationStation Desktop Edition // EmulationStation Desktop Edition
// HelpPrompt.h // 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 #ifndef ES_CORE_HELP_PROMPT_H

View file

@ -534,29 +534,29 @@ void InputManager::loadDefaultKBConfig()
return; return;
cfg->clear(); cfg->clear();
cfg->mapInput("up", Input(DEVICE_KEYBOARD, TYPE_KEY, SDLK_UP, 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("Down", Input(DEVICE_KEYBOARD, TYPE_KEY, SDLK_DOWN, 1, true));
cfg->mapInput("left", Input(DEVICE_KEYBOARD, TYPE_KEY, SDLK_LEFT, 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("Right", Input(DEVICE_KEYBOARD, TYPE_KEY, SDLK_RIGHT, 1, true));
cfg->mapInput("a", Input(DEVICE_KEYBOARD, TYPE_KEY, SDLK_RETURN, 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("B", Input(DEVICE_KEYBOARD, TYPE_KEY, SDLK_BACKSPACE, 1, true));
cfg->mapInput("x", Input(DEVICE_KEYBOARD, TYPE_KEY, SDLK_DELETE, 1, true)); cfg->mapInput("X", Input(DEVICE_KEYBOARD, TYPE_KEY, SDLK_DELETE, 1, true));
#if defined(__APPLE__) #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 #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 #endif
cfg->mapInput("start", Input(DEVICE_KEYBOARD, TYPE_KEY, SDLK_ESCAPE, 1, true)); 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("Back", Input(DEVICE_KEYBOARD, TYPE_KEY, SDLK_F1, 1, true));
cfg->mapInput("leftshoulder", Input(DEVICE_KEYBOARD, TYPE_KEY, SDLK_PAGEUP, 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("RightShoulder", Input(DEVICE_KEYBOARD, TYPE_KEY, SDLK_PAGEDOWN, 1, true));
cfg->mapInput("lefttrigger", Input(DEVICE_KEYBOARD, TYPE_KEY, SDLK_HOME, 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("RightTrigger", Input(DEVICE_KEYBOARD, TYPE_KEY, SDLK_END, 1, true));
cfg->mapInput("leftthumbstickclick", Input(DEVICE_KEYBOARD, TYPE_KEY, SDLK_F2, 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("RightThumbstickClick", Input(DEVICE_KEYBOARD, TYPE_KEY, SDLK_F3, 1, true));
} }
void InputManager::loadDefaultControllerConfig(SDL_JoystickID deviceIndex) void InputManager::loadDefaultControllerConfig(SDL_JoystickID deviceIndex)
@ -566,12 +566,12 @@ void InputManager::loadDefaultControllerConfig(SDL_JoystickID deviceIndex)
if (cfg->isConfigured()) if (cfg->isConfigured())
return; return;
cfg->mapInput("up", Input(deviceIndex, TYPE_BUTTON, SDL_CONTROLLER_BUTTON_DPAD_UP, 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("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("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("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("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("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("B", Input(deviceIndex, TYPE_BUTTON, SDL_CONTROLLER_BUTTON_B, 1, true));
cfg->mapInput("X", Input(deviceIndex, TYPE_BUTTON, SDL_CONTROLLER_BUTTON_X, 1, true)); cfg->mapInput("X", Input(deviceIndex, TYPE_BUTTON, SDL_CONTROLLER_BUTTON_X, 1, true));

View file

@ -621,7 +621,7 @@ void Window::setHelpPrompts(const std::vector<HelpPrompt>& 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(), std::sort(addPrompts.begin(), addPrompts.end(),
[](const HelpPrompt& a, const HelpPrompt& b) -> bool { [](const HelpPrompt& a, const HelpPrompt& b) -> bool {
@ -630,7 +630,7 @@ void Window::setHelpPrompts(const std::vector<HelpPrompt>& prompts, const HelpSt
"up/down", "up/down",
"left/right", "left/right",
"a", "b", "x", "y", "l", "r", "a", "b", "x", "y", "l", "r",
"start", "select" "start", "back"
}; };
int i = 0; int i = 0;

View file

@ -51,7 +51,7 @@ void HelpComponent::assignIcons()
sIconPathMap["x"] = ":/help/button_x_SNES.svg"; sIconPathMap["x"] = ":/help/button_x_SNES.svg";
sIconPathMap["y"] = ":/help/button_y_SNES.svg"; sIconPathMap["y"] = ":/help/button_y_SNES.svg";
sIconPathMap["start"] = ":/help/button_start_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") { else if (controllerType == "ps4") {
sIconPathMap["a"] = ":/help/button_a_PS.svg"; sIconPathMap["a"] = ":/help/button_a_PS.svg";
@ -59,7 +59,7 @@ void HelpComponent::assignIcons()
sIconPathMap["x"] = ":/help/button_x_PS.svg"; sIconPathMap["x"] = ":/help/button_x_PS.svg";
sIconPathMap["y"] = ":/help/button_y_PS.svg"; sIconPathMap["y"] = ":/help/button_y_PS.svg";
sIconPathMap["start"] = ":/help/button_start_PS4.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") { else if (controllerType == "ps5") {
sIconPathMap["a"] = ":/help/button_a_PS.svg"; sIconPathMap["a"] = ":/help/button_a_PS.svg";
@ -67,7 +67,7 @@ void HelpComponent::assignIcons()
sIconPathMap["x"] = ":/help/button_x_PS.svg"; sIconPathMap["x"] = ":/help/button_x_PS.svg";
sIconPathMap["y"] = ":/help/button_y_PS.svg"; sIconPathMap["y"] = ":/help/button_y_PS.svg";
sIconPathMap["start"] = ":/help/button_start_PS5.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") { else if (controllerType == "xbox360") {
sIconPathMap["a"] = ":/help/button_a_XBOX.svg"; sIconPathMap["a"] = ":/help/button_a_XBOX.svg";
@ -75,7 +75,7 @@ void HelpComponent::assignIcons()
sIconPathMap["x"] = ":/help/button_x_XBOX.svg"; sIconPathMap["x"] = ":/help/button_x_XBOX.svg";
sIconPathMap["y"] = ":/help/button_y_XBOX.svg"; sIconPathMap["y"] = ":/help/button_y_XBOX.svg";
sIconPathMap["start"] = ":/help/button_start_XBOX360.svg"; sIconPathMap["start"] = ":/help/button_start_XBOX360.svg";
sIconPathMap["select"] = ":/help/button_back_XBOX360.svg"; sIconPathMap["back"] = ":/help/button_back_XBOX360.svg";
} }
else { else {
// Xbox One and later. // Xbox One and later.
@ -84,7 +84,7 @@ void HelpComponent::assignIcons()
sIconPathMap["x"] = ":/help/button_x_XBOX.svg"; sIconPathMap["x"] = ":/help/button_x_XBOX.svg";
sIconPathMap["y"] = ":/help/button_y_XBOX.svg"; sIconPathMap["y"] = ":/help/button_y_XBOX.svg";
sIconPathMap["start"] = ":/help/button_start_XBOX.svg"; sIconPathMap["start"] = ":/help/button_start_XBOX.svg";
sIconPathMap["select"] = ":/help/button_back_XBOX.svg"; sIconPathMap["back"] = ":/help/button_back_XBOX.svg";
} }
} }

View file

@ -194,7 +194,7 @@ GuiInputConfig::GuiInputConfig(
// "PLEASE ANSWER YES TO USE SELECT OR NO TO NOT SET A HOTKEY ENABLE BUTTON.", // "PLEASE ANSWER YES TO USE SELECT OR NO TO NOT SET A HOTKEY ENABLE BUTTON.",
// "YES", [this, okFunction] { // "YES", [this, okFunction] {
// Input input; // Input input;
// mTargetConfig->getInputByName("Select", &input); // mTargetConfig->getInputByName("Back", &input);
// mTargetConfig->mapInput("HotKeyEnable", input); // mTargetConfig->mapInput("HotKeyEnable", input);
// okFunction(); // okFunction();
// }, // },
@ -241,7 +241,7 @@ void GuiInputConfig::populateConfigList()
sGuiInputConfigList[4] = sGuiInputConfigList[4] =
{ "Start", false, "START", ":/help/button_start_SNES.svg" }; { "Start", false, "START", ":/help/button_start_SNES.svg" };
sGuiInputConfigList[5] = sGuiInputConfigList[5] =
{ "Select", false, "SELECT", ":/help/button_back_SNES.svg" }; { "Back", false, "SELECT", ":/help/button_back_SNES.svg" };
sGuiInputConfigList[6] = sGuiInputConfigList[6] =
{ "A", false, "B", ":/help/mbuttons_a_SNES.svg" }; { "A", false, "B", ":/help/mbuttons_a_SNES.svg" };
sGuiInputConfigList[7] = sGuiInputConfigList[7] =
@ -255,7 +255,7 @@ void GuiInputConfig::populateConfigList()
sGuiInputConfigList[4] = sGuiInputConfigList[4] =
{ "Start", false, "OPTIONS", ":/help/button_start_PS4.svg" }; { "Start", false, "OPTIONS", ":/help/button_start_PS4.svg" };
sGuiInputConfigList[5] = sGuiInputConfigList[5] =
{ "Select", false, "SHARE", ":/help/button_back_PS4.svg" }; { "Back", false, "SHARE", ":/help/button_back_PS4.svg" };
sGuiInputConfigList[6] = sGuiInputConfigList[6] =
{ "A", false, "CROSS", ":/help/mbuttons_a_PS.svg" }; { "A", false, "CROSS", ":/help/mbuttons_a_PS.svg" };
sGuiInputConfigList[7] = sGuiInputConfigList[7] =
@ -269,7 +269,7 @@ void GuiInputConfig::populateConfigList()
sGuiInputConfigList[4] = sGuiInputConfigList[4] =
{ "Start", false, "OPTIONS", ":/help/button_start_PS5.svg" }; { "Start", false, "OPTIONS", ":/help/button_start_PS5.svg" };
sGuiInputConfigList[5] = sGuiInputConfigList[5] =
{ "Select", false, "CREATE", ":/help/button_back_PS5.svg" }; { "Back", false, "CREATE", ":/help/button_back_PS5.svg" };
sGuiInputConfigList[6] = sGuiInputConfigList[6] =
{ "A", false, "CROSS", ":/help/mbuttons_a_PS.svg" }; { "A", false, "CROSS", ":/help/mbuttons_a_PS.svg" };
sGuiInputConfigList[7] = sGuiInputConfigList[7] =
@ -283,7 +283,7 @@ void GuiInputConfig::populateConfigList()
sGuiInputConfigList[4] = sGuiInputConfigList[4] =
{ "Start", false, "START", ":/help/button_start_XBOX360.svg" }; { "Start", false, "START", ":/help/button_start_XBOX360.svg" };
sGuiInputConfigList[5] = sGuiInputConfigList[5] =
{ "Select", false, "BACK", ":/help/button_back_XBOX360.svg" }; { "Back", false, "BACK", ":/help/button_back_XBOX360.svg" };
sGuiInputConfigList[6] = sGuiInputConfigList[6] =
{ "A", false, "A", ":/help/mbuttons_a_XBOX.svg" }; { "A", false, "A", ":/help/mbuttons_a_XBOX.svg" };
sGuiInputConfigList[7] = sGuiInputConfigList[7] =
@ -298,7 +298,7 @@ void GuiInputConfig::populateConfigList()
sGuiInputConfigList[4] = sGuiInputConfigList[4] =
{ "Start", false, "MENU", ":/help/button_start_XBOX.svg" }; { "Start", false, "MENU", ":/help/button_start_XBOX.svg" };
sGuiInputConfigList[5] = sGuiInputConfigList[5] =
{ "Select", false, "VIEW", ":/help/button_back_XBOX.svg" }; { "Back", false, "VIEW", ":/help/button_back_XBOX.svg" };
sGuiInputConfigList[6] = sGuiInputConfigList[6] =
{ "A", false, "A", ":/help/mbuttons_a_XBOX.svg" }; { "A", false, "A", ":/help/mbuttons_a_XBOX.svg" };
sGuiInputConfigList[7] = sGuiInputConfigList[7] =