If you are running any other addon(s) that alter the TH frame, they might be "undoing" your code.
With what you have, it's probably easier to reduce all the code (after making a copy) to just:
Lua Code:
TalkingHeadFrame.MainFrame.CloseButton:Hide()
TalkingHeadFrame.BackgroundFrame:SetAlpha(0)
TalkingHeadFrame:HookScript("OnShow", function(self)
self.NameFrame.Name:SetTextColor(1, 0.82, 0.02)
self.NameFrame.Name:SetShadowColor(0, 0, 0, 1)
self.NameFrame.Name:SetShadowOffset(2, -2)
self.TextFrame.Text:SetTextColor(255,255,255)
self.TextFrame.Text:SetShadowColor(0, 0, 0, 1)
self.TextFrame.Text:SetShadowOffset(2, -2)
end)
and add the following to your addons .toc file:
Code:
## LoadOnDemand: 1
## LoadWith: Blizzard_TalkingHeadUI
This will automatically load the addon when the TH addon loads and hook the OnShow function only once (your other code adds a new hook every time the event is called).
You only need the other "plumbing" if the addon will be doing other things as well.