skin: add Tooltips

This commit is contained in:
2019-03-04 18:35:33 +03:00
committed by shagu
parent 4e90604c49
commit 6a580f198b
4 changed files with 20 additions and 35 deletions
-28
View File
@@ -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
-7
View File
@@ -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")
+1
View File
@@ -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
+19
View File
@@ -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)