Opened 13 years ago

Closed 13 years ago

Last modified 8 years ago

#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:
Cc: Patch:

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 (5)

templates_sorter.diff (1.5 KB ) - added by fcxSanya 13 years ago.
templates_sorter_2011_07_05.diff (1.6 KB ) - added by fcxSanya 13 years ago.
templates_sorter_2011_07_29.diff (2.0 KB ) - added by fcxSanya 13 years ago.
templates_sorter_2011_07_30.diff (2.0 KB ) - added by fcxSanya 13 years ago.
sorted_templates_2011_07_30.diff (509.8 KB ) - added by fcxSanya 13 years ago.

Download all attachments as: .zip

Change History (19)

by fcxSanya, 13 years ago

Attachment: templates_sorter.diff added

comment:1 by historic_bruno, 13 years ago

Summary: Templates sorting utility[PATCH] Templates sorting utility

comment:2 by Kieran P, 13 years ago

Milestone: BacklogAlpha 6

comment:3 by historic_bruno, 13 years ago

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>.

by fcxSanya, 13 years ago

in reply to:  3 comment:4 by fcxSanya, 13 years ago

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:5 by Kieran P, 13 years ago

Milestone: Alpha 6Alpha 7

comment:6 by Kieran P, 13 years ago

Owner: changed from fcxSanya to historic_bruno

by fcxSanya, 13 years ago

comment:7 by fcxSanya, 13 years ago

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 by fcxSanya, 13 years ago

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 by Philip Taylor, 13 years ago

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.

by fcxSanya, 13 years ago

by fcxSanya, 13 years ago

in reply to:  9 comment:10 by fcxSanya, 13 years ago

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 by fcxSanya, 13 years ago

(In [9936]) Simulation templates sorting. See #801.

comment:12 by fcxSanya, 13 years ago

(In [9937]) Simulation templates sorting in internal mod. See #801.

comment:13 by fcxSanya, 13 years ago

Resolution: fixed
Status: newclosed

(In [9938]) Templates sorting utility. Closes #801.

comment:14 by sanderd17, 8 years ago

Keywords: review removed
Note: See TracTickets for help on using tickets.