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:
Kelsi 2026-03-20 13:58:54 -07:00
parent 3ff43a530f
commit 22b0cc8a3c
3 changed files with 202 additions and 1 deletions

View file

@ -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