mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
Use a stub AchivementManager when USE_RETRO_ACHIEVEMENTS isn't defined
This lets us reduce the number of USE_RETRO_ACHIEVEMENTS ifdefs in the code base, reducing visual clutter. In particular, needing an ifdef for each call to IsHardcodeModeActive was annoying to me. This also reduces the risk that someone writes code that accidentally fails to compile with USE_RETRO_ACHIEVEMENTS disabled. We could cut down on ifdefs even further by making HardcodeWarningWidget always exist, but that would result in non-trivial code ending up in the binary even with USE_RETRO_ACHIEVEMENTS disabled, so I'm leaving it out of this PR. It's not a lot of code though, so I might end up revisiting it at some point.
This commit is contained in:
@ -331,9 +331,9 @@ void OnScreenUI::DrawDebugText()
|
||||
ImGui::TextUnformatted(profile_output.c_str());
|
||||
}
|
||||
|
||||
#ifdef USE_RETRO_ACHIEVEMENTS
|
||||
void OnScreenUI::DrawChallengesAndLeaderboards()
|
||||
{
|
||||
#ifdef USE_RETRO_ACHIEVEMENTS
|
||||
std::lock_guard lg{AchievementManager::GetInstance().GetLock()};
|
||||
const auto& challenge_icons = AchievementManager::GetInstance().GetChallengeIcons();
|
||||
const auto& leaderboard_progress = AchievementManager::GetInstance().GetActiveLeaderboards();
|
||||
@ -396,8 +396,8 @@ void OnScreenUI::DrawChallengesAndLeaderboards()
|
||||
}
|
||||
ImGui::End();
|
||||
}
|
||||
}
|
||||
#endif // USE_RETRO_ACHIEVEMENTS
|
||||
}
|
||||
|
||||
void OnScreenUI::Finalize()
|
||||
{
|
||||
@ -406,9 +406,7 @@ void OnScreenUI::Finalize()
|
||||
g_perf_metrics.DrawImGuiStats(m_backbuffer_scale);
|
||||
DrawDebugText();
|
||||
OSD::DrawMessages();
|
||||
#ifdef USE_RETRO_ACHIEVEMENTS
|
||||
DrawChallengesAndLeaderboards();
|
||||
#endif // USE_RETRO_ACHIEVEMENTS
|
||||
ImGui::Render();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user