unitframes: add more buff/debuff positions

This commit is contained in:
2018-12-26 21:04:39 +03:00
committed by shagu
parent 2fb7828bfd
commit f13ac95ebb
4 changed files with 65 additions and 36 deletions
+24 -13
View File
@@ -203,11 +203,11 @@ function pfUI:LoadConfig()
pfUI:UpdateConfig("unitframes", "player", "pwidth", "-1")
pfUI:UpdateConfig("unitframes", "player", "panchor", "TOP")
pfUI:UpdateConfig("unitframes", "player", "pspace", "-3")
pfUI:UpdateConfig("unitframes", "player", "buffs", "top")
pfUI:UpdateConfig("unitframes", "player", "buffs", "TOPLEFT")
pfUI:UpdateConfig("unitframes", "player", "buffsize", "20")
pfUI:UpdateConfig("unitframes", "player", "bufflimit", "32")
pfUI:UpdateConfig("unitframes", "player", "buffperrow", "8")
pfUI:UpdateConfig("unitframes", "player", "debuffs", "top")
pfUI:UpdateConfig("unitframes", "player", "debuffs", "TOPLEFT")
pfUI:UpdateConfig("unitframes", "player", "debuffsize", "20")
pfUI:UpdateConfig("unitframes", "player", "debufflimit", "32")
pfUI:UpdateConfig("unitframes", "player", "debuffperrow", "8")
@@ -246,11 +246,11 @@ function pfUI:LoadConfig()
pfUI:UpdateConfig("unitframes", "target", "pwidth", "-1")
pfUI:UpdateConfig("unitframes", "target", "panchor", "TOP")
pfUI:UpdateConfig("unitframes", "target", "pspace", "-3")
pfUI:UpdateConfig("unitframes", "target", "buffs", "top")
pfUI:UpdateConfig("unitframes", "target", "buffs", "TOPLEFT")
pfUI:UpdateConfig("unitframes", "target", "buffsize", "20")
pfUI:UpdateConfig("unitframes", "target", "bufflimit", "32")
pfUI:UpdateConfig("unitframes", "target", "buffperrow", "8")
pfUI:UpdateConfig("unitframes", "target", "debuffs", "top")
pfUI:UpdateConfig("unitframes", "target", "debuffs", "TOPLEFT")
pfUI:UpdateConfig("unitframes", "target", "debuffsize", "20")
pfUI:UpdateConfig("unitframes", "target", "debufflimit", "32")
pfUI:UpdateConfig("unitframes", "target", "debuffperrow", "8")
@@ -290,11 +290,11 @@ function pfUI:LoadConfig()
pfUI:UpdateConfig("unitframes", "focus", "pwidth", "-1")
pfUI:UpdateConfig("unitframes", "focus", "panchor", "TOP")
pfUI:UpdateConfig("unitframes", "focus", "pspace", "-3")
pfUI:UpdateConfig("unitframes", "focus", "buffs", "top")
pfUI:UpdateConfig("unitframes", "focus", "buffs", "TOPLEFT")
pfUI:UpdateConfig("unitframes", "focus", "buffsize", "12")
pfUI:UpdateConfig("unitframes", "focus", "bufflimit", "32")
pfUI:UpdateConfig("unitframes", "focus", "buffperrow", "8")
pfUI:UpdateConfig("unitframes", "focus", "debuffs", "top")
pfUI:UpdateConfig("unitframes", "focus", "debuffs", "TOPLEFT")
pfUI:UpdateConfig("unitframes", "focus", "debuffsize", "12")
pfUI:UpdateConfig("unitframes", "focus", "debufflimit", "32")
pfUI:UpdateConfig("unitframes", "focus", "debuffperrow", "8")
@@ -333,11 +333,11 @@ function pfUI:LoadConfig()
pfUI:UpdateConfig("unitframes", "group", "pwidth", "-1")
pfUI:UpdateConfig("unitframes", "group", "panchor", "TOP")
pfUI:UpdateConfig("unitframes", "group", "pspace", "-3")
pfUI:UpdateConfig("unitframes", "group", "buffs", "bottom")
pfUI:UpdateConfig("unitframes", "group", "buffs", "BOTTOMLEFT")
pfUI:UpdateConfig("unitframes", "group", "buffsize", "8")
pfUI:UpdateConfig("unitframes", "group", "bufflimit", "16")
pfUI:UpdateConfig("unitframes", "group", "buffperrow", "8")
pfUI:UpdateConfig("unitframes", "group", "debuffs", "bottom")
pfUI:UpdateConfig("unitframes", "group", "debuffs", "BOTTOMLEFT")
pfUI:UpdateConfig("unitframes", "group", "debuffsize", "8")
pfUI:UpdateConfig("unitframes", "group", "debufflimit", "8")
pfUI:UpdateConfig("unitframes", "group", "debuffperrow", "8")
@@ -549,11 +549,11 @@ function pfUI:LoadConfig()
pfUI:UpdateConfig("unitframes", "pet", "pwidth", "-1")
pfUI:UpdateConfig("unitframes", "pet", "panchor", "TOP")
pfUI:UpdateConfig("unitframes", "pet", "pspace", "-3")
pfUI:UpdateConfig("unitframes", "pet", "buffs", "top")
pfUI:UpdateConfig("unitframes", "pet", "buffs", "TOPLEFT")
pfUI:UpdateConfig("unitframes", "pet", "buffsize", "12")
pfUI:UpdateConfig("unitframes", "pet", "bufflimit", "16")
pfUI:UpdateConfig("unitframes", "pet", "buffperrow", "8")
pfUI:UpdateConfig("unitframes", "pet", "debuffs", "top")
pfUI:UpdateConfig("unitframes", "pet", "debuffs", "TOPLEFT")
pfUI:UpdateConfig("unitframes", "pet", "debuffsize", "12")
pfUI:UpdateConfig("unitframes", "pet", "debufflimit", "16")
pfUI:UpdateConfig("unitframes", "pet", "debuffperrow", "8")
@@ -635,11 +635,11 @@ function pfUI:LoadConfig()
pfUI:UpdateConfig("unitframes", "fallback", "pwidth", "-1")
pfUI:UpdateConfig("unitframes", "fallback", "panchor", "TOP")
pfUI:UpdateConfig("unitframes", "fallback", "pspace", "-3")
pfUI:UpdateConfig("unitframes", "fallback", "buffs", "top")
pfUI:UpdateConfig("unitframes", "fallback", "buffs", "TOPLEFT")
pfUI:UpdateConfig("unitframes", "fallback", "buffsize", "20")
pfUI:UpdateConfig("unitframes", "fallback", "bufflimit", "16")
pfUI:UpdateConfig("unitframes", "fallback", "buffperrow", "8")
pfUI:UpdateConfig("unitframes", "fallback", "debuffs", "top")
pfUI:UpdateConfig("unitframes", "fallback", "debuffs", "TOPLEFT")
pfUI:UpdateConfig("unitframes", "fallback", "debuffsize", "20")
pfUI:UpdateConfig("unitframes", "fallback", "debufflimit", "16")
pfUI:UpdateConfig("unitframes", "fallback", "debuffperrow", "8")
@@ -1015,7 +1015,18 @@ function pfUI:MigrateConfig()
end
end
pfUI:UpdateConfig("buffbar", "tdebuff", "color", ".5,.1,.1,1")
-- migrating default debuffbar color settings (> 3.17)
if checkversion(3, 17, 0) then
local unitframes = { "player", "target", "focus", "group", "grouptarget", "grouppet", "raid", "ttarget", "pet", "ptarget", "fallback" }
for _, unitframe in pairs(unitframes) do
local entry = pfUI_config.unitframes[unitframe]
if entry.buffs and entry.buffs == "top" then entry.buffs = "TOPLEFT" end
if entry.buffs and entry.buffs == "bottom" then entry.buffs = "BOTTOMLEFT" end
if entry.debuffs and entry.debuffs == "top" then entry.debuffs = "TOPLEFT" end
if entry.debuffs and entry.debuffs == "bottom" then entry.debuffs = "BOTTOMLEFT" end
end
end
pfUI_config.version = pfUI.version.string
end
+36 -20
View File
@@ -389,20 +389,28 @@ function pfUI.uf:UpdateConfig()
f.buffs[i]:RegisterForClicks("RightButtonUp")
f.buffs[i]:ClearAllPoints()
local invert, af, as
if f.config.buffs == "top" then
invert = 1
local invert_h, invert_v, af
if f.config.buffs == "TOPLEFT" then
invert_h = 1
invert_v = 1
af = "BOTTOMLEFT"
as = "TOPLEFT"
elseif f.config.buffs == "bottom" then
invert = -1
elseif f.config.buffs == "BOTTOMLEFT" then
invert_h = -1
invert_v = 1
af = "TOPLEFT"
as = "BOTTOMLEFT"
elseif f.config.buffs == "TOPRIGHT" then
invert_h = 1
invert_v = -1
af = "BOTTOMRIGHT"
elseif f.config.buffs == "BOTTOMRIGHT" then
invert_h = -1
invert_v = -1
af = "TOPRIGHT"
end
f.buffs[i]:SetPoint(af, f, as,
(i-1-row*perrow)*((2*default_border) + f.config.buffsize + 1),
invert * (row)*((2*default_border) + f.config.buffsize + 1) + invert*(2*default_border + 1))
f.buffs[i]:SetPoint(af, f, f.config.buffs,
invert_v * (i-1-row*perrow)*(2*default_border + f.config.buffsize + 1),
invert_h * (row*(2*default_border + f.config.buffsize + 1) + (2*default_border + 1)))
f.buffs[i]:SetWidth(f.config.buffsize)
f.buffs[i]:SetHeight(f.config.buffsize)
@@ -1125,20 +1133,28 @@ function pfUI.uf:RefreshUnit(unit, component)
if unit.buffs[3*bperrow+1] and unit.buffs[3*bperrow+1]:IsShown() then buffrow = buffrow + 1 end
end
local invert, af, as
if unit.config.debuffs == "top" then
invert = 1
local invert_h, invert_v, af
if unit.config.debuffs == "TOPLEFT" then
invert_h = 1
invert_v = 1
af = "BOTTOMLEFT"
as = "TOPLEFT"
elseif unit.config.debuffs == "bottom" then
invert = -1
elseif unit.config.debuffs == "BOTTOMLEFT" then
invert_h = -1
invert_v = 1
af = "TOPLEFT"
as = "BOTTOMLEFT"
elseif unit.config.debuffs == "TOPRIGHT" then
invert_h = 1
invert_v = -1
af = "BOTTOMRIGHT"
elseif unit.config.debuffs == "BOTTOMRIGHT" then
invert_h = -1
invert_v = -1
af = "TOPRIGHT"
end
unit.debuffs[i]:SetPoint(af, unit, as,
(i-1-(row)*perrow)*((2*default_border) + unit.config.debuffsize + 1),
invert * (row+buffrow)*((2*default_border) + unit.config.debuffsize + 1) + invert*(2*default_border + 1))
unit.debuffs[i]:SetPoint(af, unit, unit.config.debuffs,
invert_v * (i-1-row*perrow)*(2*default_border + unit.config.debuffsize + 1),
invert_h * ((row+buffrow)*(2*default_border + unit.config.debuffsize + 1) + (2*default_border + 1)))
local texture, stacks, dtype
if unit.label == "player" then
+4 -2
View File
@@ -602,8 +602,10 @@ pfUI:RegisterModule("gui", function ()
}
pfUI.gui.dropdowns.uf_buff_position = {
"top:" .. T["Top"],
"bottom:" .. T["Bottom"],
"TOPLEFT:" .. T["Top Left"],
"TOPRIGHT:" .. T["Top Right"],
"BOTTOMLEFT:" .. T["Bottom Left"],
"BOTTOMRIGHT:" .. T["Bottom Right"],
"off:" .. T["Disabled"]
}
+1 -1
View File
@@ -2,7 +2,7 @@
## Title: |cff33ffccpf|cffffffffUI
## Author: Shagu
## Notes: A complete user interface replacement.
## Version: 3.17
## Version: 3.18
## SavedVariables: pfUI_profiles, pfUI_addon_profiles, pfUI_cache
## SavedVariablesPerCharacter: pfUI_config, pfUI_init, pfUI_playerDB