Use region:IsMouseOver instead of the MouseIsOver global

This commit is contained in:
Brues
2026-10-22 21:37:50 -05:00
parent b9f473c049
commit d881d73246
5 changed files with 13 additions and 13 deletions
+6 -6
View File
@@ -1544,15 +1544,15 @@ function pfUI.api.BarButtonAnchor(button,basename,buttonindex,barsize,formfactor
end end
-- [ MouseIsOverHitRect ] -- -- [ MouseIsOverHitRect ] --
-- Like MouseIsOver, but tests the frame's hit rect, the area the engine -- Like frame:IsMouseOver(), but tests the frame's hit rect, the area the
-- uses for mouse focus and OnEnter/OnLeave. CreateBackdrop widens that -- engine uses for mouse focus and OnEnter/OnLeave. CreateBackdrop widens
-- rect by the border, so plain MouseIsOver misses a band around the frame. -- that rect by the border, so plain IsMouseOver misses a band around it.
-- 'frame' the frame to test -- 'frame' the frame to test
-- return true when the cursor is inside the frame's hit rect -- return true when the cursor is inside the frame's hit rect
function pfUI.api.MouseIsOverHitRect(frame) 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() local left, right, top, bottom = frame:GetHitRectInsets()
return MouseIsOver(frame, -top, bottom, left, -right) return frame:IsMouseOver(-top, bottom, left, -right)
end end
-- [ Enable Autohide ] -- -- [ Enable Autohide ] --
@@ -1596,7 +1596,7 @@ function pfUI.api.EnableAutohide(frame, timeout, combat)
if this.activeTo == "keep" then return end 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.activeTo = GetTime() + timeout
this.fade:Stop() this.fade:Stop()
this.parent:SetAlpha(1) this.parent:SetAlpha(1)
+1 -1
View File
@@ -170,7 +170,7 @@ do -- dropdown
end end
local function MenuOnUpdate() local function MenuOnUpdate()
if not MouseIsOver(this, 100, -100, -100, 100) then if not this:IsMouseOver(100, -100, -100, 100) then
this.button:HideMenu() this.button:HideMenu()
end end
end end
+2 -2
View File
@@ -526,10 +526,10 @@ pfUI:RegisterModule("chat", function ()
if pfUI.chat.hideLock then return end 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() pfUI.chat.left.panelTop:Show()
FCF_DockUpdate() 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 -- disable while dock is active
if pfUI.chat.right:GetAlpha() == 0 then return end if pfUI.chat.right:GetAlpha() == 0 then return end
+1 -1
View File
@@ -180,7 +180,7 @@ pfUI:RegisterModule("map", function ()
my = (( my + height / 2 ) - ( y / scale )) / height * 100 my = (( my + height / 2 ) - ( y / scale )) / height * 100
end 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) WorldMapButton.coords.text:SetFormattedText('%.1f / %.1f', mx, my)
else else
WorldMapButton.coords.text:SetText("") WorldMapButton.coords.text:SetText("")
+3 -3
View File
@@ -95,7 +95,7 @@ pfUI:RegisterModule("mapcolors", function ()
local tooltipText = "" local tooltipText = ""
if unit_button_name == 'WorldMap' then if unit_button_name == 'WorldMap' then
-- check player -- check player
if MouseIsOver(WorldMapPlayer) then if WorldMapPlayer:IsMouseOver() then
ColorizeName(WorldMapPlayer) ColorizeName(WorldMapPlayer)
tooltipText = WorldMapPlayer.name tooltipText = WorldMapPlayer.name
end end
@@ -104,7 +104,7 @@ pfUI:RegisterModule("mapcolors", function ()
-- check party -- check party
for i=1, MAX_PARTY_MEMBERS do for i=1, MAX_PARTY_MEMBERS do
local frame = _G[unit_button_name.."Party"..i] local frame = _G[unit_button_name.."Party"..i]
if frame:IsVisible() and MouseIsOver(frame) then if frame:IsVisible() and frame:IsMouseOver() then
ColorizeName(frame) ColorizeName(frame)
tooltipText = tooltipText.."\n"..frame.name tooltipText = tooltipText.."\n"..frame.name
end end
@@ -113,7 +113,7 @@ pfUI:RegisterModule("mapcolors", function ()
--check Raid --check Raid
for i=1, MAX_RAID_MEMBERS do for i=1, MAX_RAID_MEMBERS do
local frame = _G[unit_button_name.."Raid"..i] local frame = _G[unit_button_name.."Raid"..i]
if frame:IsVisible() and MouseIsOver(frame) then if frame:IsVisible() and frame:IsMouseOver() then
ColorizeName(frame) ColorizeName(frame)
tooltipText = tooltipText.."\n"..frame.name tooltipText = tooltipText.."\n"..frame.name
end end