mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-23 12:30:50 +00:00
skin: add Tooltips
This commit is contained in:
@@ -56,34 +56,6 @@ pfUI:RegisterModule("skin", function ()
|
|||||||
CreateBackdrop(b, nil, true, .8)
|
CreateBackdrop(b, nil, true, .8)
|
||||||
end
|
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
|
if C.global.errors_limit == "1" then
|
||||||
UIErrorsFrame:SetHeight(25)
|
UIErrorsFrame:SetHeight(25)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,11 +1,4 @@
|
|||||||
pfUI:RegisterModule("tooltip", function ()
|
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
|
if C.tooltip.position == "cursor" then
|
||||||
function _G.GameTooltip_SetDefaultAnchor(tooltip, parent)
|
function _G.GameTooltip_SetDefaultAnchor(tooltip, parent)
|
||||||
tooltip:SetOwner(parent, "ANCHOR_CURSOR")
|
tooltip:SetOwner(parent, "ANCHOR_CURSOR")
|
||||||
|
|||||||
@@ -82,6 +82,7 @@ skins\blizzard\options-sound.lua
|
|||||||
skins\blizzard\options-video.lua
|
skins\blizzard\options-video.lua
|
||||||
skins\blizzard\petition.lua
|
skins\blizzard\petition.lua
|
||||||
skins\blizzard\taxi.lua
|
skins\blizzard\taxi.lua
|
||||||
|
skins\blizzard\tooltips.lua
|
||||||
|
|
||||||
# modules
|
# modules
|
||||||
modules\gui.lua
|
modules\gui.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)
|
||||||
Reference in New Issue
Block a user