Files
dolphin/Source/Core/Core/ConfigLoaders/IsSettingSaveable.cpp
JosJuice 9b9b6d97bc Config: Simplify IsSettingSaveable's handling of Android section
The Android-specific controller mapping system is now gone,
so IsSettingSaveable can be greatly simplified.
2023-03-07 17:39:34 +01:00

47 lines
1.4 KiB
C++

// Copyright 2017 Dolphin Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include "Core/ConfigLoaders/IsSettingSaveable.h"
#include <algorithm>
#include <vector>
#include "Common/Config/Config.h"
#include "Core/Config/GraphicsSettings.h"
#include "Core/Config/MainSettings.h"
#include "Core/Config/UISettings.h"
#include "Core/Config/WiimoteSettings.h"
namespace ConfigLoaders
{
bool IsSettingSaveable(const Config::Location& config_location)
{
for (Config::System system :
{Config::System::SYSCONF, Config::System::GFX, Config::System::DualShockUDPClient,
Config::System::Logger, Config::System::FreeLook, Config::System::Main})
{
if (config_location.system == system)
return true;
}
static const auto s_setting_saveable = {
// UI.General
&Config::MAIN_USE_DISCORD_PRESENCE.GetLocation(),
// Wiimote
&Config::WIIMOTE_1_SOURCE.GetLocation(),
&Config::WIIMOTE_2_SOURCE.GetLocation(),
&Config::WIIMOTE_3_SOURCE.GetLocation(),
&Config::WIIMOTE_4_SOURCE.GetLocation(),
&Config::WIIMOTE_BB_SOURCE.GetLocation(),
};
return std::any_of(begin(s_setting_saveable), end(s_setting_saveable),
[&config_location](const Config::Location* location) {
return *location == config_location;
});
}
} // namespace ConfigLoaders