@@ -77,6 +77,7 @@ static constexpr u32 LEADERBOARD_ALL_FETCH_SIZE = 20;
7777static constexpr float LOGIN_NOTIFICATION_TIME = 5 .0f ;
7878static constexpr float ACHIEVEMENT_SUMMARY_NOTIFICATION_TIME = 5 .0f ;
7979static constexpr float ACHIEVEMENT_SUMMARY_NOTIFICATION_TIME_HC = 10 .0f ;
80+ static constexpr float ACHIEVEMENT_SUMMARY_UNSUPPORTED_TIME = 12 .0f ;
8081static constexpr float GAME_COMPLETE_NOTIFICATION_TIME = 20 .0f ;
8182static constexpr float LEADERBOARD_STARTED_NOTIFICATION_TIME = 3 .0f ;
8283static constexpr float LEADERBOARD_FAILED_NOTIFICATION_TIME = 3 .0f ;
@@ -1385,9 +1386,24 @@ void Achievements::DisplayAchievementSummary()
13851386 if (!FullscreenUI::Initialize ())
13861387 return ;
13871388
1388- ImGuiFullscreen::AddNotification (" achievement_summary " , time, std::move (title), std::move (summary),
1389+ ImGuiFullscreen::AddNotification (" AchievementsSummary " , time, std::move (title), std::move (summary),
13891390 std::move (icon));
13901391 });
1392+
1393+ if (s_state.game_summary .num_unsupported_achievements > 0 )
1394+ {
1395+ GPUThread::RunOnThread ([num_unsupported = s_state.game_summary .num_unsupported_achievements ]() mutable {
1396+ if (!FullscreenUI::Initialize ())
1397+ return ;
1398+
1399+ ImGuiFullscreen::AddNotification (" UnsupportedAchievements" , ACHIEVEMENT_SUMMARY_UNSUPPORTED_TIME,
1400+ TRANSLATE_STR (" Achievements" , " Unsupported Achievements" ),
1401+ TRANSLATE_PLURAL_STR (" Achievements" ,
1402+ " %n achievements are not supported by DuckStation." ,
1403+ " Achievement popup" , num_unsupported),
1404+ " images/warning.svg" );
1405+ });
1406+ }
13911407 }
13921408
13931409 // Technically not going through the resource API, but since we're passing this to something else, we can't.
@@ -2770,7 +2786,8 @@ void Achievements::DrawAchievementsWindow()
27702786 static constexpr float alpha = 0 .8f ;
27712787 static constexpr float heading_alpha = 0 .95f ;
27722788 const float heading_height_unscaled =
2773- (s_state.game_summary .beaten_time > 0 || s_state.game_summary .completed_time ) ? 122 .0f : 102 .0f ;
2789+ ((s_state.game_summary .beaten_time > 0 || s_state.game_summary .completed_time ) ? 122 .0f : 102 .0f ) +
2790+ ((s_state.game_summary .num_unsupported_achievements > 0 ) ? 20 .0f : 0 .0f );
27742791
27752792 const ImVec4 background = ImGuiFullscreen::ModAlpha (UIStyle.BackgroundColor , alpha);
27762793 const ImVec4 heading_background = ImGuiFullscreen::ModAlpha (UIStyle.BackgroundColor , heading_alpha);
@@ -2821,22 +2838,23 @@ void Achievements::DrawAchievementsWindow()
28212838 const ImRect summary_bb (ImVec2 (left, top), ImVec2 (right, top + UIStyle.MediumFontSize ));
28222839 if (s_state.game_summary .num_core_achievements > 0 )
28232840 {
2841+ text.assign (ICON_EMOJI_UNLOCKED " " );
28242842 if (s_state.game_summary .num_unlocked_achievements == s_state.game_summary .num_core_achievements )
28252843 {
2826- text = TRANSLATE_PLURAL_SSTR (" Achievements" , " You have unlocked all achievements and earned %n points!" ,
2827- " Point count" , s_state.game_summary .points_unlocked );
2844+ text. append ( TRANSLATE_PLURAL_SSTR (" Achievements" , " You have unlocked all achievements and earned %n points!" ,
2845+ " Point count" , s_state.game_summary .points_unlocked )) ;
28282846 }
28292847 else
28302848 {
2831- text.format (TRANSLATE_FS (" Achievements" ,
2849+ text.append_format (TRANSLATE_FS (" Achievements" ,
28322850 " You have unlocked {0} of {1} achievements, earning {2} of {3} possible points." ),
28332851 s_state.game_summary .num_unlocked_achievements , s_state.game_summary .num_core_achievements ,
28342852 s_state.game_summary .points_unlocked , s_state.game_summary .points_core );
28352853 }
28362854 }
28372855 else
28382856 {
2839- text.assign ( TRANSLATE_SV (" Achievements" , " This game has no achievements." ));
2857+ text.format (ICON_FA_BAN " {} " , TRANSLATE_SV (" Achievements" , " This game has no achievements." ));
28402858 }
28412859
28422860 top += UIStyle.MediumFontSize + spacing;
@@ -2846,9 +2864,26 @@ void Achievements::DrawAchievementsWindow()
28462864 ImGui::GetColorU32 (ImGuiFullscreen::DarkerColor (ImGui::GetStyle ().Colors [ImGuiCol_Text])),
28472865 text, nullptr , ImVec2 (0 .0f , 0 .0f ), 0 .0f , &summary_bb);
28482866
2867+ if (s_state.game_summary .num_unsupported_achievements )
2868+ {
2869+ text.format (" {} {}" , ICON_EMOJI_WARNING,
2870+ TRANSLATE_PLURAL_SSTR (
2871+ " Achievements" , " %n achievements are not supported by DuckStation and cannot be unlocked." ,
2872+ " Unsupported achievement count" , s_state.game_summary .num_unsupported_achievements ));
2873+
2874+ const ImRect unsupported_bb (ImVec2 (left, top), ImVec2 (right, top + UIStyle.MediumFontSize ));
2875+ RenderShadowedTextClipped (
2876+ UIStyle.Font , UIStyle.MediumFontSize , UIStyle.BoldFontWeight , unsupported_bb.Min , unsupported_bb.Max ,
2877+ ImGui::GetColorU32 (ImGuiFullscreen::DarkerColor (ImGui::GetStyle ().Colors [ImGuiCol_Text])), text, nullptr ,
2878+ ImVec2 (0 .0f , 0 .0f ), 0 .0f , &unsupported_bb);
2879+
2880+ top += UIStyle.MediumFontSize + spacing;
2881+ }
2882+
28492883 if (s_state.game_summary .beaten_time > 0 || s_state.game_summary .completed_time > 0 )
28502884 {
2851- text.clear ();
2885+ text.assign (ICON_EMOJI_CHECKMARK_BUTTON " " );
2886+
28522887 if (s_state.game_summary .beaten_time > 0 )
28532888 {
28542889 const std::string beaten_time =
@@ -2857,19 +2892,19 @@ void Achievements::DrawAchievementsWindow()
28572892 {
28582893 const std::string completion_time =
28592894 Host::FormatNumber (Host::NumberFormatType::ShortDate, static_cast <s64>(s_state.game_summary .beaten_time ));
2860- text.format (TRANSLATE_FS (" Achievements" , " Game was beaten on {0}, and completed on {1}." ), beaten_time,
2861- completion_time);
2895+ text.append_format (TRANSLATE_FS (" Achievements" , " Game was beaten on {0}, and completed on {1}." ), beaten_time,
2896+ completion_time);
28622897 }
28632898 else
28642899 {
2865- text.format (TRANSLATE_FS (" Achievements" , " Game was beaten on {0}." ), beaten_time);
2900+ text.append_format (TRANSLATE_FS (" Achievements" , " Game was beaten on {0}." ), beaten_time);
28662901 }
28672902 }
28682903 else
28692904 {
28702905 const std::string completion_time =
28712906 Host::FormatNumber (Host::NumberFormatType::ShortDate, static_cast <s64>(s_state.game_summary .completed_time ));
2872- text.format (TRANSLATE_FS (" Achievements" , " Game was completed on {0}." ), completion_time);
2907+ text.append_format (TRANSLATE_FS (" Achievements" , " Game was completed on {0}." ), completion_time);
28732908 }
28742909
28752910 const ImRect beaten_bb (ImVec2 (left, top), ImVec2 (right, top + UIStyle.MediumFontSize ));
0 commit comments