From 281b64daf46ca5a27c29a14cf31f1b8b6f985d46 Mon Sep 17 00:00:00 2001 From: Zach Hilman Date: Thu, 22 Nov 2018 15:25:12 -0500 Subject: ui_settings: Add UI setting for input profile index --- src/yuzu/configuration/config.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/yuzu/configuration/config.cpp') diff --git a/src/yuzu/configuration/config.cpp b/src/yuzu/configuration/config.cpp index 83ebbd1fe..ef028cca3 100644 --- a/src/yuzu/configuration/config.cpp +++ b/src/yuzu/configuration/config.cpp @@ -506,6 +506,7 @@ 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(); qt_config->endGroup(); } @@ -695,6 +696,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(); } -- cgit v1.2.3 From 233a80419633db70f7b9e26be69fe62d6040cecf Mon Sep 17 00:00:00 2001 From: Zach Hilman Date: Sat, 1 Dec 2018 11:11:11 -0500 Subject: 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. --- src/yuzu/configuration/config.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/yuzu/configuration/config.cpp') diff --git a/src/yuzu/configuration/config.cpp b/src/yuzu/configuration/config.cpp index ef028cca3..5e0d149cd 100644 --- a/src/yuzu/configuration/config.cpp +++ b/src/yuzu/configuration/config.cpp @@ -4,6 +4,7 @@ #include #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(); } -- cgit v1.2.3