Files
dolphin/Source/Core/Core/ConfigLoaders/IsSettingSaveable.cpp
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

73 lines
2.3 KiB
C++
Raw Normal View History

// Copyright 2017 Dolphin Emulator Project
// Licensed under GPLv2+
// Refer to the license.txt file included.
2017-06-08 00:53:59 -04:00
#include "Core/ConfigLoaders/IsSettingSaveable.h"
#include <algorithm>
#include <vector>
#include "Common/Config/Config.h"
#include "Core/Config/GraphicsSettings.h"
#include "Core/Config/MainSettings.h"
2018-06-08 15:56:11 -05:00
#include "Core/Config/UISettings.h"
namespace ConfigLoaders
{
bool IsSettingSaveable(const Config::Location& config_location)
{
2020-09-16 12:15:33 +02:00
for (Config::System system : {Config::System::SYSCONF, Config::System::GFX,
Config::System::DualShockUDPClient, Config::System::Logger})
{
2020-07-22 11:46:47 +02:00
if (config_location.system == system)
return true;
}
2017-08-02 16:52:26 -07:00
2020-07-22 11:46:47 +02:00
if (config_location.system == Config::System::Main)
{
for (const std::string& section : {"NetPlay", "General", "Display", "Network", "Analytics",
"AndroidOverlayButtons", "Android"})
2020-07-22 11:46:47 +02:00
{
if (config_location.section == section)
return true;
}
}
2020-11-28 15:09:37 -05:00
static constexpr std::array<const Config::Location*, 17> s_setting_saveable = {
// Main.Core
2020-09-20 13:58:17 +02:00
&Config::MAIN_DEFAULT_ISO.GetLocation(),
&Config::MAIN_MEMCARD_A_PATH.GetLocation(),
&Config::MAIN_MEMCARD_B_PATH.GetLocation(),
&Config::MAIN_AUTO_DISC_CHANGE.GetLocation(),
&Config::MAIN_ALLOW_SD_WRITES.GetLocation(),
&Config::MAIN_DPL2_DECODER.GetLocation(),
&Config::MAIN_DPL2_QUALITY.GetLocation(),
&Config::MAIN_RAM_OVERRIDE_ENABLE.GetLocation(),
&Config::MAIN_MEM1_SIZE.GetLocation(),
&Config::MAIN_MEM2_SIZE.GetLocation(),
&Config::MAIN_GFX_BACKEND.GetLocation(),
&Config::MAIN_ENABLE_SAVESTATES.GetLocation(),
&Config::MAIN_FALLBACK_REGION.GetLocation(),
2020-07-20 11:22:53 +02:00
// Main.Interface
2020-09-20 13:58:17 +02:00
&Config::MAIN_USE_PANIC_HANDLERS.GetLocation(),
&Config::MAIN_OSD_MESSAGES.GetLocation(),
// Main.Interface
2020-09-20 13:58:17 +02:00
&Config::MAIN_SKIP_NKIT_WARNING.GetLocation(),
2018-06-08 15:56:11 -05:00
// UI.General
2020-09-20 13:58:17 +02:00
&Config::MAIN_USE_DISCORD_PRESENCE.GetLocation(),
};
return std::any_of(s_setting_saveable.cbegin(), s_setting_saveable.cend(),
[&config_location](const Config::Location* location) {
return *location == config_location;
});
}
} // namespace ConfigLoaders