configure_input: Add ConfigureInputSimple as default input UI config

Greatly simplifies the current input UI, while still allowing power users to tweak advanced settings. Adds 'input profiles', which are easy autoconfigurations to make getting started easy and fast. Also has a custom option which brings up the current, full UI.
This commit is contained in:
Zach Hilman 2018-12-01 11:11:11 -05:00
parent 5169c4b326
commit 0f42bb7a96
8 changed files with 293 additions and 1 deletions

View file

@ -4,6 +4,7 @@
#include <QSettings>
#include "common/file_util.h"
#include "configure_input_simple.h"
#include "core/hle/service/acc/profile_manager.h"
#include "core/hle/service/hid/controllers/npad.h"
#include "input_common/main.h"
@ -342,6 +343,13 @@ void Config::ReadTouchscreenValues() {
qt_config->endGroup();
}
void Config::ApplyDefaultProfileIfInputInvalid() {
if (!std::any_of(Settings::values.players.begin(), Settings::values.players.end(),
[](const Settings::PlayerInput& in) { return in.connected; })) {
ApplyInputProfileConfiguration(UISettings::values.profile_index);
}
}
void Config::ReadValues() {
qt_config->beginGroup("Controls");
@ -508,6 +516,8 @@ void Config::ReadValues() {
UISettings::values.show_console = qt_config->value("showConsole", false).toBool();
UISettings::values.profile_index = qt_config->value("profileIndex", 0).toUInt();
ApplyDefaultProfileIfInputInvalid();
qt_config->endGroup();
}