View Single Post
03/24/14, 10:27 AM   #5
skyraker
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 154
Originally Posted by skyraker View Post
Yeah, looking like it was my use of the pipe. Using a dash worked.

I completely understand refraining from using globals, however as my addon stands right now it needs to access the same variable from multiple spots. I'm going to look on my next iteration about getting rid of that though.
I keep thinking about this and I still have no idea how to get those globals away. I only want the data that makes sense to update every frame, while keeping event items separate. If I remove the globals, I feel that I would need to update everything every frame. While in the grand scheme of the addon it probably isn't taking much processing to do so, trading off one bad practice for another doesn't make any sense.

For example, my toolbar updates every frame by looping through the addons saved variables and only displaying those portions that are currently selected (true). Variables that update quickly (such as position) are called only if that is one of the selected portions and is called from the function that builds the bar. For everything else, the only time the string associated with those portions of the toolbar is changed is when its associated event fires.
  Reply With Quote