Add level-up ding animation with cheer emote and test button

- Trigger ding when UNIT_FIELD_LEVEL increases for player: plays LevelUp sound,
  cheer emote animation, and shows screen overlay
- renderDingEffect(): 3 expanding golden rings + "LEVEL X!" / "DING!" text
  drawn via ImDrawList foreground (3s duration, fades out last 0.8s)
- triggerDing() wires sound (UiSoundManager::playLevelUp) + emote + overlay
- LevelUpCallback in GameHandler fires on genuine level increase (newLevel > oldLevel)
- "Test: Level Up" button in escape menu triggers ding at current player level
This commit is contained in:
Kelsi 2026-02-17 17:23:42 -08:00
parent eebc0007a6
commit 897867bf7b
5 changed files with 121 additions and 0 deletions

View file

@ -706,6 +706,10 @@ public:
}
const std::unordered_map<uint64_t, QuestGiverStatus>& getNpcQuestStatuses() const { return npcQuestStatus_; }
// Level-up callback — fires when the player gains a level (newLevel > 1)
using LevelUpCallback = std::function<void(uint32_t newLevel)>;
void setLevelUpCallback(LevelUpCallback cb) { levelUpCallback_ = std::move(cb); }
// Mount state
using MountCallback = std::function<void(uint32_t mountDisplayId)>; // 0 = dismount
void setMountCallback(MountCallback cb) { mountCallback_ = std::move(cb); }
@ -1558,6 +1562,7 @@ private:
NpcGreetingCallback npcGreetingCallback_;
NpcFarewellCallback npcFarewellCallback_;
NpcVendorCallback npcVendorCallback_;
LevelUpCallback levelUpCallback_;
MountCallback mountCallback_;
TaxiPrecacheCallback taxiPrecacheCallback_;
TaxiOrientationCallback taxiOrientationCallback_;