mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-26 07:45:33 +01:00
Added Hardcore flag to Achievement Settings
Hardcore Mode is a RetroAchievements feature for enabling as close to original hardware as possible, to keep a fair, challenging, and competitive playing field for achievements (which get tallied differently and emphasized more in hardcore) and leaderboards (where it is mandatory) at the cost of several common emulator features that provide advantages, such as state loading and slower emulation speeds. This commit just adds the flag to the AchievementSettings, with more to come.
This commit is contained in:
parent
c54e8d733f
commit
138e68ef9f
@ -633,6 +633,18 @@ std::recursive_mutex* AchievementManager::GetLock()
|
|||||||
return &m_lock;
|
return &m_lock;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool AchievementManager::IsHardcoreModeActive() const
|
||||||
|
{
|
||||||
|
std::lock_guard lg{m_lock};
|
||||||
|
if (!Config::Get(Config::RA_HARDCORE_ENABLED))
|
||||||
|
return false;
|
||||||
|
if (!Core::IsRunning())
|
||||||
|
return true;
|
||||||
|
if (!IsGameLoaded())
|
||||||
|
return false;
|
||||||
|
return (m_runtime.trigger_count + m_runtime.lboard_count > 0);
|
||||||
|
}
|
||||||
|
|
||||||
std::string AchievementManager::GetPlayerDisplayName() const
|
std::string AchievementManager::GetPlayerDisplayName() const
|
||||||
{
|
{
|
||||||
return IsLoggedIn() ? m_display_name : "";
|
return IsLoggedIn() ? m_display_name : "";
|
||||||
|
@ -119,6 +119,7 @@ public:
|
|||||||
void AchievementEventHandler(const rc_runtime_event_t* runtime_event);
|
void AchievementEventHandler(const rc_runtime_event_t* runtime_event);
|
||||||
|
|
||||||
std::recursive_mutex* GetLock();
|
std::recursive_mutex* GetLock();
|
||||||
|
bool IsHardcoreModeActive() const;
|
||||||
std::string GetPlayerDisplayName() const;
|
std::string GetPlayerDisplayName() const;
|
||||||
u32 GetPlayerScore() const;
|
u32 GetPlayerScore() const;
|
||||||
const BadgeStatus& GetPlayerBadge() const;
|
const BadgeStatus& GetPlayerBadge() const;
|
||||||
@ -190,7 +191,7 @@ private:
|
|||||||
|
|
||||||
Common::WorkQueueThread<std::function<void()>> m_queue;
|
Common::WorkQueueThread<std::function<void()>> m_queue;
|
||||||
Common::WorkQueueThread<std::function<void()>> m_image_queue;
|
Common::WorkQueueThread<std::function<void()>> m_image_queue;
|
||||||
std::recursive_mutex m_lock;
|
mutable std::recursive_mutex m_lock;
|
||||||
}; // class AchievementManager
|
}; // class AchievementManager
|
||||||
|
|
||||||
#endif // USE_RETRO_ACHIEVEMENTS
|
#endif // USE_RETRO_ACHIEVEMENTS
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
// Copyright 2023 Dolphin Emulator Project
|
// Copyright 2023 Dolphin Emulator Project
|
||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
|
#ifdef USE_RETRO_ACHIEVEMENTS
|
||||||
#include "Core/Config/AchievementSettings.h"
|
#include "Core/Config/AchievementSettings.h"
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
@ -19,6 +20,8 @@ const Info<bool> RA_LEADERBOARDS_ENABLED{
|
|||||||
{System::Achievements, "Achievements", "LeaderboardsEnabled"}, false};
|
{System::Achievements, "Achievements", "LeaderboardsEnabled"}, false};
|
||||||
const Info<bool> RA_RICH_PRESENCE_ENABLED{
|
const Info<bool> RA_RICH_PRESENCE_ENABLED{
|
||||||
{System::Achievements, "Achievements", "RichPresenceEnabled"}, false};
|
{System::Achievements, "Achievements", "RichPresenceEnabled"}, false};
|
||||||
|
const Info<bool> RA_HARDCORE_ENABLED{{System::Achievements, "Achievements", "HardcoreEnabled"},
|
||||||
|
false};
|
||||||
const Info<bool> RA_PROGRESS_ENABLED{{System::Achievements, "Achievements", "ProgressEnabled"},
|
const Info<bool> RA_PROGRESS_ENABLED{{System::Achievements, "Achievements", "ProgressEnabled"},
|
||||||
false};
|
false};
|
||||||
const Info<bool> RA_BADGES_ENABLED{{System::Achievements, "Achievements", "BadgesEnabled"}, false};
|
const Info<bool> RA_BADGES_ENABLED{{System::Achievements, "Achievements", "BadgesEnabled"}, false};
|
||||||
@ -26,3 +29,5 @@ const Info<bool> RA_UNOFFICIAL_ENABLED{{System::Achievements, "Achievements", "U
|
|||||||
false};
|
false};
|
||||||
const Info<bool> RA_ENCORE_ENABLED{{System::Achievements, "Achievements", "EncoreEnabled"}, false};
|
const Info<bool> RA_ENCORE_ENABLED{{System::Achievements, "Achievements", "EncoreEnabled"}, false};
|
||||||
} // namespace Config
|
} // namespace Config
|
||||||
|
|
||||||
|
#endif // USE_RETRO_ACHIEVEMENTS
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
// Copyright 2023 Dolphin Emulator Project
|
// Copyright 2023 Dolphin Emulator Project
|
||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
|
#ifdef USE_RETRO_ACHIEVEMENTS
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "Common/Config/Config.h"
|
#include "Common/Config/Config.h"
|
||||||
@ -14,8 +15,11 @@ extern const Info<std::string> RA_API_TOKEN;
|
|||||||
extern const Info<bool> RA_ACHIEVEMENTS_ENABLED;
|
extern const Info<bool> RA_ACHIEVEMENTS_ENABLED;
|
||||||
extern const Info<bool> RA_LEADERBOARDS_ENABLED;
|
extern const Info<bool> RA_LEADERBOARDS_ENABLED;
|
||||||
extern const Info<bool> RA_RICH_PRESENCE_ENABLED;
|
extern const Info<bool> RA_RICH_PRESENCE_ENABLED;
|
||||||
|
extern const Info<bool> RA_HARDCORE_ENABLED;
|
||||||
extern const Info<bool> RA_PROGRESS_ENABLED;
|
extern const Info<bool> RA_PROGRESS_ENABLED;
|
||||||
extern const Info<bool> RA_BADGES_ENABLED;
|
extern const Info<bool> RA_BADGES_ENABLED;
|
||||||
extern const Info<bool> RA_UNOFFICIAL_ENABLED;
|
extern const Info<bool> RA_UNOFFICIAL_ENABLED;
|
||||||
extern const Info<bool> RA_ENCORE_ENABLED;
|
extern const Info<bool> RA_ENCORE_ENABLED;
|
||||||
} // namespace Config
|
} // namespace Config
|
||||||
|
|
||||||
|
#endif // USE_RETRO_ACHIEVEMENTS
|
||||||
|
Loading…
x
Reference in New Issue
Block a user