mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
feat: add GetSpellInfo, GetSpellTexture, GetItemInfo and more Lua API functions
Add spell icon path resolution via SpellIcon.dbc + Spell.dbc lazy loading, wired through GameHandler callback. Fix UnitBuff/UnitDebuff to return icon texture paths instead of nil. Add GetLocale, GetBuildInfo, GetCurrentMapAreaID.
This commit is contained in:
parent
3ff43a530f
commit
22b0cc8a3c
3 changed files with 202 additions and 1 deletions
|
|
@ -287,6 +287,13 @@ public:
|
|||
using AddonEventCallback = std::function<void(const std::string&, const std::vector<std::string>&)>;
|
||||
void setAddonEventCallback(AddonEventCallback cb) { addonEventCallback_ = std::move(cb); }
|
||||
|
||||
// Spell icon path resolver: spellId -> texture path string (e.g., "Interface\\Icons\\Spell_Fire_Fireball01")
|
||||
using SpellIconPathResolver = std::function<std::string(uint32_t)>;
|
||||
void setSpellIconPathResolver(SpellIconPathResolver r) { spellIconPathResolver_ = std::move(r); }
|
||||
std::string getSpellIconPath(uint32_t spellId) const {
|
||||
return spellIconPathResolver_ ? spellIconPathResolver_(spellId) : std::string{};
|
||||
}
|
||||
|
||||
// Emote animation callback: (entityGuid, animationId)
|
||||
using EmoteAnimCallback = std::function<void(uint64_t, uint32_t)>;
|
||||
void setEmoteAnimCallback(EmoteAnimCallback cb) { emoteAnimCallback_ = std::move(cb); }
|
||||
|
|
@ -2644,6 +2651,7 @@ private:
|
|||
ChatBubbleCallback chatBubbleCallback_;
|
||||
AddonChatCallback addonChatCallback_;
|
||||
AddonEventCallback addonEventCallback_;
|
||||
SpellIconPathResolver spellIconPathResolver_;
|
||||
EmoteAnimCallback emoteAnimCallback_;
|
||||
|
||||
// Targeting
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue