diff --git a/Assets/AH-Background-Tile.tga b/Assets/AH-Background-Tile.tga new file mode 100644 index 0000000..cb113ef Binary files /dev/null and b/Assets/AH-Background-Tile.tga differ diff --git a/Assets/AuctionHouseBackgrounds.blp b/Assets/AuctionHouseBackgrounds.blp new file mode 100644 index 0000000..dcc3ab6 Binary files /dev/null and b/Assets/AuctionHouseBackgrounds.blp differ diff --git a/Assets/UI-Background-Rock.tga b/Assets/UI-Background-Rock.tga new file mode 100644 index 0000000..b6fbd49 Binary files /dev/null and b/Assets/UI-Background-Rock.tga differ diff --git a/Core/Theme.lua b/Core/Theme.lua index 2ee8027..2fb2b65 100644 --- a/Core/Theme.lua +++ b/Core/Theme.lua @@ -49,9 +49,10 @@ local themes = { }, blizzard = { bgTexture = "Interface\\ChatFrame\\ChatFrameBackground", - bgColor = { r = 0.08, g = 0.08, b = 0.08 }, + bgColor = { r = 0, g = 0, b = 0 }, bgTile = true, bgTileSize = 16, + bgOverlay = "Interface\\AddOns\\Guda\\Assets\\UI-Background-Rock", border = { edgeFile = "Interface\\DialogFrame\\UI-DialogBox-Border", edgeSize = 32, @@ -62,6 +63,13 @@ local themes = { edgeSize = 2, insets = { left = 0, right = 0, top = 0, bottom = 0 } }, + nineSlice = { + corner = "Interface\\AddOns\\Guda\\Assets\\NineSlice-Corner", + edgeH = "Interface\\AddOns\\Guda\\Assets\\NineSlice-EdgeH", + edgeV = "Interface\\AddOns\\Guda\\Assets\\NineSlice-EdgeV", + cornerSize = 32, + edgeThickness = 16, + }, titleColor = { r = 1, g = 0.82, b = 0 }, slotBgAlpha = { empty = 1, filled = 1 }, footerButtonBg = { 0.5, 0.06, 0.06, 0.6 }, @@ -123,6 +131,26 @@ local function HideNineSlice(frame) end end +-- Apply or hide a TGA background texture (for themes where bgFile TGA doesn't work with SetBackdrop) +local function ApplyBgTexture(frame, texturePath, alpha) + if not frame._gudaBgTex then + frame._gudaBgTex = frame:CreateTexture(nil, "BACKGROUND") + end + local tex = frame._gudaBgTex + tex:ClearAllPoints() + tex:SetTexture(texturePath) + tex:SetPoint("TOPLEFT", frame, "TOPLEFT", 6, -6) + tex:SetPoint("BOTTOMRIGHT", frame, "BOTTOMRIGHT", -6, 6) + tex:SetAlpha(alpha or 1) + tex:Show() +end + +local function HideBgTexture(frame) + if frame._gudaBgTex then + frame._gudaBgTex:Hide() + end +end + -- Apply or hide background quadrant textures (4 pieces forming a 320x384 background) -- Layout: TopLeft(256x256) + TopRight(64x256) on top, -- BotLeft(256x128) + BotRight(64x128) directly below them @@ -325,6 +353,17 @@ function Theme:ApplyToFrame(frame) -- Background quadrant textures (disabled for testing) HideBgQuadrants(frame) + -- TGA background overlay (CreateTexture, since TGA doesn't work with SetBackdrop bgFile) + if t.bgOverlay then + local transparency = 0.15 + if addon.Modules and addon.Modules.DB then + transparency = addon.Modules.DB:GetSetting("bgTransparency") or 0.15 + end + ApplyBgTexture(frame, t.bgOverlay, 1.0 - transparency) + else + HideBgTexture(frame) + end + -- Background color / alpha local bg = t.bgColor local transparency = 0.15