Ticket #801 (closed enhancement: fixed)

Opened 2 years ago

Last modified 22 months ago

[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

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

Change History

Changed 2 years ago by fcxSanya

comment:1 Changed 2 years ago by historic_bruno

  • Summary changed from Templates sorting utility to [PATCH] Templates sorting utility

comment:2 Changed 2 years ago by k776

  • Milestone changed from Backlog to Alpha 6

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

Changed 23 months ago by fcxSanya

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:5 Changed 23 months ago by k776

  • Milestone changed from Alpha 6 to Alpha 7

comment:6 Changed 23 months ago by k776

  • Owner changed from fcxSanya to historic_bruno

Changed 22 months ago by fcxSanya

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.

Changed 22 months ago by fcxSanya

Changed 22 months ago by fcxSanya

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

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

comment:12 Changed 22 months ago by fcxSanya

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

comment:13 Changed 22 months ago by fcxSanya

  • Status changed from new to closed
  • Resolution set to fixed

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

Note: See TracTickets for help on using tickets.