Added Notification Popup for Leaderboard Canceled
Added HandleLeaderboardStartedEvent with an OnScreenDisplay message when a player has triggered a leaderboard's failure conditions. The message includes the title of the achievement.
This commit is contained in:
parent
a4b7f43f21
commit
b0eb4ccb80
|
@ -535,6 +535,19 @@ void AchievementManager::HandleLeaderboardStartedEvent(const rc_runtime_event_t*
|
|||
}
|
||||
}
|
||||
|
||||
void AchievementManager::HandleLeaderboardCanceledEvent(const rc_runtime_event_t* runtime_event)
|
||||
{
|
||||
for (u32 ix = 0; ix < m_game_data.num_leaderboards; ix++)
|
||||
{
|
||||
if (m_game_data.leaderboards[ix].id == runtime_event->id)
|
||||
{
|
||||
OSD::AddMessage(fmt::format("Failed leaderboard: {}", m_game_data.leaderboards[ix].title),
|
||||
OSD::Duration::VERY_LONG, OSD::Color::RED);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void AchievementManager::HandleLeaderboardTriggeredEvent(const rc_runtime_event_t* runtime_event)
|
||||
{
|
||||
m_queue.EmplaceItem(
|
||||
|
|
|
@ -81,6 +81,7 @@ private:
|
|||
|
||||
void HandleAchievementTriggeredEvent(const rc_runtime_event_t* runtime_event);
|
||||
void HandleLeaderboardStartedEvent(const rc_runtime_event_t* runtime_event);
|
||||
void HandleLeaderboardCanceledEvent(const rc_runtime_event_t* runtime_event);
|
||||
void HandleLeaderboardTriggeredEvent(const rc_runtime_event_t* runtime_event);
|
||||
|
||||
template <typename RcRequest, typename RcResponse>
|
||||
|
|
Loading…
Reference in New Issue