mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-01-18 23:15:38 +00:00
code-words for options
This commit is contained in:
parent
8f1b6296cd
commit
ba2ef814de
|
@ -1187,20 +1187,16 @@ void GuiMenu::openOtherOptions()
|
||||||
// Exit button configuration.
|
// Exit button configuration.
|
||||||
auto exit_button_config = std::make_shared<OptionListComponent<std::string>>
|
auto exit_button_config = std::make_shared<OptionListComponent<std::string>>
|
||||||
(mWindow, getHelpStyle(), "EXIT BUTTON COMBO", false);
|
(mWindow, getHelpStyle(), "EXIT BUTTON COMBO", false);
|
||||||
std::vector<std::string> exitButtonCombos;
|
std::string selectedExitButtonCombo = Settings::getInstance()->getString("ExitButtonCombo");
|
||||||
exitButtonCombos.push_back("F4");
|
exit_button_config->add("F4", "F4", selectedExitButtonCombo == "F4");
|
||||||
exitButtonCombos.push_back("Alt + F4");
|
exit_button_config->add("Alt + F4", "AltF4", selectedExitButtonCombo == "AltF4");
|
||||||
#if defined(_WIN64) || defined(__unix__)
|
#if defined(_WIN64) || defined(__unix__)
|
||||||
exitButtonCombos.push_back("Alt + Q");
|
exit_button_config->add("Alt + Q", "AltQ", selectedExitButtonCombo == "AltQ");
|
||||||
#endif
|
#endif
|
||||||
#if defined(__APPLE__)
|
#if defined(__APPLE__)
|
||||||
exitButtonCombos.push_back("\u2318 + Q");
|
exit_button_config->add("\u2318 + Q", "CmdQ", selectedExitButtonCombo == "CmdQ");
|
||||||
#endif
|
#endif
|
||||||
for (auto it = exitButtonCombos.cbegin(); it != exitButtonCombos.cend(); it++) {
|
s->addWithLabel("EXIT BUTTON COMBO", exit_button_config);
|
||||||
exit_button_config->add(*it, *it, Settings::getInstance()->
|
|
||||||
getString("ExitButtonCombo") == *it);
|
|
||||||
}
|
|
||||||
s->addWithLabel("CHOOSE EXIT BUTTON COMBO", exit_button_config);
|
|
||||||
s->addSaveFunc([exit_button_config, s] {
|
s->addSaveFunc([exit_button_config, s] {
|
||||||
if (exit_button_config->getSelected() !=
|
if (exit_button_config->getSelected() !=
|
||||||
Settings::getInstance()->getString("ExitButtonCombo")) {
|
Settings::getInstance()->getString("ExitButtonCombo")) {
|
||||||
|
|
|
@ -455,11 +455,11 @@ bool InputManager::parseEvent(const SDL_Event& event, Window* window)
|
||||||
// handle application exit
|
// handle application exit
|
||||||
bool exitState;
|
bool exitState;
|
||||||
std::string exitOption = Settings::getInstance()->getString("ExitButtonCombo");
|
std::string exitOption = Settings::getInstance()->getString("ExitButtonCombo");
|
||||||
if (exitOption == "Alt + F4"){
|
if (exitOption == "AltF4"){
|
||||||
exitState = event.key.keysym.sym == SDLK_F4 && altDown;
|
exitState = event.key.keysym.sym == SDLK_F4 && altDown;
|
||||||
}else if (exitOption == "\u2318 + Q"){
|
}else if (exitOption == "CmdQ"){
|
||||||
exitState = event.key.keysym.sym == SDLK_q && lguiDown;
|
exitState = event.key.keysym.sym == SDLK_q && lguiDown;
|
||||||
}else if (exitOption == "Alt + Q"){
|
}else if (exitOption == "AltQ"){
|
||||||
exitState = event.key.keysym.sym == SDLK_q && altDown;
|
exitState = event.key.keysym.sym == SDLK_q && altDown;
|
||||||
}else{
|
}else{
|
||||||
exitState = event.key.keysym.sym == SDLK_F4;
|
exitState = event.key.keysym.sym == SDLK_F4;
|
||||||
|
|
Loading…
Reference in a new issue