View Single Post
10-20-16, 01:08 PM   #14
tonyis3l33t
A Cyclonian
 
tonyis3l33t's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 47
at this point there is very little difference from daftFrameFade

nonetheless... try this. Note that this doesn't have the mouse moving code in it.

Lua Code:
  1. local addonName, addonTable = ... ;
  2.  
  3. local addon = CreateFrame("Frame");
  4. addon:RegisterEvent("PLAYER_LOGIN");
  5. addon:RegisterEvent("PLAYER_REGEN_DISABLED");
  6. addon:RegisterEvent("PLAYER_REGEN_ENABLED");
  7. addon:RegisterEvent("PLAYER_STARTED_MOVING");
  8. addon:RegisterEvent("PLAYER_STOPPED_MOVING");
  9.  
  10.  
  11. addon:SetScript("OnEvent", function(self, event, ...)
  12.  
  13.     if event == "PLAYER_LOGIN"
  14.     or event == "PLAYER_REGEN_DISABLED"
  15.     or event == "PLAYER_STOPPED_MOVING" then
  16.        
  17.         if not UnitAffectingCombat("player") then
  18.             UIFrameFadeOut(UIParent, 3, UIParent:GetAlpha(), 0);
  19.         end;
  20.     else
  21.         UIFrameFadeIn(UIParent, 1, UIParent:GetAlpha(), 1);
  22.     end;
  23.    
  24.     if UnitAffectingCombat("player") then
  25.         UIFrameFadeIn(UIParent, 1, UIParent:GetAlpha(), 1);
  26.     end;
  27. end);

Last edited by tonyis3l33t : 10-20-16 at 01:35 PM.
  Reply With Quote