This allows including bits of XML files into other XML files. The goal is to make our templates easier to modify, particularly simulation templates.
Design goals:
- [x] Allow direct inclusion of XML nodes
- [x] Allow direct inclusion of multiple XML nodes from one <include>
- [x] Allow "modifying" includes, similar to paramnode includes
- [x] Allow applying a template to another template.
- [ ] Implement template hotloading.
All of the above should come at no/limited performance reduction.
To check:
- Might make XMB caching slower. This could matter for "filtered" templates, since I'd now try caching them.
Current flaws:
- Probably breaks hot-loading of art templates and such I think (not simulation since those don't have it).
- No handling of filter templates.
TODO:
- More cleanup
- Error reporting correctly.
----
Examples of things I want to clean up:
- On the simulation templates side:
- For civs with custom buildings, those are added manually to every builder template. It'd be nice to have a way to include a file.
- Champion/Hero/Regular templates reuse a lot of similar template code, but aren't so modular because of the "Parent" logic.
- On the actor template side:
- We already can include variants, using rather custom code, which this would potentially make redundant / improve upon.
----
Attached is an example of XML inclusion.
----
I had a previous go at this using XInclude at D62, which ended up unsuccessfully. I didn't really fix the issues I'm listing above, and xInclude is... not great.