mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
game/rendering: play SpellCast animation during SMSG_SPELL_START
Add SpellCastAnimCallback to GameHandler, triggered on SMSG_SPELL_START (start=true) and cleared on SMSG_SPELL_GO / SMSG_SPELL_FAILURE (start=false) for both the player and other units. Connect the callback in Application to play animation 3 (SpellCast) on the player character, NPCs, and other players when they begin a cast. The cast animation is one-shot (loop=false) so it auto-returns to Stand when complete via the existing return-to-idle logic. Also fire stop-cast on spell failure to cancel any stuck cast pose.
This commit is contained in:
parent
c20d7c2638
commit
59c50e3beb
3 changed files with 61 additions and 0 deletions
|
|
@ -623,6 +623,11 @@ public:
|
|||
using MeleeSwingCallback = std::function<void()>;
|
||||
void setMeleeSwingCallback(MeleeSwingCallback cb) { meleeSwingCallback_ = std::move(cb); }
|
||||
|
||||
// Spell cast animation callbacks — true=start cast/channel, false=finish/cancel
|
||||
// guid: caster (may be player or another unit), isChannel: channel vs regular cast
|
||||
using SpellCastAnimCallback = std::function<void(uint64_t guid, bool start, bool isChannel)>;
|
||||
void setSpellCastAnimCallback(SpellCastAnimCallback cb) { spellCastAnimCallback_ = std::move(cb); }
|
||||
|
||||
// NPC swing callback (plays attack animation on NPC)
|
||||
using NpcSwingCallback = std::function<void(uint64_t guid)>;
|
||||
void setNpcSwingCallback(NpcSwingCallback cb) { npcSwingCallback_ = std::move(cb); }
|
||||
|
|
@ -2246,6 +2251,7 @@ private:
|
|||
NpcAggroCallback npcAggroCallback_;
|
||||
NpcRespawnCallback npcRespawnCallback_;
|
||||
MeleeSwingCallback meleeSwingCallback_;
|
||||
SpellCastAnimCallback spellCastAnimCallback_;
|
||||
NpcSwingCallback npcSwingCallback_;
|
||||
NpcGreetingCallback npcGreetingCallback_;
|
||||
NpcFarewellCallback npcFarewellCallback_;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue