diff --git a/api/config.lua b/api/config.lua index 770e7ae4..ee3b77a0 100644 --- a/api/config.lua +++ b/api/config.lua @@ -61,9 +61,14 @@ function pfUI:LoadConfig() pfUI:UpdateConfig("buffs", nil, "fontsize", "-1") pfUI:UpdateConfig("buffbar", "pbuff", "enable", "0") + pfUI:UpdateConfig("buffbar", "pbuff", "use_unitfonts", "0") pfUI:UpdateConfig("buffbar", "pbuff", "sort", "asc") - pfUI:UpdateConfig("buffbar", "pbuff", "color", ".1,.1,.1,1") - pfUI:UpdateConfig("buffbar", "pbuff", "autocolor", "1") + pfUI:UpdateConfig("buffbar", "pbuff", "color", ".5,.5,.5,1") + pfUI:UpdateConfig("buffbar", "pbuff", "bordercolor", "0,0,0,0") + pfUI:UpdateConfig("buffbar", "pbuff", "textcolor", "1,1,1,1") + pfUI:UpdateConfig("buffbar", "pbuff", "dtypebg", "1") + pfUI:UpdateConfig("buffbar", "pbuff", "dtypeborder", "0") + pfUI:UpdateConfig("buffbar", "pbuff", "dtypetext", "0") pfUI:UpdateConfig("buffbar", "pbuff", "width", "-1") pfUI:UpdateConfig("buffbar", "pbuff", "height", "20") pfUI:UpdateConfig("buffbar", "pbuff", "filter", "blacklist") @@ -72,9 +77,14 @@ function pfUI:LoadConfig() pfUI:UpdateConfig("buffbar", "pbuff", "blacklist", "") pfUI:UpdateConfig("buffbar", "pdebuff", "enable", "0") + pfUI:UpdateConfig("buffbar", "pdebuff", "use_unitfonts", "0") pfUI:UpdateConfig("buffbar", "pdebuff", "sort", "asc") - pfUI:UpdateConfig("buffbar", "pdebuff", "color", ".1,.1,.1,1") - pfUI:UpdateConfig("buffbar", "pdebuff", "autocolor", "1") + pfUI:UpdateConfig("buffbar", "pdebuff", "color", "8,.4,.4,1") + pfUI:UpdateConfig("buffbar", "pdebuff", "bordercolor", "0,0,0,0") + pfUI:UpdateConfig("buffbar", "pdebuff", "textcolor", "1,1,1,1") + pfUI:UpdateConfig("buffbar", "pdebuff", "dtypebg", "0") + pfUI:UpdateConfig("buffbar", "pdebuff", "dtypeborder", "1") + pfUI:UpdateConfig("buffbar", "pdebuff", "dtypetext", "0") pfUI:UpdateConfig("buffbar", "pdebuff", "width", "-1") pfUI:UpdateConfig("buffbar", "pdebuff", "height", "20") pfUI:UpdateConfig("buffbar", "pdebuff", "filter", "blacklist") @@ -83,9 +93,14 @@ function pfUI:LoadConfig() pfUI:UpdateConfig("buffbar", "pdebuff", "blacklist", "") pfUI:UpdateConfig("buffbar", "tdebuff", "enable", "0") + pfUI:UpdateConfig("buffbar", "tdebuff", "use_unitfonts", "0") pfUI:UpdateConfig("buffbar", "tdebuff", "sort", "asc") - pfUI:UpdateConfig("buffbar", "tdebuff", "color", ".1,.1,.1,1") - pfUI:UpdateConfig("buffbar", "tdebuff", "autocolor", "1") + pfUI:UpdateConfig("buffbar", "tdebuff", "color", ".8,.4,.4,1") + pfUI:UpdateConfig("buffbar", "tdebuff", "bordercolor", "0,0,0,0") + pfUI:UpdateConfig("buffbar", "tdebuff", "textcolor", "1,1,1,1") + pfUI:UpdateConfig("buffbar", "tdebuff", "dtypebg", "0") + pfUI:UpdateConfig("buffbar", "tdebuff", "dtypeborder", "1") + pfUI:UpdateConfig("buffbar", "tdebuff", "dtypetext", "0") pfUI:UpdateConfig("buffbar", "tdebuff", "width", "-1") pfUI:UpdateConfig("buffbar", "tdebuff", "height", "20") pfUI:UpdateConfig("buffbar", "tdebuff", "filter", "blacklist") @@ -983,5 +998,19 @@ function pfUI:MigrateConfig() pfUI_config.buffs.debuffs = pfUI_config.global.hidebuff == "1" and "0" or "1" end + -- migrating default debuffbar color settings (> 3.16) + if checkversion(3, 16, 0) then + + if pfUI_config.buffbar.pdebuff.color == ".1,.1,.1,1" then + pfUI_config.buffbar.pdebuff.color = ".8,.4,.4,1" + end + + if pfUI_config.buffbar.tdebuff.color == ".1,.1,.1,1" then + pfUI_config.buffbar.tdebuff.color = ".8,.4,.4,1" + end + end + + pfUI:UpdateConfig("buffbar", "tdebuff", "color", ".5,.1,.1,1") + pfUI_config.version = pfUI.version.string -end +end \ No newline at end of file diff --git a/modules/buffwatch.lua b/modules/buffwatch.lua index fe3ca979..c3b1e49c 100644 --- a/modules/buffwatch.lua +++ b/modules/buffwatch.lua @@ -135,10 +135,14 @@ pfUI:RegisterModule("buffwatch", function () local function CreateStatusBar(bar, parent) local color = parent.color + local bordercolor = parent.bordercolor + local textcolor = parent.textcolor local width = parent:GetWidth() local height = parent:GetHeight() local framename = "pf" .. parent.unit .. ( parent.type == "HARMFUL" and "Debuff" or "Buff" ) .. "Bar" .. bar + local font = parent.config.use_unitfonts == "1" and pfUI.font_unit or pfUI.font_default + frame = _G[framename] or CreateFrame("Button", framename, parent) frame:EnableMouse(1) frame:Hide() @@ -158,7 +162,8 @@ pfUI:RegisterModule("buffwatch", function () frame.text:SetPoint("BOTTOMRIGHT", frame.bar, "BOTTOMRIGHT", -3, 0) frame.text:SetNonSpaceWrap(false) frame.text:SetFontObject(GameFontWhite) - frame.text:SetTextColor(1,1,1,1) + frame.text:SetFont(font, C.global.font_size) + frame.text:SetTextColor(textcolor.r,textcolor.g,textcolor.b,1) frame.text:SetJustifyH("LEFT") frame.time = frame.bar:CreateFontString("Status", "DIALOG", "GameFontNormal") @@ -167,6 +172,7 @@ pfUI:RegisterModule("buffwatch", function () frame.time:SetPoint("BOTTOMRIGHT", frame.bar, "BOTTOMRIGHT", -3, 0) frame.time:SetNonSpaceWrap(false) frame.time:SetFontObject(GameFontWhite) + frame.time:SetFont(font, C.global.font_size) frame.time:SetTextColor(1,1,1,1) frame.time:SetJustifyH("RIGHT") @@ -187,6 +193,10 @@ pfUI:RegisterModule("buffwatch", function () frame:SetScript("OnLeave", StatusBarOnLeave) CreateBackdrop(frame) + if bordercolor.r ~= "0" and bordercolor.g ~= "0" and bordercolor.b ~= "0" and bordercolor.a ~= "0" then + frame.backdrop:SetBackdropBorderColor(bordercolor.r,bordercolor.g,bordercolor.b,1) + end + return frame end @@ -244,18 +254,20 @@ pfUI:RegisterModule("buffwatch", function () if dtype and DebuffTypeColor[dtype] then r,g,b = DebuffTypeColor[dtype].r,DebuffTypeColor[dtype].g,DebuffTypeColor[dtype].b end - - if frame.config.autocolor == "1" then - frame.bars[bar].backdrop:SetBackdropBorderColor(1,0,0,1) - frame.bars[bar].bar:SetStatusBarColor(1,.2,.2,1) - frame.bars[bar].text:SetTextColor(r+.5,g+.5,b+.5,1) - else - frame.bars[bar].backdrop:SetBackdropBorderColor(r,g,b,1) - end - elseif frame.config.autocolor == "1" then + else r,g,b = str2rgb(data[3]) frame.bars[bar].bar:SetStatusBarColor(r,g,b,1) end + + if frame.config.dtypebg == "1" then + frame.bars[bar].bar:SetStatusBarColor(r,g,b,1) + end + if frame.config.dtypeborder == "1" then + frame.bars[bar].backdrop:SetBackdropBorderColor(r,g,b,1) + end + if frame.config.dtypetext == "1" then + frame.bars[bar].text:SetTextColor(r,g,b,1) + end end -- set texture @@ -338,7 +350,9 @@ pfUI:RegisterModule("buffwatch", function () if pfUI.uf.player and C.buffbar.pbuff.enable == "1" then pfUI.uf.player.buffbar = CreateBuffBarFrame("Player", "HELPFUL") local config = C.buffbar.pbuff - local r, g, b, a = strsplit(",", C.buffbar.pbuff.color) + local r, g, b, a = strsplit(",", config.color) + local br, bg, bb, ba = strsplit(",", config.bordercolor) + local tr, tg, tb, ta = strsplit(",", config.textcolor) pfUI.uf.player.buffbar:SetWidth(config.width == "-1" and C.unitframes.player.width or config.width) pfUI.uf.player.buffbar:SetHeight(config.height) @@ -346,6 +360,8 @@ pfUI:RegisterModule("buffwatch", function () pfUI.uf.player.buffbar.config = config pfUI.uf.player.buffbar.buffcmp = config.sort == "asc" and asc or desc pfUI.uf.player.buffbar.color = { r = r, g = g, b = b, a = a } + pfUI.uf.player.buffbar.bordercolor = { r = br, g = bg, b = bb, a = ba } + pfUI.uf.player.buffbar.textcolor = { r = tr, g = tg, b = tb, a = ta } pfUI.uf.player.buffbar.anchors = { pfUI.uf.player, pfUI.uf.player and pfUI.uf.player.debuffs, @@ -360,7 +376,9 @@ pfUI:RegisterModule("buffwatch", function () -- create player debuffbars if pfUI.uf.player and C.buffbar.pdebuff.enable == "1" then local config = C.buffbar.pdebuff - local r, g, b, a = strsplit(",", C.buffbar.pdebuff.color) + local r, g, b, a = strsplit(",", config.color) + local br, bg, bb, ba = strsplit(",", config.bordercolor) + local tr, tg, tb, ta = strsplit(",", config.textcolor) pfUI.uf.player.debuffbar = CreateBuffBarFrame("Player", "HARMFUL") pfUI.uf.player.debuffbar:SetWidth(config.width == "-1" and C.unitframes.player.width or config.width) @@ -369,6 +387,8 @@ pfUI:RegisterModule("buffwatch", function () pfUI.uf.player.debuffbar.config = config pfUI.uf.player.debuffbar.buffcmp = config.sort == "asc" and asc or desc pfUI.uf.player.debuffbar.color = { r = r, g = g, b = b, a = a } + pfUI.uf.player.debuffbar.bordercolor = { r = br, g = bg, b = bb, a = ba } + pfUI.uf.player.debuffbar.textcolor = { r = tr, g = tg, b = tb, a = ta } pfUI.uf.player.debuffbar.anchors = { pfUI.uf.player, pfUI.uf.player and pfUI.uf.player.buffbar and pfUI.uf.player.buffbar.bars, @@ -385,6 +405,8 @@ pfUI:RegisterModule("buffwatch", function () if pfUI.uf.target and C.buffbar.tdebuff.enable == "1" then local config = C.buffbar.tdebuff local r, g, b, a = strsplit(",", config.color) + local br, bg, bb, ba = strsplit(",", config.bordercolor) + local tr, tg, tb, ta = strsplit(",", config.textcolor) pfUI.uf.target.debuffbar = CreateBuffBarFrame("Target", "HARMFUL") pfUI.uf.target.debuffbar:SetWidth(config.width == "-1" and C.unitframes.target.width or config.width) @@ -392,6 +414,8 @@ pfUI:RegisterModule("buffwatch", function () pfUI.uf.target.debuffbar.config = config pfUI.uf.target.debuffbar.buffcmp = config.sort == "asc" and asc or desc pfUI.uf.target.debuffbar.color = { r = r, g = g, b = b, a = a } + pfUI.uf.target.debuffbar.bordercolor = { r = br, g = bg, b = bb, a = ba } + pfUI.uf.target.debuffbar.textcolor = { r = tr, g = tg, b = tb, a = ta } pfUI.uf.target.debuffbar.threshold = tonumber(config.threshold) pfUI.uf.target.debuffbar.anchors = { pfUI.uf.target, @@ -404,4 +428,4 @@ pfUI:RegisterModule("buffwatch", function () pfUI.uf.target.debuffbar:SetPoint("BOTTOM", pfUI.uf.target, "TOP", 0, border*2+1) UpdateMovable(pfUI.uf.target.debuffbar) end -end) +end) \ No newline at end of file diff --git a/modules/gui.lua b/modules/gui.lua index f0649dac..35c1f55d 100644 --- a/modules/gui.lua +++ b/modules/gui.lua @@ -1167,9 +1167,14 @@ pfUI:RegisterModule("gui", function () if not this.setup then CreateConfig(update[c], this, T["Player Buffs"], nil, nil, "header") CreateConfig(nil, this, T["Enable Bar"], C.buffbar.pbuff, "enable", "checkbox") + CreateConfig(nil, this, T["Use Unit Fonts"], C.buffbar.pbuff, "use_unitfonts", "checkbox") CreateConfig(nil, this, T["Sort Order"], C.buffbar.pbuff, "sort", "dropdown", pfUI.gui.dropdowns.buffbarsort) - CreateConfig(nil, this, T["Custom Color"], C.buffbar.pbuff, "color", "color") - CreateConfig(nil, this, T["Automatic Color"], C.buffbar.pbuff, "autocolor", "checkbox") + CreateConfig(nil, this, T["Background Color"], C.buffbar.pbuff, "color", "color") + CreateConfig(nil, this, T["Border Color"], C.buffbar.pbuff, "bordercolor", "color") + CreateConfig(nil, this, T["Text Color"], C.buffbar.pbuff, "textcolor", "color") + CreateConfig(nil, this, T["Automatic Background Color"], C.buffbar.pbuff, "dtypebg", "checkbox") + CreateConfig(nil, this, T["Automatic Border Color"], C.buffbar.pbuff, "dtypeborder", "checkbox") + CreateConfig(nil, this, T["Automatic Text Color"], C.buffbar.pbuff, "dtypetext", "checkbox") CreateConfig(nil, this, T["Buffbar Width"], C.buffbar.pbuff, "width") CreateConfig(nil, this, T["Buffbar Height"], C.buffbar.pbuff, "height") CreateConfig(nil, this, T["Filter Mode"], C.buffbar.pbuff, "filter", "dropdown", pfUI.gui.dropdowns.buffbarfilter) @@ -1179,9 +1184,14 @@ pfUI:RegisterModule("gui", function () CreateConfig(update[c], this, T["Player Debuffs"], nil, nil, "header") CreateConfig(nil, this, T["Enable Bar"], C.buffbar.pdebuff, "enable", "checkbox") + CreateConfig(nil, this, T["Use Unit Fonts"], C.buffbar.pdebuff, "use_unitfonts", "checkbox") CreateConfig(nil, this, T["Sort Order"], C.buffbar.pdebuff, "sort", "dropdown", pfUI.gui.dropdowns.buffbarsort) - CreateConfig(nil, this, T["Custom Color"], C.buffbar.pdebuff, "color", "color") - CreateConfig(nil, this, T["Automatic Color"], C.buffbar.pdebuff, "autocolor", "checkbox") + CreateConfig(nil, this, T["Background Color"], C.buffbar.pdebuff, "color", "color") + CreateConfig(nil, this, T["Border Color"], C.buffbar.pdebuff, "bordercolor", "color") + CreateConfig(nil, this, T["Text Color"], C.buffbar.pdebuff, "textcolor", "color") + CreateConfig(nil, this, T["Automatic Background Color"], C.buffbar.pdebuff, "dtypebg", "checkbox") + CreateConfig(nil, this, T["Automatic Border Color"], C.buffbar.pdebuff, "dtypeborder", "checkbox") + CreateConfig(nil, this, T["Automatic Text Color"], C.buffbar.pdebuff, "dtypetext", "checkbox") CreateConfig(nil, this, T["Buffbar Width"], C.buffbar.pdebuff, "width") CreateConfig(nil, this, T["Buffbar Height"], C.buffbar.pdebuff, "height") CreateConfig(nil, this, T["Filter Mode"], C.buffbar.pdebuff, "filter", "dropdown", pfUI.gui.dropdowns.buffbarfilter) @@ -1191,9 +1201,14 @@ pfUI:RegisterModule("gui", function () CreateConfig(update[c], this, T["Target Debuffs"], nil, nil, "header") CreateConfig(nil, this, T["Enable Bar"], C.buffbar.tdebuff, "enable", "checkbox") + CreateConfig(nil, this, T["Use Unit Fonts"], C.buffbar.tdebuff, "use_unitfonts", "checkbox") CreateConfig(nil, this, T["Sort Order"], C.buffbar.tdebuff, "sort", "dropdown", pfUI.gui.dropdowns.buffbarsort) - CreateConfig(nil, this, T["Custom Color"], C.buffbar.tdebuff, "color", "color") - CreateConfig(nil, this, T["Automatic Color"], C.buffbar.tdebuff, "autocolor", "checkbox") + CreateConfig(nil, this, T["Background Color"], C.buffbar.tdebuff, "color", "color") + CreateConfig(nil, this, T["Border Color"], C.buffbar.tdebuff, "bordercolor", "color") + CreateConfig(nil, this, T["Text Color"], C.buffbar.tdebuff, "textcolor", "color") + CreateConfig(nil, this, T["Automatic Background Color"], C.buffbar.tdebuff, "dtypebg", "checkbox") + CreateConfig(nil, this, T["Automatic Border Color"], C.buffbar.tdebuff, "dtypeborder", "checkbox") + CreateConfig(nil, this, T["Automatic Text Color"], C.buffbar.tdebuff, "dtypetext", "checkbox") CreateConfig(nil, this, T["Buffbar Width"], C.buffbar.tdebuff, "width") CreateConfig(nil, this, T["Buffbar Height"], C.buffbar.tdebuff, "height") CreateConfig(nil, this, T["Filter Mode"], C.buffbar.tdebuff, "filter", "dropdown", pfUI.gui.dropdowns.buffbarfilter) @@ -1517,4 +1532,4 @@ pfUI:RegisterModule("gui", function () -- make those available to external modules pfUI.gui.CreateConfig = CreateConfig pfUI.gui.update = update -end) +end) \ No newline at end of file diff --git a/pfUI.toc b/pfUI.toc index d7eba6af..9a843a04 100644 --- a/pfUI.toc +++ b/pfUI.toc @@ -2,7 +2,7 @@ ## Title: |cff33ffccpf|cffffffffUI ## Author: Shagu ## Notes: A complete user interface replacement. -## Version: 3.15 +## Version: 3.16 ## SavedVariables: pfUI_profiles, pfUI_addon_profiles, pfUI_cache ## SavedVariablesPerCharacter: pfUI_config, pfUI_init, pfUI_playerDB