mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2026-09-08 13:42:53 +02:00
FetchBadges fetches all available badges (player, game, achievements) and stores them in AchievementManager's memory. New fields and accessors have been added as necessary. Badges for individual achievements are stored in the UnlockStatus map. The method is public so that the settings dialog can call it if badges are turned on after a game is started. Badges are deleted at game close and logout.
61 lines
1.9 KiB
C++
61 lines
1.9 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/AchievementSettings.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,
|
|
Config::System::GameSettingsOnly})
|
|
{
|
|
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(),
|
|
|
|
// 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_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),
|
|
[&config_location](const Config::Location* location) {
|
|
return *location == config_location;
|
|
});
|
|
}
|
|
} // namespace ConfigLoaders
|