What is mixin?
I see this in blizzard code. Also see it in the xml, what does it do?
|
It takes a given table and copies the contents into the frame's table. This started showing up in WoD code.
|
Think of it as inheriting from a template.
|
Kind of, only the "templates" are other Lua tables in which the entries are copied from.
|
The name comes from functions being "mixed in" with the widget's table. It's basically just dynamic inheritance from an independent source. If your frame is a meal you're preparing, then mixin functions/tables can be seen as spices. They exist independently from the meal itself, but can be added to your meal, in which case it'll be part of said meal.
|
I think the OP would get it by now. All these analogies are making my head hurt.
|
And not one coctail in sight :eek:
|
Thanks for answers :)
|
I haven't had time to snoop. Where are Blizzard's mixins?
|
See Blizzard_GarrisonMissionUI.xml line 1910 which points to Blizzard_GarrisonMissionUI.lua lines 14 and 16.
|
In WoD, they're mostly used in the Blizzard LoD addons. In XML, this is a tag on a UI object called MixIn as highlighted below.
Code:
<Frame name="GarrisonMissionFrame" inherits="GarrisonMissionFrameTemplate, GarrisonUITemplate" mixin="GarrisonMission,GarrisonFollowerMission"> In Legion, there's a Lua-implemented function that Blizzard uses as well. Lua Code:
|
It's basically a table deep copy, to create skeleton objects for future use.
|
All times are GMT -6. The time now is 02:04 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI