diff --git a/api/config.lua b/api/config.lua index df78547a..429db250 100644 --- a/api/config.lua +++ b/api/config.lua @@ -203,7 +203,6 @@ function pfUI:LoadConfig() pfUI:UpdateConfig("unitframes", nil, "show_procs", "0") pfUI:UpdateConfig("unitframes", nil, "show_totems", "0") pfUI:UpdateConfig("unitframes", nil, "all_procs", "0") - pfUI:UpdateConfig("unitframes", nil, "debuffs_class", "0") pfUI:UpdateConfig("unitframes", nil, "indicator_time", "1") pfUI:UpdateConfig("unitframes", nil, "indicator_stacks", "1") pfUI:UpdateConfig("unitframes", nil, "indicator_size", "10") @@ -387,6 +386,7 @@ function pfUI:LoadConfig() pfUI:UpdateConfig("unitframes", unit, "debuff_indicator", "0") pfUI:UpdateConfig("unitframes", unit, "debuff_ind_pos", "CENTER") pfUI:UpdateConfig("unitframes", unit, "debuff_ind_size", ".65") + pfUI:UpdateConfig("unitframes", unit, "debuff_ind_class", "1") pfUI:UpdateConfig("unitframes", unit, "clickcast", "0") pfUI:UpdateConfig("unitframes", unit, "faderange", "0") pfUI:UpdateConfig("unitframes", unit, "alpha_visible", "1") @@ -1023,5 +1023,14 @@ function pfUI:MigrateConfig() pfUI_config.panel.xp.showalways = nil end + -- migrate dispell indicators into seperate options (> 4.6.1) + if checkversion(4, 6, 1) and pfUI_config.unitframes.debuffs_class then + local unitframes = { "player", "target", "focus", "group", "grouptarget", "grouppet", "raid", "ttarget", "pet", "ptarget", "fallback", "tttarget" } + for _, unitframe in pairs(unitframes) do + pfUI_config.unitframes[unitframe].debuff_ind_class = pfUI_config.unitframes.debuffs_class + end + pfUI_config.unitframes.debuffs_class = nil + end + pfUI_config.version = pfUI.version.string end diff --git a/api/unitframes.lua b/api/unitframes.lua index f50ae781..fdf7a071 100644 --- a/api/unitframes.lua +++ b/api/unitframes.lua @@ -1306,8 +1306,9 @@ function pfUI.uf:RefreshUnit(unit, component) -- indicators if component == "all" or component == "aura" then - pfUI.uf:SetupDebuffFilter() - if table.getn(pfUI.uf.debuffs) > 0 and unit.config.debuff_indicator ~= "0" then + unit.dispellable = unit.dispellable or pfUI.uf:SetupDebuffFilter((unit.config.debuff_ind_class == "0" and true or nil)) + + if table.getn(unit.dispellable) > 0 and unit.config.debuff_indicator ~= "0" then unit.hp.bar.debuffindicators = unit.hp.bar.debuffindicators or CreateFrame("Frame", nil, unit.hp.bar) -- 0 = OFF, 1 = Legacy, 2 = Glow, 3 = Square, 4 = Icons @@ -1339,7 +1340,7 @@ function pfUI.uf:RefreshUnit(unit, component) end end - for _, debuff in pairs(pfUI.uf.debuffs) do + for _, debuff in pairs(unit.dispellable) do indicator[debuff] = indicator[debuff] or CreateFrame("Frame", nil, indicator) indicator[debuff]:SetParent(indicator) indicator[debuff].tex = indicator[debuff].tex or indicator[debuff]:CreateTexture(nil) @@ -1750,26 +1751,27 @@ function pfUI.uf:HideIcon(frame, pos) end end -function pfUI.uf:SetupDebuffFilter() - if pfUI.uf.debuffs then return end - +function pfUI.uf:SetupDebuffFilter(allclasses) local _, myclass = UnitClass("player") - pfUI.uf.debuffs = {} - if myclass == "PALADIN" or myclass == "PRIEST" or myclass == "WARLOCK" or pfUI_config.unitframes.debuffs_class == "0" then - table.insert(pfUI.uf.debuffs, "Magic") + local debuffs = {} + + if myclass == "PALADIN" or myclass == "PRIEST" or myclass == "WARLOCK" or allclasses then + table.insert(debuffs, "Magic") end - if myclass == "DRUID" or myclass == "PALADIN" or myclass == "SHAMAN" or pfUI_config.unitframes.debuffs_class == "0" then - table.insert(pfUI.uf.debuffs, "Poison") + if myclass == "DRUID" or myclass == "PALADIN" or myclass == "SHAMAN" or allclasses then + table.insert(debuffs, "Poison") end - if myclass == "PRIEST" or myclass == "PALADIN" or myclass == "SHAMAN" or pfUI_config.unitframes.debuffs_class == "0" then - table.insert(pfUI.uf.debuffs, "Disease") + if myclass == "PRIEST" or myclass == "PALADIN" or myclass == "SHAMAN" or allclasses then + table.insert(debuffs, "Disease") end - if myclass == "DRUID" or myclass == "MAGE" or pfUI_config.unitframes.debuffs_class == "0" then - table.insert(pfUI.uf.debuffs, "Curse") + if myclass == "DRUID" or myclass == "MAGE" or allclasses then + table.insert(debuffs, "Curse") end + + return debuffs end function pfUI.uf:SetupBuffFilter() diff --git a/modules/gui.lua b/modules/gui.lua index bb9b2cd7..f85eb998 100644 --- a/modules/gui.lua +++ b/modules/gui.lua @@ -1502,7 +1502,6 @@ pfUI:RegisterModule("gui", "vanilla:tbc", function () CreateConfig(nil, T["Buff Indicator Show Time"], C.unitframes, "indicator_time", "checkbox") CreateConfig(nil, T["Buff Indicator Show Stacks"], C.unitframes, "indicator_stacks", "checkbox") CreateConfig(nil, T["Buff Indicator Size"], C.unitframes, "indicator_size") - CreateConfig(nil, T["Only Show Indicators for Dispellable Debuffs"], C.unitframes, "debuffs_class", "checkbox") CreateConfig(U[c], T["Colors"], nil, nil, "header") CreateConfig(nil, T["Enable Pastel Colors"], C.unitframes, "pastel", "checkbox") @@ -1645,6 +1644,7 @@ pfUI:RegisterModule("gui", "vanilla:tbc", function () CreateConfig(U[c], T["Debuff Indicator Display"], C.unitframes[c], "debuff_indicator", "dropdown", pfUI.gui.dropdowns.uf_debuff_indicator) CreateConfig(U[c], T["Debuff Indicator Position"], C.unitframes[c], "debuff_ind_pos", "dropdown", pfUI.gui.dropdowns.positions) CreateConfig(U[c], T["Debuff Indicator Size"], C.unitframes[c], "debuff_ind_size", "dropdown", pfUI.gui.dropdowns.uf_debuff_indicator_size) + CreateConfig(nil, T["Only Class Dispellable Debuffs"], C.unitframes[c], "debuff_ind_class", "checkbox") CreateConfig(U[c], T["Buffs"], nil, nil, "header") CreateConfig(U[c], T["Buff Position"], C.unitframes[c], "buffs", "dropdown", pfUI.gui.dropdowns.uf_buff_position)