mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
feat: fire CHAT_MSG_* events to Lua addons for all chat types
Wire chat messages to the addon event system via AddonChatCallback. Every chat message now fires the corresponding WoW event: - CHAT_MSG_SAY, CHAT_MSG_YELL, CHAT_MSG_WHISPER - CHAT_MSG_PARTY, CHAT_MSG_GUILD, CHAT_MSG_OFFICER - CHAT_MSG_RAID, CHAT_MSG_RAID_WARNING, CHAT_MSG_BATTLEGROUND - CHAT_MSG_SYSTEM, CHAT_MSG_CHANNEL, CHAT_MSG_EMOTE Event handlers receive (eventName, message, senderName) arguments. Addons can now filter, react to, or log chat messages in real-time.
This commit is contained in:
parent
510f03fa32
commit
0a0ddbfd9f
3 changed files with 31 additions and 0 deletions
|
|
@ -279,6 +279,10 @@ public:
|
|||
using ChatBubbleCallback = std::function<void(uint64_t, const std::string&, bool)>;
|
||||
void setChatBubbleCallback(ChatBubbleCallback cb) { chatBubbleCallback_ = std::move(cb); }
|
||||
|
||||
// Addon chat event callback: fires when any chat message is received (for Lua event dispatch)
|
||||
using AddonChatCallback = std::function<void(const MessageChatData&)>;
|
||||
void setAddonChatCallback(AddonChatCallback cb) { addonChatCallback_ = std::move(cb); }
|
||||
|
||||
// Emote animation callback: (entityGuid, animationId)
|
||||
using EmoteAnimCallback = std::function<void(uint64_t, uint32_t)>;
|
||||
void setEmoteAnimCallback(EmoteAnimCallback cb) { emoteAnimCallback_ = std::move(cb); }
|
||||
|
|
@ -2634,6 +2638,7 @@ private:
|
|||
size_t maxChatHistory = 100; // Maximum chat messages to keep
|
||||
std::vector<std::string> joinedChannels_; // Active channel memberships
|
||||
ChatBubbleCallback chatBubbleCallback_;
|
||||
AddonChatCallback addonChatCallback_;
|
||||
EmoteAnimCallback emoteAnimCallback_;
|
||||
|
||||
// Targeting
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue