Quantcast
WoWInterface - View Single Post - Chat which only shows on MouseOver
View Single Post
08-27-19, 10:47 AM   #4
Urtgard
A Fallenroot Satyr
AddOn Author - Click to view addons
Join Date: Apr 2016
Posts: 24
I use GetMouseFocus() to determine whether the mouse is still hovering above the chat.

First I check for names or links. If you hover over one of those f.messageInfo exists.

Next I check if the frame, its parent or grandparent is in my list of frames that are part of the chat (Chatframe1, ChatFrame1Tab, GeneralDockManager ... )
This list is created in the init() function.

If one of those checks is true I know I'm still hovering the chat and I don't have to call my FadeOut function.

Lua Code:
  1. local f = GetMouseFocus()
  2. if f then
  3.     if f.messageInfo then
  4.         return nil
  5.     end
  6.     if hcic:IsInArray(self.Frames, f) then
  7.         return nil
  8.     end
  9.     if f:GetParent() then
  10.         f = f:GetParent()
  11.         if hcic:IsInArray(self.Frames, f) then
  12.             return nil
  13.         end
  14.         if f:GetParent() then
  15.             f = f:GetParent()
  16.             if hcic:IsInArray(self.Frames, f) then
  17.                 return nil
  18.             end
  19.         end
  20.     end
  21. end
  Reply With Quote