diff --git a/api/api.lua b/api/api.lua index 48fc07b8..3fa9e37d 100644 --- a/api/api.lua +++ b/api/api.lua @@ -1544,15 +1544,15 @@ function pfUI.api.BarButtonAnchor(button,basename,buttonindex,barsize,formfactor end -- [ MouseIsOverHitRect ] -- --- Like MouseIsOver, but tests the frame's hit rect, the area the engine --- uses for mouse focus and OnEnter/OnLeave. CreateBackdrop widens that --- rect by the border, so plain MouseIsOver misses a band around the frame. +-- Like frame:IsMouseOver(), but tests the frame's hit rect, the area the +-- engine uses for mouse focus and OnEnter/OnLeave. CreateBackdrop widens +-- that rect by the border, so plain IsMouseOver misses a band around it. -- 'frame' the frame to test -- return true when the cursor is inside the frame's hit rect function pfUI.api.MouseIsOverHitRect(frame) - if not frame.GetHitRectInsets then return MouseIsOver(frame) end + if not frame.GetHitRectInsets then return frame:IsMouseOver() end local left, right, top, bottom = frame:GetHitRectInsets() - return MouseIsOver(frame, -top, bottom, left, -right) + return frame:IsMouseOver(-top, bottom, left, -right) end -- [ Enable Autohide ] -- @@ -1596,7 +1596,7 @@ function pfUI.api.EnableAutohide(frame, timeout, combat) if this.activeTo == "keep" then return end - if MouseIsOver(this, 10, -10, -10, 10) then + if this:IsMouseOver(10, -10, -10, 10) then this.activeTo = GetTime() + timeout this.fade:Stop() this.parent:SetAlpha(1) diff --git a/api/ui-widgets.lua b/api/ui-widgets.lua index 9f7c4f65..082deff7 100644 --- a/api/ui-widgets.lua +++ b/api/ui-widgets.lua @@ -170,7 +170,7 @@ do -- dropdown end local function MenuOnUpdate() - if not MouseIsOver(this, 100, -100, -100, 100) then + if not this:IsMouseOver(100, -100, -100, 100) then this.button:HideMenu() end end diff --git a/modules/chat.lua b/modules/chat.lua index 0781b4b2..19493cd6 100644 --- a/modules/chat.lua +++ b/modules/chat.lua @@ -526,10 +526,10 @@ pfUI:RegisterModule("chat", function () if pfUI.chat.hideLock then return end - if MouseIsOver(pfUI.chat.left, 10, -10, -10, 10) then + if pfUI.chat.left:IsMouseOver(10, -10, -10, 10) then pfUI.chat.left.panelTop:Show() FCF_DockUpdate() - elseif MouseIsOver(pfUI.chat.right, 10, -10, -10, 10) then + elseif pfUI.chat.right:IsMouseOver(10, -10, -10, 10) then -- disable while dock is active if pfUI.chat.right:GetAlpha() == 0 then return end diff --git a/modules/map.lua b/modules/map.lua index 8e1f018a..44bea54b 100644 --- a/modules/map.lua +++ b/modules/map.lua @@ -180,7 +180,7 @@ pfUI:RegisterModule("map", function () my = (( my + height / 2 ) - ( y / scale )) / height * 100 end - if mx and my and MouseIsOver(WorldMapButton) then + if mx and my and WorldMapButton:IsMouseOver() then WorldMapButton.coords.text:SetFormattedText('%.1f / %.1f', mx, my) else WorldMapButton.coords.text:SetText("") diff --git a/modules/mapcolors.lua b/modules/mapcolors.lua index 119ca2ab..6d03908f 100644 --- a/modules/mapcolors.lua +++ b/modules/mapcolors.lua @@ -95,7 +95,7 @@ pfUI:RegisterModule("mapcolors", function () local tooltipText = "" if unit_button_name == 'WorldMap' then -- check player - if MouseIsOver(WorldMapPlayer) then + if WorldMapPlayer:IsMouseOver() then ColorizeName(WorldMapPlayer) tooltipText = WorldMapPlayer.name end @@ -104,7 +104,7 @@ pfUI:RegisterModule("mapcolors", function () -- check party for i=1, MAX_PARTY_MEMBERS do local frame = _G[unit_button_name.."Party"..i] - if frame:IsVisible() and MouseIsOver(frame) then + if frame:IsVisible() and frame:IsMouseOver() then ColorizeName(frame) tooltipText = tooltipText.."\n"..frame.name end @@ -113,7 +113,7 @@ pfUI:RegisterModule("mapcolors", function () --check Raid for i=1, MAX_RAID_MEMBERS do local frame = _G[unit_button_name.."Raid"..i] - if frame:IsVisible() and MouseIsOver(frame) then + if frame:IsVisible() and frame:IsMouseOver() then ColorizeName(frame) tooltipText = tooltipText.."\n"..frame.name end