|Go to Page...|
|Thread Tools||Display Modes|
|08-31-17, 02:46 PM||#1|
A Scalebane Royal Guard
Table-based frame markup
I guess this idea isn't completely new (thinking about AceConfig for example), but I created a crossover between XML and Lua that is akin to JSON. By using tables and a special parser, it essentially does the job of XML but without any XML. I'm using this to create frames and templates for my controller UI with slightly different syntax. Figured I'd post it here to see if there's any interest in releasing this as a library. Feedback is welcome.
What are the upsides?
What are the downsides?
To show you how this works, I'll start by comparing a regular XML template (ActionButtonTemplate) and a rewritten version that uses the table parser.
Personally, I find the second version a lot easier to read and modify, especially since the only hierarchical indentation is how a child relates to its parent. Note that there's no split between frames, regions or animation widgets, so they can be organised however you want. I'm currently using this for quite a few different frames and the performance dent is not as bad as I expected when I started tinkering with it. Having that said, this is most likely slower than XML and definitely slower than manually creating all your frames directly in Lua.
Here's the source code:
Last edited by MunkDev : 08-31-17 at 03:30 PM.
|WoWInterface » Developer Discussions » General Authoring Discussion » Table-based frame markup|