fix: quality border

This commit is contained in:
Vati
2026-03-02 15:10:07 +04:00
parent 82a7dbfcb4
commit 2b4a36cb5f
2 changed files with 38 additions and 28 deletions
+34 -25
View File
@@ -371,38 +371,47 @@ local function HideInnerShadow(shadow)
end end
--===================================================== --=====================================================
-- Quality/Quest Border — uses a second UI-EmptySlot -- Quality/Quest Border — rounded backdrop border overlay
-- texture (QualityRing) placed slightly larger behind -- on top of the icon texture for a clean colored frame
-- the normal EmptySlotBg. The 2px gap between them
-- creates a thin rounded border ring, since both share
-- the same rounded corner artwork.
--===================================================== --=====================================================
local QUALITY_RING_EXTEND = 11 -- QualityRing extends 11px past button local QUALITY_BORDER_SIZE = 2 -- Border thickness
local SLOT_BG_EXTEND = 9 -- EmptySlotBg extends 9px past button (2px visible border) local QUALITY_BORDER_PADDING = 1 -- Inset from button edge
-- Show quality ring with color local qualityBorderBackdrop = {
local function TintSlotBorder(button, r, g, b) edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border",
local ring = getglobal(button:GetName().."_QualityRing") edgeSize = 12,
if ring then insets = { left = 0, right = 0, top = 0, bottom = 0 },
ring:ClearAllPoints() }
ring:SetPoint("TOPLEFT", button, "TOPLEFT", -QUALITY_RING_EXTEND, QUALITY_RING_EXTEND)
ring:SetPoint("BOTTOMRIGHT", button, "BOTTOMRIGHT", QUALITY_RING_EXTEND, -QUALITY_RING_EXTEND) -- Get or create the quality border frame for a button
ring:SetTexCoord(0, 1, 0, 1) local function GetQualityBorderFrame(button)
ring:SetVertexColor(r, g, b) if button._qualityBorder then return button._qualityBorder end
ring:SetAlpha(1) local frame = CreateFrame("Frame", nil, button)
ring:Show() frame:SetFrameLevel(button:GetFrameLevel() + 3)
button._borderTinted = true local pad = QUALITY_BORDER_PADDING
end frame:SetPoint("TOPLEFT", button, "TOPLEFT", -pad, pad)
frame:SetPoint("BOTTOMRIGHT", button, "BOTTOMRIGHT", pad, -pad)
frame:SetBackdrop(qualityBorderBackdrop)
frame:Hide()
button._qualityBorder = frame
return frame
end end
-- Hide quality ring -- Show quality border with color
local function TintSlotBorder(button, r, g, b)
local frame = GetQualityBorderFrame(button)
frame:SetBackdropBorderColor(r, g, b, 1)
frame:Show()
button._borderTinted = true
end
-- Hide quality border
local function ResetSlotBorder(button) local function ResetSlotBorder(button)
if not button._borderTinted then return end if not button._borderTinted then return end
local ring = getglobal(button:GetName().."_QualityRing") if button._qualityBorder then
if ring then button._qualityBorder:Hide()
ring:Hide()
button._borderTinted = false
end end
button._borderTinted = false
end end
--===================================================== --=====================================================
+4 -3
View File
@@ -298,10 +298,11 @@ function MailboxFrame:DisplayItems(items, charFullName, totalMails)
icon:SetTexCoord(0.08, 0.92, 0.08, 0.92) icon:SetTexCoord(0.08, 0.92, 0.08, 0.92)
icon:Show() icon:Show()
end end
-- Hide quality ring for mail items -- Hide quality border for mail items
if itemButton._borderTinted then if itemButton._borderTinted then
local ring = getglobal(itemButton:GetName().."_QualityRing") if itemButton._qualityBorder then
if ring then ring:Hide() end itemButton._qualityBorder:Hide()
end
itemButton._borderTinted = false itemButton._borderTinted = false
end end
end end