Posted by mrtravisl on Wed, 27 Apr 2011 22:30:30
I want to get stuff from another file in my addon, right now I have 2 files that have some of the same codes in it. What I want to do is make 1 file and put the stuff that both of the file uses in that file. How would I do that?
I would also like to change the font color in a lua script, not xml. Right now the code is:
CustomQuest_Header:SetTextColor(r=000/255, g=255/255, b=000/255) QuestDifficultyColors["header"].font = CustomQuest_Header;
I tried the color code above and I get this:
Message: ...nterface\AddOns\DetailDisplayer\InterfaceEditing.lua:17: attempt to index global 'CustomQuest_Header' (a nil value) Time: 04/27/11 02:03:27 Count: 1 Stack: ...nterface\AddOns\DetailDisplayer\InterfaceEditing.lua:17: in main chunk Locals: (*temporary) = nil (*temporary) = nil (*temporary) = <userdata> (*temporary) = nil (*temporary) = nil (*temporary) = nil (*temporary) = "attempt to index global 'CustomQuest_Header' (a nil value)"
Posted by jnwhiteh on Thu, 28 Apr 2011 08:17:00
If you create the font in XML, you need to define the parameters in XML. A font is not a global object, so you can't just manipulate it. Just use the :SetFont() method on the font string you are trying to change. Alternatively, define the font in XML and then use it.
You are not meant to be changing the colors of fonts once they are defined. If you have a font string that needs to change colors, use color codes.