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:
local addonName, addonTable = ... ;
local addon = CreateFrame("Frame");
addon:RegisterEvent("PLAYER_LOGIN");
addon:RegisterEvent("PLAYER_REGEN_DISABLED");
addon:RegisterEvent("PLAYER_REGEN_ENABLED");
addon:RegisterEvent("PLAYER_STARTED_MOVING");
addon:RegisterEvent("PLAYER_STOPPED_MOVING");
addon:SetScript("OnEvent", function(self, event, ...)
if event == "PLAYER_LOGIN"
or event == "PLAYER_REGEN_DISABLED"
or event == "PLAYER_STOPPED_MOVING" then
if not UnitAffectingCombat("player") then
UIFrameFadeOut(UIParent, 3, UIParent:GetAlpha(), 0);
end;
else
UIFrameFadeIn(UIParent, 1, UIParent:GetAlpha(), 1);
end;
if UnitAffectingCombat("player") then
UIFrameFadeIn(UIParent, 1, UIParent:GetAlpha(), 1);
end;
end);