mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-07-31 01:41:14 -04:00
Show the actual Mining Pick model while the local character performs a mining cast instead of leaving the equipped main-hand weapon visible. Mining already used the correct gather animation, but the attachment path kept rendering the normal equipped weapon. Add a scoped mining-pick override that attaches ItemDisplayInfo 6568 to the right hand for the cast duration and restores the equipped weapons when the cast ends. Keep the temporary tool authoritative across equipment refreshes while the cast is active, and track the character instance that owns the override so interrupted casts, respawns, or logout transitions cannot leave a later character stuck with the temporary attachment. Wire the appearance composer into animation callbacks so mining start and finish events can drive the held-tool override directly. Build passes. All 33 tests pass.
53 lines
1.7 KiB
C++
53 lines
1.7 KiB
C++
#pragma once
|
|
|
|
#include <cstdint>
|
|
#include <glm/glm.hpp>
|
|
|
|
namespace wowee {
|
|
|
|
namespace rendering { class Renderer; }
|
|
namespace game { class GameHandler; }
|
|
namespace core { class AppearanceComposer; class EntitySpawner; }
|
|
|
|
namespace core {
|
|
|
|
/// Handles animation callbacks: death, respawn, swing, hit reaction, spell cast, emote,
|
|
/// stun, stealth, health, ghost, stand state, loot, sprint, vehicle, charge.
|
|
/// Owns charge rush state (interpolated in update).
|
|
class AnimationCallbackHandler {
|
|
public:
|
|
AnimationCallbackHandler(EntitySpawner& entitySpawner,
|
|
rendering::Renderer& renderer,
|
|
game::GameHandler& gameHandler,
|
|
AppearanceComposer& appearanceComposer);
|
|
|
|
void setupCallbacks();
|
|
|
|
/// Called each frame from Application::update() to drive charge interpolation.
|
|
/// Returns true if charge is active (player is externally driven).
|
|
bool updateCharge(float deltaTime);
|
|
|
|
// Charge state queries (used by Application::update for externallyDrivenMotion)
|
|
bool isCharging() const { return chargeActive_; }
|
|
|
|
// Reset charge state (logout/disconnect)
|
|
void resetChargeState();
|
|
|
|
private:
|
|
EntitySpawner& entitySpawner_;
|
|
rendering::Renderer& renderer_;
|
|
game::GameHandler& gameHandler_;
|
|
AppearanceComposer& appearanceComposer_;
|
|
|
|
// Charge rush state (moved from Application)
|
|
bool chargeActive_ = false;
|
|
float chargeTimer_ = 0.0f;
|
|
float chargeDuration_ = 0.0f;
|
|
glm::vec3 chargeStartPos_{0.0f}; // Render coordinates
|
|
glm::vec3 chargeEndPos_{0.0f}; // Render coordinates
|
|
uint64_t chargeTargetGuid_ = 0;
|
|
};
|
|
|
|
} // namespace core
|
|
} // namespace wowee
|