View Single Post
03-13-14, 07:20 PM   #2
myrroddin
A Pyroguard Emberseer
 
myrroddin's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 1,240
Chances are high, say about 99.9%, that "BasicUI" is not actually doing anything wrong. I get that same error with HaloPro, and my roommate gets it with something else.

What is happening is thus:
  1. AddOnX or Blizzard UI element calls protected frame/function
  2. That causes error or taint, but game moves along
  3. When the error or taint gets too much for the game, it blames the next AddOn or Blizzard UI element alphabetically
To prevent your AddOn from getting the blame, remember the golden rule: localize everything! If you have two or more Lua files in your AddOn (like you), reference them locally. There are two methods, depending on how you wrote your AddOn.

[1]
Code:
-- put this at the top of every file
-- returns string, table. being variable names, you can call them whatever you wish
-- use the table to pass data, obviously
-- use the string to call functions
local BasicUI, privateTable = ...
[2]
Code:
-- in your first file, put this
-- does the same thing as above, but adds the AceAddon methods (OnInitialize, OnEnable, OnDisable)
local BasicUI = LibStub("AceAddon-3.0"):NewAddon("BasicUI")

-- in second and consecutive files..
local BasicUI = LibStub("AceAddon-3.0"):GetAddon("BasicUI")
Now your AddOn will not be blamed for UI taint.
  Reply With Quote