View Single Post
05-24-20, 05:35 PM   #6
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,929
Originally Posted by kaytotes View Post
Oh my god that's it as soon as I saw it clicked.

I'd just been going through my .TOC file and removing modules line by line to find a culprit for the error and narrowed it down to my player.lua and target.lua

I'll make a far more concerted effort to use local wherever appropriate! Thank you so much i've been tearing my hair out for a couple weeks.

don't forget you can also use addon wide variables via the shared table you can access at the top of each lua file.

If you have never used it, do something similar to the following at the top of any file you want to access the addon wide table. The second line is just something I add in case it is initially nil rather than an empty table.
local addonName, addonData = ...
addonData = addonData or {}

I use local for variables that are only needed for that file, or within code blocks and anything that I need access to across the whole addon I used the addonData table. This enables me to separate functionality across multiple files, which enables me to better share individual files with other addons that need the same functionality. Such as Translation tools.
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818
  Reply With Quote