Skip to content

Commit

Permalink
raid: add more buffs and an option for procs
Browse files Browse the repository at this point in the history
  • Loading branch information
shagu committed Nov 24, 2016
1 parent 9fb1604 commit b96c9ff
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 22 deletions.
1 change: 1 addition & 0 deletions modules/config.lua
Expand Up @@ -47,6 +47,7 @@ function pfUI:LoadConfig()
pfUI:UpdateConfig("unitframes", "raid", "clickcast_ctrl", "")
pfUI:UpdateConfig("unitframes", "raid", "buffs_buffs", "0")
pfUI:UpdateConfig("unitframes", "raid", "buffs_hots", "0")
pfUI:UpdateConfig("unitframes", "raid", "buffs_procs", "0")
pfUI:UpdateConfig("unitframes", "raid", "buffs_classonly", "0")
pfUI:UpdateConfig("bars", nil, "icon_size", "18")
pfUI:UpdateConfig("panel", "left", "left", "guild")
Expand Down
1 change: 1 addition & 0 deletions modules/gui.lua
Expand Up @@ -658,6 +658,7 @@ pfUI:RegisterModule("gui", function ()
pfUI.gui:CreateConfig(pfUI.gui.uf, "Click-cast on Raidframe (Ctrl)", pfUI_config.unitframes.raid, "clickcast_ctrl")
pfUI.gui:CreateConfig(pfUI.gui.uf, "Show Buffs on Raidframes", pfUI_config.unitframes.raid, "buffs_buffs", "checkbox")
pfUI.gui:CreateConfig(pfUI.gui.uf, "Show Hots on Raidframes", pfUI_config.unitframes.raid, "buffs_hots", "checkbox")
pfUI.gui:CreateConfig(pfUI.gui.uf, "Show Procs on Raidframes", pfUI_config.unitframes.raid, "buffs_procs", "checkbox")
pfUI.gui:CreateConfig(pfUI.gui.uf, "Only display Hots of my class", pfUI_config.unitframes.raid, "buffs_classonly", "checkbox")

-- actionbar
Expand Down
85 changes: 63 additions & 22 deletions modules/raid.lua
Expand Up @@ -32,6 +32,7 @@ pfUI:RegisterModule("raid", function ()
end
end
frame.icon[pos].tex:SetTexture(icon)
pfUI.utils:CreateBackdrop(frame.icon[pos], nil, true)
frame.icon[pos]:Show()
end

Expand All @@ -54,37 +55,75 @@ pfUI:RegisterModule("raid", function ()
-- [[ DRUID ]]
if myclass == "DRUID" and pfUI_config.unitframes.raid.buffs_buffs == "1" then
-- Gift of the Wild
table.insert(pfUI.uf.raid.buffs, "Interface\\Icons\\Spell_Nature_Regeneration")
table.insert(pfUI.uf.raid.buffs, "interface\\icons\\spell_nature_regeneration")

-- Thorns
table.insert(pfUI.uf.raid.buffs, "Interface\\Icons\\Spell_Nature_Thorns")
table.insert(pfUI.uf.raid.buffs, "interface\\icons\\spell_nature_thorns")
end

if (pfUI_config.unitframes.raid.buffs_classonly ~= "1" or myclass == "DRUID") and pfUI_config.unitframes.raid.buffs_hots == "1" then
-- Regrowth
table.insert(pfUI.uf.raid.buffs, "Interface\\Icons\\Spell_Nature_ResistNature")
table.insert(pfUI.uf.raid.buffs, "interface\\icons\\spell_nature_resistnature")

-- Rejuvenation
table.insert(pfUI.uf.raid.buffs, "Interface\\Icons\\Spell_Nature_Rejuvenation")
table.insert(pfUI.uf.raid.buffs, "interface\\icons\\spell_nature_rejuvenation")
end


-- [[ PRIEST ]]
if myclass == "PRIEST" and pfUI_config.unitframes.raid.buffs_buffs == "1" then
-- Prayer Of Fortitude"
table.insert(pfUI.uf.raid.buffs, "Interface\\Icons\\Spell_Holy_WordFortitude")
table.insert(pfUI.uf.raid.buffs, "Interface\\Icons\\Spell_Holy_PrayerOfFortitude")
table.insert(pfUI.uf.raid.buffs, "interface\\icons\\spell_holy_wordfortitude")
table.insert(pfUI.uf.raid.buffs, "interface\\icons\\spell_holy_prayeroffortitude")

-- Prayer of Spirit
table.insert(pfUI.uf.raid.buffs, "Interface\\Icons\\Spell_DivineSpirit")
table.insert(pfUI.uf.raid.buffs, "Interface\\Icons\\Spell_Holy_PrayerofSpirit")
table.insert(pfUI.uf.raid.buffs, "interface\\icons\\spell_divinespirit")
table.insert(pfUI.uf.raid.buffs, "interface\\icons\\spell_holy_prayerofspirit")
end

if (pfUI_config.unitframes.raid.buffs_classonly ~= "1" or myclass == "PRIEST") and pfUI_config.unitframes.raid.buffs_hots == "1" then
-- Renew
table.insert(pfUI.uf.raid.buffs, "Interface\\Icons\\Spell_Holy_Renew")
table.insert(pfUI.uf.raid.buffs, "interface\\icons\\spell_holy_renew")
end

if (pfUI_config.unitframes.raid.buffs_classonly ~= "1" or myclass == "PRIEST") and pfUI_config.unitframes.raid.buffs_procs == "1" then
-- Inspiration
table.insert(pfUI.uf.raid.buffs, "interface\\icons\\inv_shield_06")
end


-- [[ PALADIN ]]
if myclass == "PALADIN" and pfUI_config.unitframes.raid.buffs_buffs == "1" then
-- Blessing of Salvation
table.insert(pfUI.uf.raid.buffs, "interface\\icons\\spell_holy_greaterblessingofsalvation")
table.insert(pfUI.uf.raid.buffs, "interface\\icons\\spell_holy_sealofsalvation")

-- Blessing of Wisdom
table.insert(pfUI.uf.raid.buffs, "interface\\icons\\spell_holy_sealofwisdom")
table.insert(pfUI.uf.raid.buffs, "interface\\icons\\spell_holy_greaterblessingofwisdom")

-- Blessing of Sanctuary
table.insert(pfUI.uf.raid.buffs, "interface\\icons\\spell_nature_lightningshield")
table.insert(pfUI.uf.raid.buffs, "interface\\icons\\spell_holy_greaterblessingofsanctuary")

-- Blessing of Kings
table.insert(pfUI.uf.raid.buffs, "interface\\icons\\spell_magic_magearmor")
table.insert(pfUI.uf.raid.buffs, "interface\\icons\\spell_magic_greaterblessingofkings")

-- Blessing of Might
table.insert(pfUI.uf.raid.buffs, "interface\\icons\\spell_holy_fistofjustice")
table.insert(pfUI.uf.raid.buffs, "interface\\icons\\spell_holy_greaterblessingofkings")
end


-- [[ SHAMAN ]]
if (pfUI_config.unitframes.raid.buffs_classonly ~= "1" or myclass == "SHAMAN") and pfUI_config.unitframes.raid.buffs_procs == "1" then
-- Ancestral Fortitude
table.insert(pfUI.uf.raid.buffs, "interface\\icons\\spell_nature_undyingstrength")

-- Healing Way
table.insert(pfUI.uf.raid.buffs, "interface\\icons\\spell_nature_healingway")
end
end


Expand All @@ -106,22 +145,24 @@ pfUI:RegisterModule("raid", function ()
for i=1,32 do
local texture = UnitBuff("raid" .. unit.id,i)

-- match filter
for _, filter in pairs(pfUI.uf.raid.buffs) do
if filter == texture then
table.insert(active, texture)
break
if texture then
-- match filter
for _, filter in pairs(pfUI.uf.raid.buffs) do
if filter == string.lower(texture) then
table.insert(active, texture)
break
end
end
end

-- add icons for every found buff
for pos, icon in pairs(active) do
pfUI.uf.raid:AddIcon(this, pos, icon)
end
-- add icons for every found buff
for pos, icon in pairs(active) do
pfUI.uf.raid:AddIcon(this, pos, icon)
end

-- hide unued icon slots
for pos=table.getn(active)+1, 6 do
pfUI.uf.raid:HideIcon(this, pos)
-- hide unued icon slots
for pos=table.getn(active)+1, 6 do
pfUI.uf.raid:HideIcon(this, pos)
end
end
end
end
Expand Down

0 comments on commit b96c9ff

Please sign in to comment.