Dicebar / Raven

Raven add-on for World of Warcraft
9 stars 3 forks source link

Cata Classic - SetTextColor error #73

Closed theoriginalmre closed 4 months ago

theoriginalmre commented 4 months ago

Are you able to fix this weird error for me? Whenever I get a debuff (eg bandage myself to get the "Recently Bandaged" debuff), Raven breaks and gives me this error.


1x bad argument #2 to '?' (Usage: self:SetTextColor(color [, a])) [string "=[C]"]: in function SetTextColor' [string "@Raven/Nest.lua"]:1777: in function <Raven/Nest.lua:1550> [string "@Raven/Nest.lua"]:2760: in functionNest_Update' [string "@Raven/Main.lua"]:1288: in function `Update' [string "@Raven/Main.lua"]:953: in function <Raven/Main.lua:949>

Locals: (*temporary) = "bad argument #2 to '?' (Usage: self:SetTextColor(color [, a]))"

I've had this for months and months, and get around it by deleting line 1777 in Nest.lua, which fixes everything, but I don't know why it happens in the first place.

Dicebar commented 4 months ago

That's usually caused by a corrupted profile. If you can upload yours I could see if I can correct the problem.

Dicebar commented 4 months ago

Just to be clear, your profile is the Raven.lua file located in: ...\World of Warcraft\_classic_\WTF\Account\YOUR_ACCOUNT_NAME_HERE\SavedVariables

Dicebar commented 4 months ago

Sure, can do!

Some background info... Colors are defined with 4 keys argb; alpha (or transparency), red, green and blue. The error you're seeing is caused by colors missing one or more keys.

What you'll want to do is search through the file for "iconColor" and "labelColor", and for any entry missing a key, add the key with a value of 1.

So, as an example. The following:

["iconColor"] = {
    ["g"] = 0.945098039215686,
    ["r"] = 0.949019607843137,
},

Would become:

["iconColor"] = {
    ["a"] = 1,
    ["b"] = 1,
    ["g"] = 0.945098039215686,
    ["r"] = 0.949019607843137,
},

The order of keys doesn't matter, just that the entries are there.

theoriginalmre commented 4 months ago

Thanks! This may take a while lol. I may go thru the profiles in game first and delete all the old crap im not using.

Dicebar commented 4 months ago

That could speed things up 👌

The amount of problems should be limited as long as you kept your addons up-to-date. The corrupt data was caused by a bug in a dependency during the launch of Dragonflight, and to my knowledge wasn't active very long.