mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-17 09:33:51 +00:00
game/rendering: drive player stand-state animation from SMSG_STANDSTATE_UPDATE
Add StandStateCallback to GameHandler, fired when the server confirms a stand state change (SMSG_STANDSTATE_UPDATE). Connect in Application to map the WoW stand state (0-8) to M2 animation IDs on the player character model: - 0 = Stand → anim 0 (Stand) - 1-6 = Sit variants → anim 27 (SitGround) - 7 = Dead → anim 1 (Death) - 8 = Kneel → anim 72 (Kneel) Sit and Kneel animations are looped so the held-pose frame stays visible; Death stays on the final frame.
This commit is contained in:
parent
59c50e3beb
commit
9f3c236c48
3 changed files with 33 additions and 0 deletions
|
|
@ -619,6 +619,11 @@ public:
|
|||
using NpcRespawnCallback = std::function<void(uint64_t guid)>;
|
||||
void setNpcRespawnCallback(NpcRespawnCallback cb) { npcRespawnCallback_ = std::move(cb); }
|
||||
|
||||
// Stand state animation callback — fired when SMSG_STANDSTATE_UPDATE confirms a new state
|
||||
// standState: 0=stand, 1-6=sit variants, 7=dead, 8=kneel
|
||||
using StandStateCallback = std::function<void(uint8_t standState)>;
|
||||
void setStandStateCallback(StandStateCallback cb) { standStateCallback_ = std::move(cb); }
|
||||
|
||||
// Melee swing callback (for driving animation/SFX)
|
||||
using MeleeSwingCallback = std::function<void()>;
|
||||
void setMeleeSwingCallback(MeleeSwingCallback cb) { meleeSwingCallback_ = std::move(cb); }
|
||||
|
|
@ -2250,6 +2255,7 @@ private:
|
|||
NpcDeathCallback npcDeathCallback_;
|
||||
NpcAggroCallback npcAggroCallback_;
|
||||
NpcRespawnCallback npcRespawnCallback_;
|
||||
StandStateCallback standStateCallback_;
|
||||
MeleeSwingCallback meleeSwingCallback_;
|
||||
SpellCastAnimCallback spellCastAnimCallback_;
|
||||
NpcSwingCallback npcSwingCallback_;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue