Thread Tools Display Modes
07-12-16, 06:38 AM   #21
kurapica.igas
A Chromatic Dragonspawn
Join Date: Aug 2011
Posts: 152
That's right, I create a 25 unit frames for one raid panel when the addon is loaded, I don't need to force the group header to generate unit buttons, since I can bind them in the secure environment.

The performance is not bad if you build you secure snippets carefully, it don't change too much during a raid. I suffer a little freeze when entering a raid group, but works well during the rest time, it's sadly there is no GetTime api for us to avoid repeat operations.

Last edited by kurapica.igas : 07-12-16 at 06:42 AM.
  Reply With Quote
07-12-16, 06:40 AM   #22
Resike
A Pyroguard Emberseer
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,290
Originally Posted by kurapica.igas View Post
Well, you can't call the GenerateUnitFrames during combat, the GenerateUnitFrames is used to replace the "refreshUnitChange" to "_onattributechanged", here is a simple version

Lua Code:
  1. local _Task = {}
  2.  
  3. grpHeader:SetScript("OnUpdate", function(self, elapsed)
  4.     if not InCombatLockdown() and #_Task > 0 then
  5.         for _, cnt in ipairs(_Task) do
  6.             GenerateUnitFrames(self, count)
  7.         end
  8.         wipe(_Task)
  9.     end
  10. end)
  11.  
  12. function grpHeader:UpdateUnitCount(count)
  13.     tinsert(_Task, count)
  14. end

If you don't create buttons based on the auto-generated unit buttons, the refreshUnitChange and _onattributechanged will do the same work, only the refreshUnitChange won't be fired when a unit is set to nil, so I replace it with a better one when out of combat.
Well that the issue, when i enter into combat in Ashran with 5 ppl in the raid and does't leave combat for the next 3 hours, then how are my frames gonna get updated properly when people join and leave the raid frequently? I also would like to keep the original header frames.
  Reply With Quote
07-12-16, 06:46 AM   #23
Resike
A Pyroguard Emberseer
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,290
Originally Posted by kurapica.igas View Post
That's right, I create a 25 unit frames for one raid panel when the addon is loaded, I don't need to force the group header to generate unit buttons, since I can bind them in the secure environment.

The performance is not bad if you build you secure snippets carefully, it don't change too much during a raid. I suffer a little freeze when entering a raid group, but works well during the rest time, it's sadly there is no GetTime api for us to avoid repeat operations.
The real issue is with the secure headers, their "OnAttributeChanged" gets triggered for [maxColumns * unitsPerColumn] times even if only 1 ppl joins/leaves the raid. Same for aura headers. And this is so dumb.

While you can filter this properly in a real code, i'm not sure if you can do this in a secure snippet:
http://www.wowinterface.com/forums/s...ad.php?t=53132

Last edited by Resike : 07-12-16 at 06:54 AM.
  Reply With Quote
07-12-16, 08:19 AM   #24
kurapica.igas
A Chromatic Dragonspawn
Join Date: Aug 2011
Posts: 152
Originally Posted by Resike View Post
Well that the issue, when i enter into combat in Ashran with 5 ppl in the raid and does't leave combat for the next 3 hours, then how are my frames gonna get updated properly when people join and leave the raid frequently? I also would like to keep the original header frames.
Well, it's not that bad, the refreshUnitChange would works well, also with UnitExists (works in secure) and other APIs, we can do much things, it's just not perfect.

The cooldown and etc are none secure elements, so there is no need to do it in the secure ways.
  Reply With Quote
07-12-16, 08:56 AM   #25
Resike
A Pyroguard Emberseer
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,290
Originally Posted by kurapica.igas View Post
Well, it's not that bad, the refreshUnitChange would works well, also with UnitExists (works in secure) and other APIs, we can do much things, it's just not perfect.

The cooldown and etc are none secure elements, so there is no need to do it in the secure ways.
Yes but with secure headers it works perfectly even in combat. I would not like to lose that.

I wanna try one more thing when i get home, to run a predefinied attribute directly from the UnitFrame's filtered "OnAttributeChanged" SetScript, but i have a feeling that it will taint.

Last edited by Resike : 07-12-16 at 09:02 AM.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Run secure code


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off