From 1bf67627094c13c01600543b629dfab999c2e0a9 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Sun, 16 May 2021 16:52:13 +0200 Subject: [PATCH] Fix Android controller mappings accidentally being in IsSettingSaveable Settings.SECTION_INI_ANDROID and Settings.SECTION_BINDINGS both have the value "Android", but we only want the former to be marked as being handled by the new config system. This change fixes a problem where controller settings were not being properly saved to Dolphin.ini. --- .../Core/ConfigLoaders/IsSettingSaveable.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/Source/Core/Core/ConfigLoaders/IsSettingSaveable.cpp b/Source/Core/Core/ConfigLoaders/IsSettingSaveable.cpp index fcb5eb0f4e..e508817cd5 100644 --- a/Source/Core/Core/ConfigLoaders/IsSettingSaveable.cpp +++ b/Source/Core/Core/ConfigLoaders/IsSettingSaveable.cpp @@ -26,12 +26,25 @@ bool IsSettingSaveable(const Config::Location& config_location) if (config_location.system == Config::System::Main) { - for (const std::string& section : {"NetPlay", "General", "Display", "Network", "Analytics", - "AndroidOverlayButtons", "Android"}) + for (const std::string& section : + {"NetPlay", "General", "Display", "Network", "Analytics", "AndroidOverlayButtons"}) { if (config_location.section == section) return true; } + + // Android controller mappings are not saveable, other Android settings are. + // TODO: Kill the current Android controller mappings system + if (config_location.section == "Android") + { + static constexpr std::array android_setting_saveable = { + "ControlScale", "ControlOpacity", "EmulationOrientation", "JoystickRelCenter", + "LastPlatformTab", "MotionControls", "PhoneRumble", "ShowInputOverlay"}; + + return std::any_of( + android_setting_saveable.cbegin(), android_setting_saveable.cend(), + [&config_location](const char* key) { return key == config_location.key; }); + } } static constexpr std::array s_setting_saveable = {