Dominos

Dominos

19M Downloads

Intrinsic Frames

Tuller opened this issue · 1 comments

commented

From the forums (http://us.battle.net/forums/en/wow/topic/20749494846):

It’s now possible to create an “intrinsic” frame template. Intrinsics are similar to virtual XML templates but have a few special behaviors.

As an example, here is a simple intrinsic definition.

These can be created through CreateFrame like built-in widgets. Using the example above, you’d create a new ExampleIntrinsic by calling CreateFrame(“ExampleIntrinsic”).

These can also be created through XML elements anywhere a frame type could. For example:

Lastly, and perhaps most importantly, intrinsics can apply special ordering to their frame scripts. Additionally, once an intrinsic frame script is bound to the frame, it cannot be rebound. However, it can be hooked and inspected. For example, in the definition above the global function “ExampleIntrinsic_OnPostShow” is bound to an instantiation of ExampleIntrinsic. It’s intrinsicOrder is “postcall” which means that this OnShow handler is called after the normal OnShow handler.

The ExampleIntrinsic_OnPostShow cannot be replaced. However, it can be hooked via HookScript or inspected by GetScript by passing in an additional optional argument with either LE_SCRIPT_BINDING_TYPE_INTRINSIC_POSTCALL or LE_SCRIPT_BINDING_TYPE_INTRINSIC_PRECALL. Specifying “precall” for the intrinsicOrder means that the handler is called before the normal OnShow handler. An intrinsic can have both a precall and a postcall.

For an example of usage, see the new ScrollingMessageFrame.xml and the corresponding ScrollingMessageFrame.lua files.

commented

I rediscovered that these existed when Blizzard used them for ItemButtons in 8.1, but I don't think I need to do anything with them.