Skip to content

Commit

Permalink
Only show Celebrate chore if character doesn't have the aura (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
madcowfred committed Oct 24, 2024
1 parent 110c907 commit a49fb2f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
4 changes: 4 additions & 0 deletions Data/Chores/Events/Anniversary.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ local L = Addon.L

local anniversaryIds = { 590, 1500, 1501, 1509, 1587, 1588, 1589, 1590, 1592, 1593, 1594, 1595 }

local CUA_GetPlayerAuraBySpellID = C_UnitAuras.GetPlayerAuraBySpellID

Addon.data.chores.choresAnniversary = {
key = 'anniversary',
Expand All @@ -29,6 +30,9 @@ Addon.data.chores.choresAnniversary = {
entries = {
{ quest = 84616 }, -- Celebrate Good Fun!
},
filter = function()
return CUA_GetPlayerAuraBySpellID(455050) == nil
end,
},
{
key = 'meetGreet',
Expand Down
19 changes: 13 additions & 6 deletions Modules/Display.lua
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,9 @@ function Module:ConfigChanged()
}

for _, catData in ipairs(sectionData.categories) do
if catData.skillLineId == nil or Addon.db.char.skillLines[catData.skillLineId] ~= nil then
if catData.skillLineId == nil or
Addon.db.char.skillLines[catData.skillLineId] ~= nil
then
-- Show an info message about missing skill level
if Addon.db.char.skillLines[catData.skillLineId] == -1 then
table.insert(section.chores, {
Expand All @@ -284,15 +286,20 @@ function Module:ConfigChanged()
for _, typeKey in ipairs({ 'dungeons', 'quests', 'drops' }) do
for _, choreData in ipairs(catData[typeKey] or {}) do
local choreEnabled = Addon.db.profile.chores[sectionKey][catData.key][typeKey][choreData.key]
if choreEnabled == true and
(
if choreEnabled == true
and (
choreData.requiredEventIds == nil or
self:AnyActive(self.activeEvents, choreData.requiredEventIds)
) and
(
)
and (
choreData.skill == nil or
Addon.db.char.skillLines[catData.skillLineId] >= choreData.skill
) and self:PlayerLevelOk(choreData, playerLevel)
)
and (
choreData.filter == nil or
choreData.filter() == true
)
and self:PlayerLevelOk(choreData, playerLevel)
then
section.total = section.total + 1
table.insert(section.chores, {
Expand Down

0 comments on commit a49fb2f

Please sign in to comment.