Rarity

Rarity

17M Downloads

Disabling Blizzard's Floating Combat Text breaks Rarity

thematrixincendies opened this issue ยท 2 comments

commented

Might be a LibSink issue, but having blizzards floating combat text disabled currently breaks the addon for me.
Hovering over the minimap button causes Rarity to try to call a function from Blizzard's combat text, which is not available once it is disabled causing Rarity to not show the tooltip.
I use XCT+ and have set enableFloatingCombatText (CVar) to 0. The problem is, that even if I set the output channel to Default, XCT or anything else than Blizzards Combat Text, the issue remains.
I had the same issue with Kaliel's Tracker (quest tracker addon), but it can be fixed there by setting the output channel to XCT.
Will post the LUA error.

35x ...eBlizzard_CombatText/Blizzard_CombatText.lua:448: attempt to compare two nil values
[string "@Blizzard_CombatText/Blizzard_CombatText.lua"]:448: in function <...eBlizzard_CombatText/Blizzard_CombatText.lua:429>
[string "=[C]"]: in function `CombatText_AddMessage'
[string "@Rarity/Core/GUI/MainWindow.lua"]:1163: in function `AddItem'
[string "@Rarity/Core/GUI/MainWindow.lua"]:1307: in function <Rarity/Core/GUI/MainWindow.lua:817>
[string "@Rarity/Core/GUI/MainWindow.lua"]:1544: in function `ShowTooltip'
[string "@Rarity/Core/GUI/DataBrokerDisplay.lua"]:45: in function `ShowDelayedTooltip'
[string "@Rarity/Core/GUI/DataBrokerDisplay.lua"]:34: in function <Rarity/Core/GUI/DataBrokerDisplay.lua:33>

Locals:
message = "A world event is currently available for |cffa335ee|Hitem:174842::::::::70:62:::::::::|h[Slightly Damp Pile of Fur]|h|r! Go get it!"
scrollFunction = <function> defined @Blizzard_CombatText/Blizzard_CombatText.lua:644
r = 1
g = 1
b = 1
displayType = true
isStaggered = false
string = CombatText1 {
 scrollTime = 0
 scrollFunction = <function> defined @Blizzard_CombatText/Blizzard_CombatText.lua:644
 0 = <userdata>
}
noStringsAvailable = nil
yDir = nil
lowestMessage = nil
useXadjustment = 0
(*temporary) = nil
(*temporary) = nil
(*temporary) = 1
(*temporary) = <userdata>
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = "attempt to compare two nil values"

edit: I just diff'ed the LibSink files of Kalil's Tracker and Rarity, and they are identical. Commenting out these lines:

										if tostring(SHOW_COMBAT_TEXT) ~= "0" then
											--if type(CombatText_AddMessage) == "nil" then
											--	UIParentLoadAddOn("Blizzard_CombatText")
											--	CombatText_AddMessage(text, CombatText_StandardScroll, 1, 1, 1, true, false)
											--end											
										else
											UIErrorsFrame:AddMessage(text, 1, 1, 1, 1.0)
										end

(MainWindow.lua:1159) fixes the exception. Though probably the output isn't working for me now.

commented

A brief investigation yielded the following result:

I'd assume replacing that one line resolves the problem. Maybe you could test the change locally and let me know if it works?

commented

Replaced

-										if tostring(SHOW_COMBAT_TEXT) ~= "0" then
+										if CVarCallbackRegistry:GetCVarValueBool("enableFloatingCombatText")  then
											if type(CombatText_AddMessage) == "nil" then
												UIParentLoadAddOn("Blizzard_CombatText")												
											end
											CombatText_AddMessage(text, CombatText_StandardScroll, 1, 1, 1, true, false)											
										else
											UIErrorsFrame:AddMessage(text, 1, 1, 1, 1.0)
										end

does indeed seem to work. No lua errors and I am also getting output in XCT now.