Fixed an issue where the controller type setting was not saved when it should.

This commit is contained in:
Leon Styhre 2021-06-28 18:12:08 +02:00
parent 9fdd3bc040
commit a07e8a28fc
2 changed files with 11 additions and 4 deletions

View file

@ -19,7 +19,6 @@
#include "guis/GuiMsgBox.h"
#include "guis/GuiScraperMenu.h"
#include "guis/GuiScreensaverOptions.h"
#include "guis/GuiSettings.h"
#include "views/gamelist/IGameListView.h"
#include "views/UIModeController.h"
#include "views/ViewController.h"
@ -827,14 +826,21 @@ void GuiMenu::openInputDeviceOptions()
(mWindow, "CONFIGURE KEYBOARD AND CONTROLLERS",
Font::get(FONT_SIZE_MEDIUM), 0x777777FF), true);
configure_input_row.addElement(makeArrow(mWindow), false);
configure_input_row.makeAcceptInputHandler(std::bind(&GuiMenu::openConfigInput, this));
configure_input_row.makeAcceptInputHandler(std::bind(&GuiMenu::openConfigInput, this, s));
s->addRow(configure_input_row);
mWindow->pushGui(s);
}
void GuiMenu::openConfigInput()
void GuiMenu::openConfigInput(GuiSettings* settings)
{
// Always save the settings before starting the input configuration, in case the
// controller type was changed.
settings->save();
// Also unset the save flag so that a double saving does not take place when closing
// the input device settings menu later on.
settings->setNeedsSaving(false);
std::string message =
"THE KEYBOARD AND ANY CONNECTED CONTROLLERS\n"
"ARE AUTOMATICALLY CONFIGURED ON STARTUP, BUT\n"

View file

@ -11,6 +11,7 @@
#define ES_APP_GUIS_GUI_MENU_H
#include "components/MenuComponent.h"
#include "guis/GuiSettings.h"
#include "GuiComponent.h"
class GuiMenu : public GuiComponent
@ -36,7 +37,7 @@ private:
void openScreensaverOptions();
void openSoundOptions();
void openInputDeviceOptions();
void openConfigInput();
void openConfigInput(GuiSettings* settings);
void openCollectionSystemOptions();
void openOtherOptions();
void openUtilitiesMenu();