diff --git a/ui_config.lua b/ui_config.lua index cf246d1..f248c4b 100644 --- a/ui_config.lua +++ b/ui_config.lua @@ -8,15 +8,14 @@ AA.ApplyConfig = function() AA.M:SetScale(AA.db.scale or 1) AA.M:SetAlpha(1) AA.ApplyOpacity(AA.db.alpha or 1) - local cr, cg, cb = AA.BgColor() - AA.f:SetBackdropColor(cr or 0, cg or 0, cb or 0, AA.db.cdalpha or 1) + AA.SetSkinAlpha(AA.f, AA.db.cdalpha or 1) if AA.UpdateSwatch then AA.UpdateSwatch() end AA.Layout() end local cfg = CreateFrame("Frame", "AdeAltsConfig", UIParent) cfg:SetWidth(280) -cfg:SetHeight(404) +cfg:SetHeight(444) cfg:SetPoint("CENTER", UIParent, "CENTER", 0, 0) cfg:SetFrameStrata("DIALOG") cfg:SetMovable(true) @@ -25,7 +24,7 @@ cfg:RegisterForDrag("LeftButton") cfg:SetScript("OnDragStart", function() this:StartMoving() end) cfg:SetScript("OnDragStop", function() this:StopMovingOrSizing() end) cfg:Hide() -AA.SkinFrame(cfg, 0.97, true) +AA.SkinFrame(cfg, 0.97, true, true) table.insert(UISpecialFrames, "AdeAltsConfig") local ctitle = cfg:CreateFontString(nil, "OVERLAY", "GameFontNormal") @@ -123,8 +122,35 @@ swatch:SetScript("OnClick", function() ColorPickerFrame:Show() end) +-- window style: Auto (pfUI when installed) / Blizzard / pfUI +local stylabel = cfg:CreateFontString(nil, "OVERLAY", "GameFontNormal") +stylabel:SetPoint("TOPLEFT", cfg, "TOPLEFT", 20, -344) +stylabel:SetText("Window style") +local stybtn = CreateFrame("Button", nil, cfg, "UIPanelButtonTemplate") +stybtn:SetWidth(100) +stybtn:SetHeight(22) +stybtn:SetPoint("TOPRIGHT", cfg, "TOPRIGHT", -20, -340) +local stynote = cfg:CreateFontString(nil, "OVERLAY", "GameFontDisableSmall") +stynote:SetPoint("TOPLEFT", cfg, "TOPLEFT", 20, -368) +stynote:SetWidth(240) +stynote:SetJustifyH("LEFT") +stynote:SetText("Auto: pfUI look if pfUI is installed, classic Blizzard look otherwise.") + +AA.UpdateStyleBtn = function() + local st = AA.db and AA.db.style + stybtn:SetText((st == "blizz" and "Blizzard") or (st == "pfui" and "pfUI") or "Auto") +end +stybtn:SetScript("OnClick", function() + if not AA.db then return end + local st = AA.db.style + if st == nil then AA.db.style = "blizz" elseif st == "blizz" then AA.db.style = "pfui" else AA.db.style = nil end + AA.ApplyStyle() + AA.UpdateStyleBtn() +end) + local function LoadConfigUI() AA.UpdateSwatch() + AA.UpdateStyleBtn() cfg.loading = true for _, sl in ipairs(sliders) do local v = (AA.db and AA.db[sl.field]) or sl.default @@ -143,6 +169,8 @@ creset:SetText("Reset") creset:SetScript("OnClick", function() for _, sl in ipairs(sliders) do AA.db[sl.field] = sl.default end AA.db.bg = nil + AA.db.style = nil + AA.ApplyStyle() AA.ApplyConfig() LoadConfigUI() end)