From 7e393ab06cd57cfb95ee0959b321a98c609f3aad Mon Sep 17 00:00:00 2001 From: shagu Date: Sat, 3 Mar 2018 12:27:01 +0100 Subject: [PATCH] api: get rid of custom texture borders --- api/config.lua | 2 +- modules/addons.lua | 25 +++++++++++++++++++------ modules/gui.lua | 23 ++++++++++++----------- pfUI.lua | 19 ++++++------------- 4 files changed, 38 insertions(+), 31 deletions(-) diff --git a/api/config.lua b/api/config.lua index bb3ea954..d01e990f 100644 --- a/api/config.lua +++ b/api/config.lua @@ -45,7 +45,7 @@ function pfUI:LoadConfig() pfUI:UpdateConfig("gui", nil, "reloadmarker", "0") pfUI:UpdateConfig("appearance", "border", "background", "0,0,0,1") - pfUI:UpdateConfig("appearance", "border", "color", "0.3,0.3,0.3,1") + pfUI:UpdateConfig("appearance", "border", "color", "0.2,0.2,0.2,1") pfUI:UpdateConfig("appearance", "border", "default", "3") pfUI:UpdateConfig("appearance", "border", "actionbars", "-1") pfUI:UpdateConfig("appearance", "border", "unitframes", "-1") diff --git a/modules/addons.lua b/modules/addons.lua index 859be4c9..c9238cdf 100644 --- a/modules/addons.lua +++ b/modules/addons.lua @@ -75,19 +75,33 @@ pfUI:RegisterModule("addons", function () -- basic frame if not pfUI.addons.list[i] then - pfUI.addons.list[i] = CreateFrame("Frame", nil, pfUI.addons.list) + pfUI.addons.list[i] = CreateFrame("Button", nil, pfUI.addons.list) local frame = pfUI.addons.list[i] frame:SetWidth(350) frame:SetHeight(25) - frame:SetBackdrop(pfUI.backdrop_underline) - frame:SetBackdropBorderColor(.1,.1,.1,1) frame:SetPoint("TOPLEFT", 25, i * -25) + frame:SetBackdrop(pfUI.backdrop_hover) + frame:SetBackdropBorderColor(1,1,1,.04) + + frame:EnableMouse(1) + frame:SetScript("OnEnter", function() + this:SetBackdropBorderColor(1,1,1,.08) + end) + + frame:SetScript("OnLeave", function() + this:SetBackdropBorderColor(1,1,1,.04) + end) + + frame:SetScript("OnClick", function() + this.input:Click() + end) + -- caption frame.caption = frame:CreateFontString("Status", "LOW", "GameFontNormal") frame.caption:SetFont(pfUI.font_default, C.global.font_size + 2, "OUTLINE") - frame.caption:SetAllPoints(frame) + frame.caption:SetPoint("LEFT", frame, "LEFT", 2, 0) frame.caption:SetFontObject(GameFontWhite) frame.caption:SetJustifyH("LEFT") frame.caption:SetText(atitle) @@ -99,11 +113,10 @@ pfUI:RegisterModule("addons", function () frame.input:SetPushedTexture("") frame.input:SetHighlightTexture("") CreateBackdrop(frame.input, nil, true) - --frame.input:SetBackdrop(pfUI.backdrop) frame.input:SetBackdropBorderColor(.3,.3,.3,1) frame.input:SetWidth(14) frame.input:SetHeight(14) - frame.input:SetPoint("TOPRIGHT" , 0, -4) + frame.input:SetPoint("RIGHT" , -5, 1) frame.input:SetID(i) frame.input:SetScript("OnClick", function () if this:GetChecked() then diff --git a/modules/gui.lua b/modules/gui.lua index fc9511bb..eea07f57 100644 --- a/modules/gui.lua +++ b/modules/gui.lua @@ -27,17 +27,16 @@ pfUI:RegisterModule("gui", function () frame:SetPoint("TOPLEFT", 25, parent.objectCount * -25) frame:EnableMouse(true) frame:SetScript("OnEnter", function() - this:SetBackdropBorderColor(1,1,1,.3) + this:SetBackdropBorderColor(1,1,1,.08) end) frame:SetScript("OnLeave", function() - this:SetBackdropBorderColor(1,1,1,.15) + this:SetBackdropBorderColor(1,1,1,.04) end) if not widget or (widget and widget ~= "button") then - - frame:SetBackdrop(pfUI.backdrop_underline) - frame:SetBackdropBorderColor(1,1,1,.15) + frame:SetBackdrop(pfUI.backdrop_hover) + frame:SetBackdropBorderColor(1,1,1,.04) if not ufunc and widget ~= "header" and C.gui.reloadmarker == "1" then caption = caption .. " [|cffffaaaa!|r]" @@ -46,7 +45,7 @@ pfUI:RegisterModule("gui", function () -- caption frame.caption = frame:CreateFontString("Status", "LOW", "GameFontNormal") frame.caption:SetFont(pfUI.font_default, C.global.font_size + 2, "OUTLINE") - frame.caption:SetAllPoints(frame) + frame.caption:SetPoint("LEFT", frame, "LEFT", 3, 1) frame.caption:SetFontObject(GameFontWhite) frame.caption:SetJustifyH("LEFT") frame.caption:SetText(caption) @@ -64,7 +63,7 @@ pfUI:RegisterModule("gui", function () frame.color:SetWidth(24) frame.color:SetHeight(12) CreateBackdrop(frame.color) - frame.color:SetPoint("TOPRIGHT" , 0, -4) + frame.color:SetPoint("RIGHT" , -5, 1) frame.color.prev = frame.color.backdrop:CreateTexture("OVERLAY") frame.color.prev:SetAllPoints(frame.color) @@ -136,12 +135,14 @@ pfUI:RegisterModule("gui", function () if not widget or widget == "text" then -- input field frame.input = CreateFrame("EditBox", nil, frame) + CreateBackdrop(frame.input, nil, true) + frame.input:SetTextInsets(5, 5, 5, 5) frame.input:SetTextColor(.2,1,.8,1) frame.input:SetJustifyH("RIGHT") frame.input:SetWidth(100) - frame.input:SetHeight(16) - frame.input:SetPoint("TOPRIGHT" , 0, -2) + frame.input:SetHeight(18) + frame.input:SetPoint("RIGHT" , -3, 0) frame.input:SetFontObject(GameFontNormal) frame.input:SetAutoFocus(false) frame.input:SetText(category[config]) @@ -185,7 +186,7 @@ pfUI:RegisterModule("gui", function () CreateBackdrop(frame.input, nil, true) frame.input:SetWidth(14) frame.input:SetHeight(14) - frame.input:SetPoint("TOPRIGHT" , 0, -4) + frame.input:SetPoint("RIGHT" , -5, 1) frame.input:SetScript("OnClick", function () if this:GetChecked() then this:GetParent().category[this:GetParent().config] = "1" @@ -207,7 +208,7 @@ pfUI:RegisterModule("gui", function () frame.input = CreateFrame("Frame", "pfUIDropDownMenu" .. name, frame, "UIDropDownMenuTemplate") frame.input:ClearAllPoints() - frame.input:SetPoint("TOPRIGHT" , 20, 3) + frame.input:SetPoint("RIGHT" , 16, -2) frame.input:Show() frame.input.point = "TOPRIGHT" frame.input.relativePoint = "BOTTOMRIGHT" diff --git a/pfUI.lua b/pfUI.lua index 12f95062..55f2e383 100644 --- a/pfUI.lua +++ b/pfUI.lua @@ -25,9 +25,7 @@ pfUI_playerDB = {} pfUI_config = {} pfUI_init = {} pfUI_profiles = {} -if not pfUI_gold then - pfUI_gold = {} -end +pfUI_gold = {} -- localization pfUI_locale = {} @@ -115,22 +113,17 @@ function pfUI:RegisterSkin(n, f) end pfUI.backdrop = { - bgFile = "Interface\\AddOns\\pfUI\\img\\col", tile = true, tileSize = 8, - edgeFile = "Interface\\AddOns\\pfUI\\img\\border", edgeSize = 8, + bgFile = "Interface\\BUTTONS\\WHITE8X8", tile = false, tileSize = 0, + edgeFile = "Interface\\BUTTONS\\WHITE8X8", edgeSize = 1, insets = {left = -1, right = -1, top = -1, bottom = -1}, } +pfUI.backdrop_no_top = pfUI.backdrop -pfUI.backdrop_no_top = { - bgFile = "Interface\\AddOns\\pfUI\\img\\col", tile = true, tileSize = 8, - edgeFile = "Interface\\AddOns\\pfUI\\img\\border_no_top", edgeSize = 8, +pfUI.backdrop_hover = { + edgeFile = "Interface\\BUTTONS\\WHITE8X8", edgeSize = 24, insets = {left = -1, right = -1, top = -1, bottom = -1}, } -pfUI.backdrop_underline = { - edgeFile = "Interface\\AddOns\\pfUI\\img\\underline", edgeSize = 8, - insets = {left = 0, right = 0, top = 0, bottom = 0}, -} - message = function (msg) DEFAULT_CHAT_FRAME:AddMessage("|cffcccc33INFO: |cffffff55"..msg) end