Загрузить файлы в «/»

This commit is contained in:
Ade
2026-11-06 20:11:37 +00:00
parent c83a012c29
commit bb6b27e14d
5 changed files with 150 additions and 106 deletions
+1 -66
View File
@@ -95,71 +95,6 @@ function AA.SetClassTex(tex, class)
end
end
-- backgrounds: only these colours change with the opacity setting (never icons / text) -----
local skinned = {}
function AA.SkinFrame(fr, a, fixed)
local rec = { f = fr, base = a or 0.9 }
if pfUI and pfUI.api and pfUI.api.CreateBackdrop then
local ok = pcall(pfUI.api.CreateBackdrop, fr)
if ok and fr.backdrop and fr.backdrop.GetBackdropColor then
local r, g, b, a0 = fr.backdrop:GetBackdropColor()
rec.pf = true
rec.r, rec.g, rec.b = r or 0, g or 0, b or 0
rec.base = a0 or 0.85 -- pfUI's own alpha counts as 100 %
if not fixed then table.insert(skinned, rec) end
return
end
end
fr:SetBackdrop({
bgFile = "Interface\\Tooltips\\UI-Tooltip-Background",
edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border",
tile = true, tileSize = 16, edgeSize = 14,
insets = { left = 4, right = 4, top = 4, bottom = 4 },
})
fr:SetBackdropColor(0, 0, 0, rec.base)
if not fixed then table.insert(skinned, rec) end
end
-- chosen background colour (settings), or nil for the default
function AA.BgColor()
local c = AA.db and AA.db.bg
if c then return c[1], c[2], c[3] end
end
function AA.ApplyOpacity(o)
local cr, cg, cb = AA.BgColor()
for _, rec in ipairs(skinned) do
if rec.pf then
rec.f.backdrop:SetBackdropColor(cr or rec.r, cg or rec.g, cb or rec.b, rec.base * o)
else
rec.f:SetBackdropColor(cr or 0, cg or 0, cb or 0, rec.base * o)
end
end
end
function AA.ItemTip(b)
local ref = b.itemStr
if not ref and b.itemId then ref = b.itemId .. ":0:0:0" end
if not ref then return end
GameTooltip:SetOwner(b, "ANCHOR_RIGHT")
local ok = pcall(GameTooltip.SetHyperlink, GameTooltip, "item:" .. ref)
if not ok or GameTooltip:NumLines() == 0 then
GameTooltip:ClearLines()
GameTooltip:AddLine(b.itemId and AA.ItemName(b.itemId) or ref)
end
GameTooltip:Show()
end
function AA.ScrollWheel(sf, step)
local sb = getglobal(sf:GetName() .. "ScrollBar")
if sb then sb:SetValue(sb:GetValue() - arg1 * step * 2) end
end
function AA.ResetScroll(sf)
local sb = getglobal(sf:GetName() .. "ScrollBar")
if sb then sb:SetValue(0) end
end
-- main frame ----------------------------------------------------------
AA.M = CreateFrame("Frame", "AdeAltsManager", UIParent)
AA.M:SetWidth(AA.DEF_W)
@@ -172,7 +107,7 @@ AA.M:RegisterForDrag("LeftButton")
AA.M:SetScript("OnDragStart", function() this:StartMoving() end)
AA.M:SetScript("OnDragStop", function() this:StopMovingOrSizing() end)
AA.M:Hide()
AA.SkinFrame(AA.M, 0.95)
AA.SkinFrame(AA.M, 0.95, false, true)
table.insert(UISpecialFrames, "AdeAltsManager")
local mtitle = AA.M:CreateFontString(nil, "OVERLAY", "GameFontNormalLarge")