TellMeWhen

TellMeWhen

24M Downloads

[CF 1266] Text notification set t o Raid warning (fake) not repsoecting font color - sets to black

tmw-issue-import opened this issue ยท 3 comments

commented

What steps will reproduce the problem? 1. Set text notification to raid warning (fake) 2. font oclor is ignored for typed in text (it will read black). Spell name reads fine

What do you expect to happen? What happens instead? Respect font string color and not be black

What version of TellMeWhen are you using? ("The latest" is not a version) 8.1.2-2-g0a19738

Do you have an error log of what happened? no but have image

Please provide any additional information below (including any export strings if applicable; see above.)

Setting a text notification set to raid warning (fake) would have the non dogtag text be black?

I have [Spell] on cooldown for [MaxDuration] for the spell mend pet and it reads out everything in black but the spell name

Anything else (picking errors frame, MSBT, Floating combat text) all respect the font color but fake raid warning looks like this:


Posted by CurseForge user transitbus | Imported from CurseForge issue #1266 | Raw

commented

Looks like you no longer need "bullshitTable" for arguement 3 in Components\EventHandlers\Announcements\Announcements.lua and RaidNotice_AddMessage

Around line 447 is the code block

You can add in the smae color output you have for other text settings and then reword the 3rd argument into a variable like so

remark out or remove

Text = "|c" .. eventSettings.TextColor .. Text .. "|r"

and add/change

local color = TMW:StringToCachedRGBATable(eventSettings.TextColor)

RaidNotice_AddMessage(RaidWarningFrame, Text, color, eventSettings.TextDuration)

Should then allow your to remove

local bullshitTable = {} at line 426

So then the whole section looks like this

Announcements:RegisterEventHandlerDataNonSpecific(71, "RAID_WARNING_FAKE", {
	text = L["RAID_WARNING_FAKE"],
	desc = L["RAID_WARNING_FAKE_DESC"],

	ConfigFrames = {
		"ShowIconTex",
		"Color",
		"TextDuration",
	},

	handler = function(icon, eventSettings, Text)
		local Location = eventSettings.Location

		if eventSettings.ShowIconTex then
			Text = "|T" .. (icon.attributes.texture or "") .. ":0|t " .. Text
		end

		-- GLOBALS: RaidWarningFrame, RaidNotice_AddMessage
		
		local color = TMW:StringToCachedRGBATable(eventSettings.TextColor)

		RaidNotice_AddMessage(RaidWarningFrame, Text, color, eventSettings.TextDuration)
		
	end,
})


Edited Aug 7, 2016

Posted by CurseForge user transitbus

commented

Unfortunately, Blizzard's code still manages colors incorrectly, so the solution has to be a bit different than what you provided.

To see the issue with your code, make two handlers - one with blue text, and the other with red. Then, test them in an alternating sequence. If there are already two messages in the frame, then when you display the red message, the previous blue message will turn red.

Changing the old color injection line to the following fixes the issue with colors after the link:

Text = "|c" .. eventSettings.TextColor .. Text:gsub("|r", "|c" .. eventSettings.TextColor) .. "|r"


Posted by CurseForge user Cybeloras

commented

LOL don't even mind how it's fixed so long as it's fixed ;)


Posted by CurseForge user transitbus