View Single Post
09-05-16, 11:55 PM   #5
asdf
A Deviate Faerie Dragon
Join Date: Feb 2005
Posts: 18
Originally Posted by Phanx View Post
1. Copy and paste the entire function from Blizzard's code into your addon file.

2. Add a "local" keyword in front of the function definition so it only exists in your file, not everywhere. "function DoStuff(x)" --> "local function DoStuff(x)"

3. Change each instance of the function names I mentioned where they're called from inside the function.

4. Set a new OnEvent handler on the CombatText frame, passing it your modified function.

You can use this tool to generate an addon package for your code if you're not sure how to write a TOC file and set up your folder structure.
Thanks so much. I think I got everything except something related to the 4th step. I'm getting a Lua error on the line that I created to set the handler, in regards to finding the CombatText frame.

I used this:
CombatText:SetScript("OnEvent", CombatText_OnEvent);

And get this error:
code.lua:268: attempt to index global 'CombatText' (a nil value)

I think I'm missing something, is CombatText not a global frame?

edit: see reply below, I think I got past this hurdle.

Last edited by asdf : 09-06-16 at 01:35 AM.
  Reply With Quote