mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
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:
parent
d8f2fedae1
commit
9e5f7c481e
2 changed files with 10 additions and 0 deletions
|
|
@ -371,6 +371,7 @@ private:
|
|||
std::vector<ChatBubble> chatBubbles_;
|
||||
bool chatBubbleCallbackSet_ = false;
|
||||
bool levelUpCallbackSet_ = false;
|
||||
bool achievementCallbackSet_ = false;
|
||||
|
||||
// Mail compose state
|
||||
char mailRecipientBuffer_[256] = "";
|
||||
|
|
|
|||
|
|
@ -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_;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue