Thread: eCastingBar
View Single Post
05-06-18, 01:43 PM   #6
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Based on my reading of the Blizzard change thread, the spell name value was removed along with the spell rank. Without seeing the rest of the code (and I'm too lazy to go hunt the addon down and download it) I would guess something like this should work:

Old:

Code:
if( newevent == "UNIT_SPELLCAST_START" ) then
		local spellName, spellRank, displayName, texture, startTime, endTime, isTradeSkill, castID, notInterruptible = UnitCastingInfo(unit)
The parts in red are no longer valid in WoW 8.x and need to be removed.

New, best option:

Code:
if( newevent == "UNIT_SPELLCAST_START" ) then
		local displayName, texture, startTime, endTime, isTradeSkill, castID, notInterruptible = UnitCastingInfo(unit)
		local spellName, spellRank = displayName, ""
The parts in green are added. This just sets the "spellName" variable to copy the "displayName" value that (as far as I know) is still present. There are some spells where the text displayed on the default castbar isn't the actual name of the spell, like various opening and gathering actions; the "displayName" value is the text to be displayed. If you want to see the actual spell name, then try this instead:

New, second option:

Code:
if( newevent == "UNIT_SPELLCAST_START" ) then
		local displayName, texture, startTime, endTime, isTradeSkill, castID, notInterruptible, spellID = UnitCastingInfo(unit)
		local spellName, spellRank = GetSpellInfo(spellID), ""
Again, the parts in green are added. UnitCastingInfo has returned a "spellID" value for quite a while now, so that isn't a new change for BFA, but we need to store it in order to use it on the next line, where we call the GetSpellInfo function to get the real name of the spell, and also set the "spellRank" value to an empty string just in case the addon is expecting it to exist.

Whichever solution you use, you'll need to apply the same solution everywhere that UnitCastingInfo or UnitChannelInfo is called.

Also, it might be obvious, but I'll say it anyway: these changes are not compatible with current live realms, so don't try to use the same version of the addon in both places.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote