Ticket #801 (closed enhancement: fixed)
[PATCH] Templates sorting utility
| Reported by: | fcxSanya | Owned by: | historic_bruno |
|---|---|---|---|
| Priority: | Nice to Have | Milestone: | Alpha 7 |
| Component: | UI & Simulation | Keywords: | review |
| Cc: |
Description
Currently second-level elements (which represent components) in simulation templates ordered chaotically, and this is better to have any order than don't have order at all, so I proposed to use the alphabetical order.
Attached patch add to svn small utility, which consists from shell script and xsl template.
Attachments
Change History
comment:1 Changed 2 years ago by historic_bruno
- Summary changed from Templates sorting utility to [PATCH] Templates sorting utility
comment:3 follow-up: ↓ 4 Changed 23 months ago by historic_bruno
Thanks, the disorder of these tags has bothered me for a while. Looks like the sorter works well. One question though, could it be made case insensitive? Like with "template_structure.xml" I think <BuildingAI> should come before <BuildRestrictions>.
comment:4 in reply to: ↑ 3 Changed 23 months ago by fcxSanya
Replying to historic_bruno:
One question though, could it be made case insensitive?
Thanks for note, I added function to translate lower-case letters to upper-case when sorting, so now it should be case insensitive. (I checked out only source/tools directory, so created new patch from it; it should be applied from it too as far as I understand)
comment:7 Changed 22 months ago by fcxSanya
After checking templates I found that xsltproc remove encoding attribute from xml header when encoding is not specified explicitly in the xslt file, so in new version I added encoding attribute.
comment:8 Changed 22 months ago by fcxSanya
I posted warning on forum about upcoming templates changes. I will wait few days and then will commit both utility and updated templates.
comment:9 follow-up: ↓ 10 Changed 22 months ago by Philip
This breaks promotions:
diff -r f17a58f7c9b7 binaries/data/mods/public/simulation/templates/units/cart_cavalry_javelinist_a.xml
--- a/binaries/data/mods/public/simulation/templates/units/cart_cavalry_javelinist_a.xml Sat Jul 30 17:19:54 2011 +0100
+++ b/binaries/data/mods/public/simulation/templates/units/cart_cavalry_javelinist_a.xml Sat Jul 30 17:21:52 2011 +0100
@@ -4,7 +4,7 @@
<Rank>Advanced</Rank>
</Identity>
<Promotion>
- <Entity>units/cart_cavalry_javelinist_e</Entity>
+ <Entity/>
</Promotion>
<VisualActor>
<Actor>units/carthaginians/cavalry_javelinist_a.xml</Actor>
In special/formation.xml it removes the commented-out VisualActor; might be nice to add that back in manually afterwards, since it's handy when debugging formation movement.
comment:10 in reply to: ↑ 9 Changed 22 months ago by fcxSanya
Replying to Philip:
This breaks promotions:
Fixed.
In special/formation.xml it removes the commented-out VisualActor; might be nice to add that back in manually afterwards, since it's handy when debugging formation movement.
Now it copy all comments to the start of content of "Entity" element.
comment:11 Changed 22 months ago by fcxSanya
comment:12 Changed 22 months ago by fcxSanya
comment:13 Changed 22 months ago by fcxSanya
- Status changed from new to closed
- Resolution set to fixed
