mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-09-11 03:56:02 +00:00
Merge pull request #12317 from JosJuice/setting-saveable-cleanup
Config: Clean up IsSettingSaveable
This commit is contained in:
commit
99cf862596
7 changed files with 9 additions and 37 deletions
|
@ -80,7 +80,6 @@ const std::map<Config::System, int> system_to_ini = {
|
|||
{Config::System::GCKeyboard, F_GCKEYBOARDCONFIG_IDX},
|
||||
{Config::System::GFX, F_GFXCONFIG_IDX},
|
||||
{Config::System::Logger, F_LOGGERCONFIG_IDX},
|
||||
{Config::System::Debugger, F_DEBUGGERCONFIG_IDX},
|
||||
{Config::System::DualShockUDPClient, F_DUALSHOCKUDPCLIENTCONFIG_IDX},
|
||||
{Config::System::FreeLook, F_FREELOOKCONFIG_IDX},
|
||||
{Config::System::Achievements, F_RETROACHIEVEMENTSCONFIG_IDX},
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#include "Core/ConfigLoaders/IsSettingSaveable.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <vector>
|
||||
#include <array>
|
||||
|
||||
#include "Common/Config/Config.h"
|
||||
#include "Core/Config/AchievementSettings.h"
|
||||
|
@ -17,40 +17,19 @@ 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,
|
||||
Config::System::GameSettingsOnly})
|
||||
static constexpr std::array<Config::System, 3> systems_not_saveable = {
|
||||
Config::System::GCPad, Config::System::WiiPad, Config::System::GCKeyboard};
|
||||
|
||||
if (std::find(begin(systems_not_saveable), end(systems_not_saveable), config_location.system) ==
|
||||
end(systems_not_saveable))
|
||||
{
|
||||
if (config_location.system == system)
|
||||
return true;
|
||||
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_1_SOURCE.GetLocation(), &Config::WIIMOTE_2_SOURCE.GetLocation(),
|
||||
&Config::WIIMOTE_3_SOURCE.GetLocation(), &Config::WIIMOTE_4_SOURCE.GetLocation(),
|
||||
&Config::WIIMOTE_BB_SOURCE.GetLocation(),
|
||||
|
||||
// Achievements
|
||||
|
||||
&Config::RA_ENABLED.GetLocation(),
|
||||
&Config::RA_USERNAME.GetLocation(),
|
||||
&Config::RA_API_TOKEN.GetLocation(),
|
||||
&Config::RA_ACHIEVEMENTS_ENABLED.GetLocation(),
|
||||
&Config::RA_LEADERBOARDS_ENABLED.GetLocation(),
|
||||
&Config::RA_RICH_PRESENCE_ENABLED.GetLocation(),
|
||||
&Config::RA_PROGRESS_ENABLED.GetLocation(),
|
||||
&Config::RA_BADGES_ENABLED.GetLocation(),
|
||||
&Config::RA_UNOFFICIAL_ENABLED.GetLocation(),
|
||||
&Config::RA_ENCORE_ENABLED.GetLocation(),
|
||||
};
|
||||
|
||||
return std::any_of(begin(s_setting_saveable), end(s_setting_saveable),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue