Merge pull request #1780 from DarkLordZach/controller-profiles
configure_input: Add Controller Setup Profiles and simplify input UI
This commit is contained in:
commit
22ef8eea69
12 changed files with 401 additions and 66 deletions
src/yuzu/configuration
|
@ -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"
|
||||
|
@ -339,6 +340,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");
|
||||
|
||||
|
@ -518,6 +526,9 @@ void Config::ReadValues() {
|
|||
UISettings::values.first_start = qt_config->value("firstStart", true).toBool();
|
||||
UISettings::values.callout_flags = qt_config->value("calloutFlags", 0).toUInt();
|
||||
UISettings::values.show_console = qt_config->value("showConsole", false).toBool();
|
||||
UISettings::values.profile_index = qt_config->value("profileIndex", 0).toUInt();
|
||||
|
||||
ApplyDefaultProfileIfInputInvalid();
|
||||
|
||||
qt_config->endGroup();
|
||||
}
|
||||
|
@ -720,6 +731,7 @@ void Config::SaveValues() {
|
|||
qt_config->setValue("firstStart", UISettings::values.first_start);
|
||||
qt_config->setValue("calloutFlags", UISettings::values.callout_flags);
|
||||
qt_config->setValue("showConsole", UISettings::values.show_console);
|
||||
qt_config->setValue("profileIndex", UISettings::values.profile_index);
|
||||
qt_config->endGroup();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue