WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   AddOn Help/Support (https://www.wowinterface.com/forums/forumdisplay.php?f=3)
-   -   rUF error in 10.2-- help updating? (https://www.wowinterface.com/forums/showthread.php?t=59733)

Kaleesh 12-13-23 07:20 PM

rUF error in 10.2-- help updating?
 
Hey guys. I'm having a minor(?) issue with a rUF, which seems abandoned. After 10.2 it can't display Lunar Power and has a fit every time I change druid forms. Could be related to the power bar updates, idk. I'm trying to learn a little about how to update these things myself but I'm not sure where to start. I've looked at the API changes and suspect C_Console.GetColorFromType is the culprit, but am not sure how to follow that up in the actual addon. Probably barking up the wrong tree. Could anyone look at this and give me a hand on the process?


Errors:
https://pastebin.com/eEuGsSHw
https://pastebin.com/Ur4NVV3k
https://pastebin.com/pg3BffiS

Fizzlemizz 12-13-23 08:17 PM

Blizzard added a spark entry for the PowerBarColor.Stagger entry that doesn't have r, g, b entries.

You could try changing line 145 of RuF\Libs\oUF\colors.lua from:
Lua Code:
  1. colors.power[power][index] = oUF:CreateColor(color_.r, color_.g, color_.b)
too:
Lua Code:
  1. colors.power[power][index] = oUF:CreateColor(color_.r or 1, color_.g or 1, color_.b or 1)
Hopefully it doesn't do anything funny elsewhere.

They also changed the color keys for stagger from numbers to strings ("green", "yellow", "red", [and the new "spark"]) so that may also be problematic but the addon is a bit on the large side to just wander through on the off-chance.

Kaleesh 12-13-23 11:18 PM

Oh wonderful, that worked perfectly, thank you!

Is there anywhere I could have gone to find out about this change for myself?

Fizzlemizz 12-13-23 11:54 PM

I just followed the stack trace in the colors.lua error back to line 145 (saying that something had been set to nil that should have (and in previous version of the game did have) a value.

The beginning of the loop that contains line 145
Lua Code:
  1. for power, color in next, PowerBarColor do
which is cycling through the PowerBarColor table which is a Blizzard table so I compared the current version with one from a 10.1 patch.

The current STAGGER table entry is
Lua Code:
  1. PowerBarColor["STAGGER"] = {
  2.     green =     { r = 0.52, g = 1.0, b = 0.52, atlas = "Unit_Monk_Stagger_Fill_Green" },
  3.     yellow =    { r = 1.0, g = 0.98, b = 0.72, atlas = "Unit_Monk_Stagger_Fill_Yellow" },
  4.     red =       { r = 1.0, g = 0.42, b = 0.42, atlas = "Unit_Monk_Stagger_Fill_Red" },
  5.     spark =     { atlas = "Unit_Monk_Stagger_EndCap", barHeight = 10, xOffset = 1, showAtMax = true }
  6. };
The one from 10.1 is
Lua Code:
  1. PowerBarColor["STAGGER"] = {
  2.     {r = 0.52, g = 1.0, b = 0.52},
  3.     {r = 1.0, g = 0.98, b = 0.72},
  4.     {r = 1.0, g = 0.42, b = 0.42},
  5. };
The original line 145 was making a colour mixin from the r, g, b values which don't exist in the table of the new "spark" key.

The fix just sets a default colour of white if the r, g, b entries don't exist...simples :D

Xrystal 12-14-23 04:59 AM

Quote:

Originally Posted by Kaleesh (Post 343012)
Oh wonderful, that worked perfectly, thank you!

Is there anywhere I could have gone to find out about this change for myself?

And a link to blizzard code to look at this stuff yourself ( without downloading it yourself from within the game ) is as follows: https://github.com/Gethe/wow-ui-source


All times are GMT -6. The time now is 02:34 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI