View Single Post
09-24-15, 02:26 PM   #8
Gryns
A Deviate Faerie Dragon
 
Gryns's Avatar
Join Date: Sep 2015
Posts: 11
Originally Posted by semlar View Post
The error is from 'local f = _G["ChatFrame" .. i])' having an extraneous parentheses at the end, but I don't think phanx's script is going to do anything mine didn't do for you, it's just a different way of doing more or less the same thing.


If I'm understanding you correctly it's removing the realm from their name in the chat window when they send you a whisper, but you want it to also remove it from the left side of the chat box when you're sending a tell to someone.

Alright, I threw something together that I think should do what you're after.
Lua Code:
  1. hooksecurefunc('ChatEdit_UpdateHeader', function(editBox)
  2.     local header = _G[editBox:GetName() .. 'Header']
  3.     if editBox:GetAttribute('chatType') == 'WHISPER' and header then
  4.         _G[editBox:GetName() .. 'HeaderSuffix']:Hide()
  5.         header:SetWidth(0)
  6.         header:SetFormattedText(CHAT_WHISPER_SEND, (strsplit('-', editBox:GetAttribute('tellTarget'))))
  7.         editBox:SetTextInsets(15 + (header:GetRight() or 0) - (header:GetLeft() or 0), 13, 0, 0)
  8.     end
  9. end)
Brilliant! This is exactly what I wanted, seems to filter everything now, except the realm names in system messages. i.e. "Gryns-Aggramar has entered the raid" I know I'm nitpicking, but is that possible as well?

Also, I added this to the code of your other addon, NoRealm, but that didn't seem to work. It only seemed to work when I enabled it as a separate addon, how can I merge the two?

Thanks again, really.

Joey
__________________
-- Live like a King, laugh like his Jester. --
  Reply With Quote