View Single Post
10-20-19, 06:03 AM   #8
kurapica.igas
A Chromatic Dragonspawn
Join Date: Aug 2011
Posts: 152
Originally Posted by illej View Post
Oh wow that is exactly what I was looking for! Thank you so much! There is no way I would have figured that out myself! How did you learn about this stuff? Any particular resources? Or did you just work through the Blizz UI source?
Several years ago, I study the whole restrict code for three times to figure out all usages, here is the list and read order:

1. RestrictedInfrastructure.lua: Wrap the normal frame to secure handler, and some api for secure using.

2. RestrictedEnvironment.lua: the restricted environment to execute the secure snippets and some api.

3. RestrictedFrames.lua: the secure handler methods that can be used in secure snippets.

4. RestrictedExecution.lua: the execution of the secure snippets, the core part is every secure handler(the wrapper of the frame) has a standalone environment, that's why I always create a manager to process the secure snippets, so all processed in one environment.

5. SecureHandlers.lua: All for secure handler's events, the best in it is the SecureHandlerWrapScript, so I can use manager to wrap all secure frame's actions.

6. SecureTemplates.lua: the template for secure frames, the common is the SecureActionButtonTemplate, used for action button.

7. SecureGroupHeaders.lua: for the raid panel, it's a hard topic, I use it for my secure panel lib, so they can refresh well in the combat no matter player join or leave.

8. SecureStateDriver.lua: It's the best system event trigger(although only support marco conditions) to force the secure frames refreshing during the combat.

I have practiced those features in my own raid panel, container, action bar addon(no dependencies), some features are never used in other addons, the secure system is a gold mine but hard for digging.

If your are interesting, I have some post in this forum talked about the usages of the secure frames, you may learn some tricks from them.
  Reply With Quote