CodeWidgets: Show code approval in Hardcore mode

When Hardcore mode is enabled, show an icon for each code in
ARCodeWidget and GeckoCodeWidget indicating whether it's an approved
code or not.
This commit is contained in:
Dentomologist
2025-08-24 11:12:12 -07:00
parent 2b7faeb920
commit 44f6743a5b
6 changed files with 123 additions and 41 deletions

View File

@@ -59,11 +59,11 @@ void SetActiveCodes(std::span<const GeckoCode> gcodes, const std::string& game_i
{
s_active_codes.reserve(gcodes.size());
const auto should_be_activated = [&game_id, &revision](const GeckoCode& code) {
return AchievementManager::GetInstance().ShouldGeckoCodeBeActivated(code, game_id, revision);
};
std::copy_if(gcodes.begin(), gcodes.end(), std::back_inserter(s_active_codes),
[&game_id, &revision](const GeckoCode& code) {
return code.enabled && AchievementManager::GetInstance().CheckApprovedGeckoCode(
code, game_id, revision);
});
should_be_activated);
}
s_active_codes.shrink_to_fit();