View Single Post
11-12-13, 08:01 AM   #7
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
@Oppugno
Hmm. I need to check back on that aswell. But I think if you are having the hookscript handlers on oldPlate and oldPlate.castbar and only show/hide the newPlate each frame that will not trigger the onshow scripts of oldPlate and oldPlate.castbar. Thus it should be ok. But I'm not sure. Gonna test it.

Btw...Rainrider have you read http://www.wowinterface.com/forums/s...ad.php?t=46740 ?

Currently the best practice for doing nameplates is doing sth like this:
Lua Code:
  1. --RepositionAllNamePlates func
  2.   local function RepositionAllNamePlates()
  3.     RNP:Hide()
  4.     for blizzPlate, newPlate in pairs(RNP.nameplates) do
  5.       newPlate:Hide()
  6.       if blizzPlate:IsShown() then
  7.         newPlate:SetPoint("CENTER", WorldFrame, "BOTTOMLEFT", blizzPlate:GetCenter())
  8.         newPlate:SetAlpha(blizzPlate:GetAlpha())
  9.         newPlate:Show()
  10.       end
  11.     end
  12.     RNP:Show()
  13.   end
  14.  
  15.   --OnUpdate func
  16.   RNP.lastUpdate = 0
  17.   RNP.updateInterval = 1.0
  18.   local function OnUpdate(self,elapsed)
  19.     RNP.lastUpdate = RNP.lastUpdate + elapsed
  20.     RepositionAllNamePlates()
  21.     if RNP.lastUpdate > RNP.updateInterval then
  22.       SearchForNamePlates(self)
  23.       RNP.lastUpdate = 0
  24.     end
  25.   end
  26.  
  27.   WorldFrame:HookScript("OnUpdate", OnUpdate)

Basically you move all your visible nameplate elements to a new nameplate object and you hide that nameplate object each frame before applying a setpoint. So basically the object points change while being hidden. The fps gain is incredible.

Elv UI integrated that concept into the new nameplates aswell.
__________________
| 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 : 11-12-13 at 08:25 AM.
  Reply With Quote