diff --git a/PerfectRaid_Buffs.lua b/PerfectRaid_Buffs.lua
index 906d194..e1fc568 100644
--- a/PerfectRaid_Buffs.lua
+++ b/PerfectRaid_Buffs.lua
@@ -30,6 +30,7 @@
---------------------------------------------------------------------------]]
local Buffs = PerfectRaid:NewModule("PerfectRaid-Buffs")
+local L = PerfectRaidLocals
local utils = DongleStub("DongleUtils")
local frames
@@ -37,6 +38,7 @@ function Buffs:Initialize()
PerfectRaid.defaults.profile.buffs = {}
frames = PerfectRaid.frames
+ self:RegisterEvent("DONGLE_PROFILE_CREATED")
end
function Buffs:Enable()
@@ -48,6 +50,16 @@ function Buffs:Enable()
end
end
+function Buffs:DONGLE_PROFILE_CREATED(event, db, addon, svname, profileKey)
+ self:PrintF(L["Adding defaults to new profile \"%s\""], profileKey)
+ local buffs = db.profile.buffs
+ for k,v in ipairs(self.defaults) do
+ if not v.disabled then
+ self:AddDefaultBuff(buffs, v)
+ end
+ end
+end
+
function Buffs:ConfigureButton(button)
local font = button:CreateFontString(nil, "ARTWORK", "GameFontHighlightSmall")
font:SetPoint("LEFT", button.rightbox, "LEFT", 3, 0)
@@ -435,15 +447,14 @@ function Buffs:EditEntry()
local scrollframe = PROptions_BuffsScrollFrame
local offset = FauxScrollFrame_GetOffset(scrollframe)
local selected = PROptions_Buffs.selected
- local idx = offset + selected
- local entry = PerfectRaid.db.profile.buffs[idx]
+ local entry = PerfectRaid.db.profile.buffs[selected]
local options = PROptions_Buffs_Edit
options.editEntry = entry
options:Show()
options.buffname:SetText(entry.buffname)
- options.groupname:SetText(entry.groupname)
+ options.groupname:SetText(entry.groupname or "")
options.disptext:SetText(entry.disptext)
options.disptext:SetTextColor(utils.HexToRGBPerc(entry.color))
PRColorSelect.normalTexture:SetVertexColor(utils.HexToRGBPerc(entry.color))
@@ -454,7 +465,9 @@ function Buffs:EditEntry()
end
for idx,button in ipairs(PROptions_Buffs_Edit.checks) do
if cond[button.value] then
- button:SetChecked()
+ button:SetChecked(true)
+ else
+ button:SetChecked(false)
end
end
@@ -590,6 +603,7 @@ Buffs.conditions = {
["Caster"] = function(u,c) return c == "MAGE" or c == "WARLOCK" or c == "SHAMAN" or c == "DRUID" end,
["Melee"] = function(u,c) return c == "WARRIOR" or c == "ROGUE" end,
["Healer"] = function(u,c) return c == "PRIEST" or c == "SHAMAN" or c == "DRUID" or c == "PALADIN" end,
+ ["NonTank"] = function(u,c) return c ~= "WARRIOR" end,
}
local work = {}
@@ -609,4 +623,195 @@ StaticPopupDialogs["PR_BUFF_SAVE_ERROR"] = {
end,
timeout = 0,
hideOnEscape = 1
-}
\ No newline at end of file
+}
+
+function Buffs:AddDefaultBuff(profile, entry)
+ local tbl = {}
+ for k,v in pairs(entry) do tbl[k] = v end
+ tbl.disabled = nil
+ table.insert(profile, tbl)
+end
+
+
+local class = select(2, UnitClass("player"))
+local race = select(2, UnitRace("player"))
+
+Buffs.defaults = {
+ {
+ conds = "All",
+ buffname = L["Power Word: Fortitude"],
+ groupname = L["Prayer of Fortitude"],
+ disptext = L["STATUS_FORT"],
+ color = "FFFFFF",
+ missing = true,
+ disabled = (class ~= "PRIEST"),
+ },
+ {
+ conds = "All",
+ buffname = L["Power Word: Shield"],
+ disptext = L["STATUS_PWS"],
+ color = "FFD800",
+ disabled = (class ~= "PRIEST"),
+ },
+ {
+ conds = "All",
+ buffname = L["Weakened Soul"],
+ disptext = L["STATUS_WEAKENEDSOUL"],
+ color = "FF5500",
+ disabled = (class ~= "PRIEST"),
+ },
+ {
+ conds = "All",
+ buffname = L["Renew"],
+ disptext = L["STATUS_RENEW"],
+ color = "00FF10",
+ disabled = (class ~= "PRIEST"),
+ },
+ {
+ conds = "All",
+ buffname = L["Shadow Protection"],
+ groupname = L["Prayer of Shadow Protection"],
+ disptext = L["STATUS_SHADOWPROT"],
+ missing = true,
+ color = "9900FF",
+ disabled = (class ~= "PRIEST"),
+ },
+ {
+ conds = "All",
+ buffname = L["Divine Spirit"],
+ groupname = L["Prayer Spirit"],
+ disptext = L["STATUS_DIVINESPIRIT"],
+ missing = true,
+ color = "9900FF",
+ disabled = (class ~= "PRIEST"),
+ },
+ {
+ conds = "All",
+ buffname = L["Power Infusion"],
+ disptext = L["STATUS_POWERINFUSION"],
+ color = "00FF33",
+ },
+ {
+ conds = "All",
+ buffname = L["Fear Ward"],
+ disptext = L["STATUS_FEARWARD"],
+ color = "9900FF",
+ disabled = (class ~= "PRIEST" and race == "Dwarf"),
+ },
+ -- Druid specific spells
+ {
+ conds = "All",
+ buffname = L["Mark of the Wild"],
+ groupname = L["Gift of the Wild"],
+ disptext = L["STATUS_MOTW"],
+ color = "BC64AA",
+ missing = true,
+ disabled = (class ~= "DRUID"),
+ },
+ {
+ conds = "All",
+ buffname = L["Rejuvenation"],
+ disptext = L["STATUS_REJUV"],
+ color = "bc64aa",
+ disabled = (class ~= "DRUID"),
+ },
+ {
+ conds = "All",
+ buffname = L["Regrowth"],
+ disptext = L["STATUS_REGROWTH"],
+ color = "00FF10",
+ disabled = (class ~= "DRUID"),
+ },
+ {
+ conds = "All",
+ buffname = L["Thorns"],
+ disptext = L["STATUS_THORNS"],
+ color = "aa6644",
+ disabled = (class ~= "DRUID"),
+ },
+ {
+ conds = "Mana",
+ buffname = L["Innervate"],
+ disptext = L["STATUS_INNERVATE"],
+ color = "00FF33",
+ },
+ -- Paladin Buffs
+ {
+ conds = "Melee",
+ buffname = L["Blessing of Might"],
+ groupname = L["Greater Blessing of Might"],
+ disptext = L["STATUS_BLESSINGMIGHT"],
+ color = "F48CBA",
+ missing = true,
+ disabled = (class ~= "PALADIN"),
+ },
+ {
+ conds = "Mana",
+ buffname = L["Blessing of Wisdom"],
+ groupname = L["Greater Blessing of Wisdom"],
+ disptext = L["STATUS_BLESSINGWISDOM"],
+ color = "F48CBA",
+ missing = true,
+ disabled = (class ~= "PALADIN"),
+ },
+ {
+ conds = "NonTank",
+ buffname = L["Blessing of Salvation"],
+ groupname = L["Greater Blessing of Salvation"],
+ disptext = L["STATUS_BLESSINGSALVATION"],
+ color = "F48CBA",
+ missing = true,
+ disabled = (class ~= "PALADIN"),
+ },
+ {
+ conds = "All",
+ buffname = L["Blessing of Light"],
+ groupname = L["Greater Blessing of Light"],
+ disptext = L["STATUS_BLESSINGLIGHT"],
+ color = "F48CBA",
+ missing = true,
+ disabled = (class ~= "PALADIN"),
+ },
+ {
+ conds = "All",
+ buffname = L["Blessing of Sanctuary"],
+ groupname = L["Greater Blessing of Sanctuary"],
+ disptext = L["STATUS_BLESSINGSANCTUARY"],
+ color = "F48CBA",
+ missing = true,
+ disabled = (class ~= "PALADIN"),
+ },
+ {
+ conds = "All",
+ buffname = L["Blessing of Kings"],
+ groupname = L["Greater Blessing of Kings"],
+ disptext = L["STATUS_BLESSINGKINGS"],
+ color = "F48CBA",
+ missing = true,
+ disabled = (class ~= "PALADIN"),
+ },
+ -- Mage Buffs
+ {
+ conds = "Mana",
+ buffname = L["Arcane Intellect"],
+ groupname = L["Arcane Brilliance"],
+ disptext = L["STATUS_ARCANEINT"],
+ color = "3399FF",
+ missing = true,
+ disabled = (class ~= "MAGE"),
+ },
+ -- Warlock Buffs
+ {
+ conds = "All",
+ buffname = L["Soulstone"],
+ disptext = L["STATUS_SOULSTONE"],
+ color = "CA21FF",
+ },
+ -- Misc Debuffs
+ {
+ conds = "All",
+ buffname = L["Mortal Strike"],
+ disptext = L["STATUS_MORTALSTRIKE"],
+ color = "FF1111",
+ },
+}