It's fantastic. Truly amazing work there, tonyis3l33t.
Originally Posted by tonyis3l33t
Note this one doesn't do the show-while-moving, the show-while-mouselooking, or the hide-after-not-moving-mouse stuff.
|
I tried implementing that by expanding the big if statement and merging it with MunkDev's code:
lua Code:
addon.timer = 0
addon:SetScript("OnUpdate", function(self, elapsed)
self.timer = self.timer + elapsed
local speed = GetUnitSpeed("player");
local x, y = GetCursorPosition();
if self.x ~= x
or self.y ~= y
or UnitAffectingCombat("Player")
or InCombatLockdown()
or speed ~=0
or UnitName("mouseover")
or ChatFrame1EditBox:IsShown()
or WorldMapFrame:IsShown()
or MailFrame:IsShown()
or GossipFrame:IsShown()
or GameTooltipTextLeft1:GetText()
or UnitCastingInfo("Player")
or UnitChannelInfo("Player")
or UnitExists("Target") then
addon:FadeIn();
elseif not IsMouselooking() then
self.timer = 0
addon:FadeOut();
end;
if self.timer > 5 then
-- check mouse looking here since the cursor position is static while
-- holding down right mouse button, also check that you're not mousing
-- over a frame since that may not be desirable either
if not IsMouselooking() and GetMouseFocus() == WorldFrame then
self.x = x
self.y = y
end
self.timer = 0
end
end)
Needs more testing though.