mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
fix: sync player appearance after barber shop or polymorph
PLAYER_BYTES and PLAYER_BYTES_2 changes in SMSG_UPDATE_OBJECT now update the Character struct's appearanceBytes and facialFeatures, and fire an appearance-changed callback that resets the inventory screen preview so it reloads with the new hair/face values.
This commit is contained in:
parent
2e134b686d
commit
801f29f043
4 changed files with 40 additions and 2 deletions
|
|
@ -949,6 +949,10 @@ public:
|
|||
using StandStateCallback = std::function<void(uint8_t standState)>;
|
||||
void setStandStateCallback(StandStateCallback cb) { standStateCallback_ = std::move(cb); }
|
||||
|
||||
// Appearance changed callback — fired when PLAYER_BYTES or facial features update (barber shop, etc.)
|
||||
using AppearanceChangedCallback = std::function<void()>;
|
||||
void setAppearanceChangedCallback(AppearanceChangedCallback cb) { appearanceChangedCallback_ = std::move(cb); }
|
||||
|
||||
// Ghost state callback — fired when player enters or leaves ghost (spirit) form
|
||||
using GhostStateCallback = std::function<void(bool isGhost)>;
|
||||
void setGhostStateCallback(GhostStateCallback cb) { ghostStateCallback_ = std::move(cb); }
|
||||
|
|
@ -3348,6 +3352,7 @@ private:
|
|||
NpcAggroCallback npcAggroCallback_;
|
||||
NpcRespawnCallback npcRespawnCallback_;
|
||||
StandStateCallback standStateCallback_;
|
||||
AppearanceChangedCallback appearanceChangedCallback_;
|
||||
GhostStateCallback ghostStateCallback_;
|
||||
MeleeSwingCallback meleeSwingCallback_;
|
||||
uint64_t lastMeleeSwingMs_ = 0; // system_clock ms at last player auto-attack swing
|
||||
|
|
|
|||
|
|
@ -665,6 +665,7 @@ private:
|
|||
float resurrectFlashTimer_ = 0.0f;
|
||||
static constexpr float kResurrectFlashDuration = 3.0f;
|
||||
bool ghostStateCallbackSet_ = false;
|
||||
bool appearanceCallbackSet_ = false;
|
||||
bool ghostOpacityStateKnown_ = false;
|
||||
bool ghostOpacityLastState_ = false;
|
||||
uint32_t ghostOpacityLastInstanceId_ = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue