Wire achievement toast and ding effect callbacks

Level-up now calls triggerDing() (sound + emote + fade text) in addition to
the screen flash. Achievement earned now calls triggerAchievementToast() via
setAchievementEarnedCallback(), making the existing toast animation visible.
This commit is contained in:
Kelsi 2026-03-12 00:56:31 -07:00
parent d8f2fedae1
commit 9e5f7c481e
2 changed files with 10 additions and 0 deletions

View file

@ -371,6 +371,7 @@ private:
std::vector<ChatBubble> chatBubbles_;
bool chatBubbleCallbackSet_ = false;
bool levelUpCallbackSet_ = false;
bool achievementCallbackSet_ = false;
// Mail compose state
char mailRecipientBuffer_[256] = "";

View file

@ -214,10 +214,19 @@ void GameScreen::render(game::GameHandler& gameHandler) {
gameHandler.setLevelUpCallback([this](uint32_t newLevel) {
levelUpFlashAlpha_ = 1.0f;
levelUpDisplayLevel_ = newLevel;
triggerDing(newLevel);
});
levelUpCallbackSet_ = true;
}
// Set up achievement toast callback (once)
if (!achievementCallbackSet_) {
gameHandler.setAchievementEarnedCallback([this](uint32_t id, const std::string& name) {
triggerAchievementToast(id, name);
});
achievementCallbackSet_ = true;
}
// Apply UI transparency setting
float prevAlpha = ImGui::GetStyle().Alpha;
ImGui::GetStyle().Alpha = uiOpacity_;