View Single Post
05-03-11, 06:35 AM   #4
Ketho
A Pyroguard Emberseer
 
Ketho's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,026
I also had problems with using grammar UI escape sequences in SendChatMessage, for the same pipe character "|" reason that Rilgamon just explained

Dridzt has posted a workaround for setting and grabbing the formatted text from a frame
Code:
local b = CreateFrame("Button")
Code:
	eventHandlers['RESURRECT_REQUEST'] = function(name)
		if not (UnitAffectingCombat('player') or UnitAffectingCombat(name)) then
			local delay = GetCorpseRecoveryDelay()
			if delay == 0 then
				AcceptResurrect()
				DoEmote('thank', name)
			else
				local formattedText = b:GetText(b:SetFormattedText("%d |4second:seconds;", delay))
				SendChatMessage("Thanks for the rez! I still have "..formattedText.." until I can accept it.", 'WHISPER', nil, name)
			end
		end
	end

Last edited by Ketho : 05-03-11 at 07:12 AM. Reason: added that trailing semicolon ";" to the UI escape sequence although I dont know what it's actually for
  Reply With Quote