mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
Add chat tabs, networked text emotes, channel system, and chat bubbles
Chat tabs filter messages into General/Combat/Whispers/Trade tabs. Text emotes now send CMSG_TEXT_EMOTE to server and display incoming emotes from other players. Channel system auto-joins General/Trade on login with /join, /leave, and /1-/9 shortcuts. Chat bubbles render as ImGui overlays above entities for SAY/YELL messages with fade-out animation.
This commit is contained in:
parent
ca3150e43d
commit
9bcead6a0f
14 changed files with 670 additions and 23 deletions
|
|
@ -229,6 +229,15 @@ public:
|
|||
* @param target Target name (for whispers, empty otherwise)
|
||||
*/
|
||||
void sendChatMessage(ChatType type, const std::string& message, const std::string& target = "");
|
||||
void sendTextEmote(uint32_t textEmoteId, uint64_t targetGuid = 0);
|
||||
void joinChannel(const std::string& channelName, const std::string& password = "");
|
||||
void leaveChannel(const std::string& channelName);
|
||||
const std::vector<std::string>& getJoinedChannels() const { return joinedChannels_; }
|
||||
std::string getChannelByIndex(int index) const;
|
||||
|
||||
// Chat bubble callback: (senderGuid, message, isYell)
|
||||
using ChatBubbleCallback = std::function<void(uint64_t, const std::string&, bool)>;
|
||||
void setChatBubbleCallback(ChatBubbleCallback cb) { chatBubbleCallback_ = std::move(cb); }
|
||||
|
||||
/**
|
||||
* Get chat history (recent messages)
|
||||
|
|
@ -845,6 +854,9 @@ private:
|
|||
* Handle SMSG_MESSAGECHAT from server
|
||||
*/
|
||||
void handleMessageChat(network::Packet& packet);
|
||||
void handleTextEmote(network::Packet& packet);
|
||||
void handleChannelNotify(network::Packet& packet);
|
||||
void autoJoinDefaultChannels();
|
||||
|
||||
// ---- Phase 1 handlers ----
|
||||
void handleNameQueryResponse(network::Packet& packet);
|
||||
|
|
@ -1031,6 +1043,8 @@ private:
|
|||
// Chat
|
||||
std::deque<MessageChatData> chatHistory; // Recent chat messages
|
||||
size_t maxChatHistory = 100; // Maximum chat messages to keep
|
||||
std::vector<std::string> joinedChannels_; // Active channel memberships
|
||||
ChatBubbleCallback chatBubbleCallback_;
|
||||
|
||||
// Targeting
|
||||
uint64_t targetGuid = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue