View Single Post
02-04-15, 02:38 AM   #5
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
I tested my idea yesterday.
https://code.google.com/p/rothui/sou...s.lua&old=1361
It works perfectly.

@Oppugno
You need the OnUpdate anyway to scan for nameplates. I use that single OnUpdate script for everything.

First I do WorldFrame scans until I find the first evidence of a nameplate and thus the current nameplate index. That index increases on each /reload. After that I just check if _G["NamePlate"..nextIndex] exists. If it does I skin it.

Funny that you found out about the 1frame delay of alpha states aswell.

The AuraModule inside the OnUpdate is event driven. Thus the conditions will not trigger without a leading event. The only exception is the nameplate scan if I have a target and that nameplate has no GUID. After a delay of 1 frame I can be sure that this nameplate is matching the target.

The only part that I really don't like atm is the mixin of local and object functions. Currently each nameplate gets a set of functions. I could just make a single function and pass the nameplate as a parameter.
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)

Last edited by zork : 02-04-15 at 02:56 AM.
  Reply With Quote