|
|
|
|
@ -5,13 +5,16 @@
|
|
|
|
|
|
|
|
|
|
#include "achievements.h"
|
|
|
|
|
|
|
|
|
|
#include "rc_client.h"
|
|
|
|
|
|
|
|
|
|
#include <span>
|
|
|
|
|
#include <string>
|
|
|
|
|
#include <string_view>
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
|
|
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<LeaderboardTrackerIndicator>& GetLeaderboardTrackerIndicators();
|
|
|
|
|
|
|
|
|
|
/// Returns the indicators for active challenges. Should be called with the lock held.
|
|
|
|
|
std::vector<ActiveChallengeIndicator>& GetActiveChallengeIndicators();
|
|
|
|
|
|
|
|
|
|
/// Returns the indicator for the achievement that has most recently had progress. Should be called with the lock held.
|
|
|
|
|
std::optional<AchievementProgressIndicator>& GetActiveProgressIndicator();
|
|
|
|
|
|
|
|
|
|
/// Returns the indicators for pinned achievements. Should be called with the lock held.
|
|
|
|
|
std::vector<PinnedAchievementIndicator>& 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
|
|
|
|
|
|