api: get rid of custom texture borders

This commit is contained in:
shagu
2018-03-03 12:27:01 +01:00
parent 3b2ebbaf63
commit 7e393ab06c
4 changed files with 38 additions and 31 deletions
+1 -1
View File
@@ -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")
+19 -6
View File
@@ -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
+12 -11
View File
@@ -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"
+6 -13
View File
@@ -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