diff --git a/modules/skin.lua b/modules/skin.lua index 2441372e..c4a703ae 100644 --- a/modules/skin.lua +++ b/modules/skin.lua @@ -56,34 +56,6 @@ pfUI:RegisterModule("skin", function () CreateBackdrop(b, nil, true, .8) end - local alpha = tonumber(C.tooltip.alpha) - - -- skin worldmap tooltips - WorldMapTooltip:SetScript("OnShow", function() - CreateBackdrop(WorldMapTooltip, nil, nil, alpha) - end) - - -- skin item tooltips - CreateBackdrop(ShoppingTooltip1, nil, nil, alpha) - CreateBackdrop(ShoppingTooltip2, nil, nil, alpha) - CreateBackdrop(ItemRefTooltip, nil, nil, alpha) - - ShoppingTooltip1:SetClampedToScreen(true) - ShoppingTooltip1:SetScript("OnShow", function() - local a, b, c, d, e = this:GetPoint() - local border = tonumber(C.appearance.border.default) - if not d or d == 0 then d = (border*2) + ( d or 0 ) + 1 end - if a then this:SetPoint(a, b, c, d, e) end - end) - - ShoppingTooltip2:SetClampedToScreen(true) - ShoppingTooltip2:SetScript("OnShow", function() - local a, b, c, d, e = this:GetPoint() - local border = tonumber(C.appearance.border.default) - if not d or d == 0 then d = (border*2) + ( d or 0 ) + 1 end - if a then this:SetPoint(a, b, c, d, e) end - end) - if C.global.errors_limit == "1" then UIErrorsFrame:SetHeight(25) end diff --git a/modules/tooltip.lua b/modules/tooltip.lua index 66b6b61a..f76bba6b 100644 --- a/modules/tooltip.lua +++ b/modules/tooltip.lua @@ -1,11 +1,4 @@ pfUI:RegisterModule("tooltip", function () - local alpha = tonumber(C.tooltip.alpha) - CreateBackdrop(GameTooltip, nil, nil, alpha) - - -- prevent tooltips from being placed offscreen - GameTooltip:SetClampedToScreen(true) - GameTooltipStatusBar:SetClampedToScreen(true) - if C.tooltip.position == "cursor" then function _G.GameTooltip_SetDefaultAnchor(tooltip, parent) tooltip:SetOwner(parent, "ANCHOR_CURSOR") diff --git a/pfUI.toc b/pfUI.toc index 53fd3aae..9c7501b6 100644 --- a/pfUI.toc +++ b/pfUI.toc @@ -82,6 +82,7 @@ skins\blizzard\options-sound.lua skins\blizzard\options-video.lua skins\blizzard\petition.lua skins\blizzard\taxi.lua +skins\blizzard\tooltips.lua # modules modules\gui.lua diff --git a/skins/blizzard/tooltips.lua b/skins/blizzard/tooltips.lua new file mode 100644 index 00000000..cfec4bdb --- /dev/null +++ b/skins/blizzard/tooltips.lua @@ -0,0 +1,19 @@ +pfUI:RegisterSkin("Tooltips", function () + local border = tonumber(C.appearance.border.default) + local alpha = tonumber(C.tooltip.alpha) + + for _, tooltip in pairs({GameTooltip, ItemRefTooltip, ShoppingTooltip1, ShoppingTooltip2, WorldMapTooltip}) do + CreateBackdrop(tooltip, nil, nil, alpha) + end + + SkinCloseButton(ItemRefCloseButton, ItemRefTooltip, -6, -6) + + for _, tooltip in pairs({ShoppingTooltip1, ShoppingTooltip2}) do + tooltip:SetClampedToScreen(true) + tooltip:SetScript("OnShow", function() + local a, b, c, x, y = this:GetPoint() + if not x or x == 0 then x = (border*2) + ( x or 0 ) + 1 end + if a then this:SetPoint(a, b, c, x, y) end + end) + end +end)