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.

60 lines
1.8 KiB
C++
Raw Normal View History

// Copyright 2017 Dolphin Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
2017-06-08 00:53:59 -04:00
#include "Core/ConfigLoaders/IsSettingSaveable.h"
#include <algorithm>
#include <vector>
#include "Common/Config/Config.h"
2023-03-16 09:06:24 -04:00
#include "Core/Config/AchievementSettings.h"
#include "Core/Config/GraphicsSettings.h"
#include "Core/Config/MainSettings.h"
2018-06-08 15:56:11 -05:00
#include "Core/Config/UISettings.h"
#include "Core/Config/WiimoteSettings.h"
namespace ConfigLoaders
{
bool IsSettingSaveable(const Config::Location& config_location)
{
2020-07-22 19:19:35 -05:00
for (Config::System system :
{Config::System::SYSCONF, Config::System::GFX, Config::System::DualShockUDPClient,
Config::System::Logger, Config::System::FreeLook, Config::System::Main,
Config::System::GameSettingsOnly})
{
2020-07-22 11:46:47 +02:00
if (config_location.system == system)
return true;
}
2017-08-02 16:52:26 -07:00
static const auto s_setting_saveable = {
2018-06-08 15:56:11 -05:00
// UI.General
2020-09-20 13:58:17 +02:00
&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(),
2023-03-16 09:06:24 -04:00
// Achievements
&Config::RA_ENABLED.GetLocation(),
&Config::RA_USERNAME.GetLocation(),
&Config::RA_API_TOKEN.GetLocation(),
2023-05-26 18:29:22 -04:00
&Config::RA_ACHIEVEMENTS_ENABLED.GetLocation(),
&Config::RA_LEADERBOARDS_ENABLED.GetLocation(),
&Config::RA_RICH_PRESENCE_ENABLED.GetLocation(),
&Config::RA_UNOFFICIAL_ENABLED.GetLocation(),
&Config::RA_ENCORE_ENABLED.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