HomeWildfire Games

Use XML files instead of hardcoded C++ code in the template manager to…

Description

Use XML files instead of hardcoded C++ code in the template manager to universally change template properties at load time.

Patch By: leper
Differential Revision: https://code.wildfiregames.com/D215
Fixes #2951

Details

Committed
elexisMar 16 2017, 8:56 PM
Differential Revision
D215: Dynamic Special Templates
Parents
rP19301: Don't show Boudica as an idle worker.
Branches
Unknown
Tags
Unknown
Build Status
Buildable 784
Build 1240: Post-Commit BuildJenkins

Event Timeline

Originally intended commit message from http://trac.wildfiregames.com/attachment/ticket/2951/template_subsets.diff

Make special templates (foo|templatename) (apart from actor|) more moddable. Fixes #2951.

This moves template additions to xml files.
Permitted components are now done via filtered and merge.
For adding new nodes while ignoring possible previous values use replace.

Some explanation on how to use the new filter templates:

  • Previously permitted component types should be replaced by <Foo merge=""/>, which does not add the <Foo> node if it wasn't present.
  • To actually remove the other components the encompassing node should specify filtered="", which will remove all nodes which are present in the original, but not in the filter.
  • Additions that should be performed while ignoring a possible original node should specify replace="".
  • To add something to an existing node (or add that node if it does not exist) just use <Foo>...</Foo>.