diff --git a/src/core/achievements.cpp b/src/core/achievements.cpp index abf3cb0eb..f35f294ef 100644 --- a/src/core/achievements.cpp +++ b/src/core/achievements.cpp @@ -47,16 +47,16 @@ #include "util/ini_settings_interface.h" #include "util/state_wrapper.h" -#include "IconsEmoji.h" -#include "IconsFontAwesome.h" -#include "IconsPromptFont.h" -#include "fmt/format.h" -#include "imgui.h" -#include "imgui_internal.h" -#include "rc_api_info.h" -#include "rc_api_runtime.h" -#include "rc_client.h" -#include "rc_consoles.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/src/core/achievements.h b/src/core/achievements.h index 86d17deff..47c76b20e 100644 --- a/src/core/achievements.h +++ b/src/core/achievements.h @@ -74,18 +74,9 @@ const HashDatabaseEntry* LookupGameHash(const GameHash& hash); /// Converts a game hash to a string for display. If the hash is nullopt, returns "[NO HASH]". TinyString GameHashToString(const std::optional& hash); -/// Initializes global state. -void ProcessStartup(); - -/// Initializes the RetroAchievments client. -void Initialize(); - /// Updates achievements settings. void UpdateSettings(const Settings& old_config); -/// Shuts down the RetroAchievements client. -void Shutdown(); - /// Call to refresh the all-progress database. bool RefreshAllProgressDatabase(ProgressCallback* progress, Error* error); diff --git a/src/core/achievements_private.h b/src/core/achievements_private.h index a5ebf0b99..83b1c6d2a 100644 --- a/src/core/achievements_private.h +++ b/src/core/achievements_private.h @@ -5,13 +5,16 @@ #include "achievements.h" -#include "rc_client.h" - #include #include #include #include +struct rc_client_t; +struct rc_client_achievement_t; +struct rc_client_subset_t; +struct rc_client_user_game_summary_t; + namespace Achievements { inline constexpr float INDICATOR_FADE_IN_TIME = 0.2f; @@ -51,19 +54,46 @@ struct PinnedAchievementIndicator /// Returns the rc_client instance. Should have the lock held. rc_client_t* GetClient(); +/// Initializes global state. +void ProcessStartup(); + +/// Initializes the RetroAchievments client. +void Initialize(); + +/// Shuts down the RetroAchievements client. +void Shutdown(); + +/// Returns a summary of the user's points for the current game, including total points. const rc_client_user_game_summary_t& GetGameSummary(); +/// Returns the indicators for active leaderboard trackers. Should be called with the lock held. std::vector& GetLeaderboardTrackerIndicators(); + +/// Returns the indicators for active challenges. Should be called with the lock held. std::vector& GetActiveChallengeIndicators(); + +/// Returns the indicator for the achievement that has most recently had progress. Should be called with the lock held. std::optional& GetActiveProgressIndicator(); + +/// Returns the indicators for pinned achievements. Should be called with the lock held. std::vector& GetPinnedAchievementIndicators(); +/// Returns true if the specified achievement is pinned. bool IsAchievementPinned(u32 achievement_id); + +/// Pins or unpins the specified achievement. void SetAchievementPinned(u32 achievement_id, bool pinned); +/// Returns the URL for the badge of the specified achievement, using the locked or unlocked version as appropriate. std::string_view GetAchievementBadgeURL(const rc_client_achievement_t* achievement, bool locked); + +/// Returns the URL for the badge of the specified achievement, using the locked or unlocked version as appropriate. std::string_view GetLeaderboardFormatIcon(u32 format); + +/// Returns the URL for the badge of the specified game, using the game ID. std::string GetUserBadgeURL(const char* username); + +/// Returns the URL for the badge of the specified subset, using the subset ID. std::string GetSubsetBadgeURL(const rc_client_subset_t* subset); } // namespace Achievements diff --git a/src/core/core.cpp b/src/core/core.cpp index 54710d0e5..dccecba74 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp @@ -3,6 +3,7 @@ #include "core.h" #include "achievements.h" +#include "achievements_private.h" #include "core_private.h" #include "discord_presence.h" #include "gdb_server.h" diff --git a/src/core/fullscreenui_achievements.cpp b/src/core/fullscreenui_achievements.cpp index 3a317b1ab..505302f91 100644 --- a/src/core/fullscreenui_achievements.cpp +++ b/src/core/fullscreenui_achievements.cpp @@ -20,8 +20,9 @@ #include "common/time_helpers.h" #include "common/timer.h" -#include "IconsEmoji.h" -#include "IconsPromptFont.h" +#include +#include +#include #include