Problem with adding custom rares
Bombademar opened this issue ยท 1 comments
Hey, I used to add custom rares to the addon as described in #733 and #415
With the newest version, the Progress.lua seems to have changed completely so that way of doing it no longer works.
When I try to use the older version, the Rares no longer get a checkmark when I have already killed them that day.
Can I still use the old code and do I just have to put it in a different place with the newest version?
Or does it no longer work at all? If it doesn't work, can I still use the old version with the old code, but with a minor change to get the checkmark back?
Here is the code I used to run (in Progress.lua)
local function RareMobUpdate(index)
SI.db.Toons[SI.thisToon].Progress[index] = wipe(SI.db.Toons[SI.thisToon].Progress[index] or {})
local data = {
unlocked = true,
isComplete = C_QuestLog.IsQuestFlaggedCompleted(Module.TrackedQuest[index].quest),
}
SI.db.Toons[SI.thisToon].Progress[index] = data
end
local function RareMobShow(toon, index)
local t = SI.db.Toons[toon]
if not t or not t.Progress or not t.Progress[index] then return end
local data = t.Progress[index]
local text
if data.isComplete then
text = "\124T" .. READY_CHECK_READY_TEXTURE .. ":0|t"
else
text = ""
end
return text
end
local function RareMobReset(toon, index)
local t = SI.db.Toons[toon]
if not t or not t.Progress or not t.Progress[index] then return end
local prev = t.Progress[index]
t.Progress[index] = {
unlocked = prev.unlocked,
isComplete = false,
}
end
Module.TrackedQuest = {
-- Rares
{
name = "Karokta",
quest = 75333,
daily = true,
func = RareMobUpdate,
showFunc = RareMobShow,
resetFunc = RareMobReset,
},
Thanks for the help! :)