View Single Post
10-20-16, 02:55 PM   #15
tonyis3l33t
A Cyclonian
 
tonyis3l33t's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 47
Add this portion for mouse being on a frame or on a unit

Lua Code:
  1. addon:SetScript("OnUpdate", function(self, elapsed)
  2.  
  3.     local speed = GetUnitSpeed("player");
  4.     if speed ~=0 then
  5.         UIFrameFadeIn(UIParent, 1, UIParent:GetAlpha(), 1);
  6.     else
  7.         if GetMouseFocus() then
  8.             if GetMouseFocus():GetName() ~= "WorldFrame" then
  9.                 UIFrameFadeIn(UIParent, 1, UIParent:GetAlpha(), 1);
  10.             else
  11.                 if not UnitAffectingCombat("player") then
  12.                     UIFrameFadeOut(UIParent, 3, UIParent:GetAlpha(), 0.1);
  13.                 end;
  14.             end;
  15.         end;
  16.     end;
  17.    
  18.     if UnitName("mouseover") then
  19.         UIFrameFadeIn(UIParent, 1, UIParent:GetAlpha(), 1);
  20.     end;
  21. end);
  Reply With Quote