OAP Lizzard A game interface engine
Game interfaces, outside the game Settings
← XML guide

Documentation / XML guide

Extending the loader

For Lizzard's own code: adding an element or attribute, with its evidence and test.

This page is for work on Lizzard itself: adding an element or attribute its loader doesn't read yet. The rule throughout is that the game decides how something behaves, not anyone's memory of it.

Adding an element or attribute

  1. Find its place in the loader. A frame's child elements and attributes, textures, font strings and fonts, layers, animations, and edit boxes, status bars and sliders each have their own part of the loader (src/OAPLizzard.Engine/Xml).
  2. Read it through the loader's value helpers (XmlValues), never straight from the XML element. That is how the measurement behind the element reference sees every read; a read that goes round them would show as ignored.
  3. Take the behaviour from evidence: Blizzard's own interface code, a probe case run in the game, or an in-game screenshot. If part of it has to be guessed, it goes on Lizzard's list of guesses in the same piece of work, with how it could be checked.
  4. Test it with a small made-up addon: a few lines of XML, loaded into a fresh world, and the result read back from Lua or from the frame.
  5. Make the measurement again, so the element reference and the coverage reports show the change: OAPLizzard.Runner --xml-coverage, with --xml-reference for this site's table.
  6. Update this guide: the page for that part of the XML, with the rule's evidence label.

How the measurement works

Every attribute the loader reads goes through one helper, and every child element it looks for by name through two more. While a recording is on, those helpers note the element and the name they were asked about. After the load, Lizzard walks every file it read and counts each element and attribute, and whether the loader looked at it. Templates that nothing in the load used are left out, since the loader never reached them to read or ignore. The result is compared with UI.xsd, whose own rules for each element (its base types and the groups of elements it allows) are followed by .NET's schema reader.

That measures what the loader reads, not whether it does the right thing with it. Whether it does is what the probe in the game, the screenshots and the tests are for.