Jump to content

[X:CE 34.2] Custom Manufacture Category Sorting ID - Guide


Charon

Recommended Posts

[X:CE 34.2] Custom Manufacture Category Sorting ID - a Guide

 

This thread will tell you how to assign a custom sorting ID to your manufacture categories.

 

As of XCE 34.2 the manufacture categories are sorted alphabetically, which might not be the optimal sorting order for your game.

 

To add a new category add them in the manufacture_categories.xml. Remember the file actually needs a modmerge command at the top. For instance

<?xml version="1.0"?>
<ManufactureCategories MODMERGE="replace">
    <!--
    Add custom manufacture categories here. Only ones not present in the vanilla game.
    Tags look like:
    <ManufactureCategory>
        <ID>SomeCategoryId</ID>
    </ManufactureCategory>
    
    The ID should then be used for the Category column in manufactures.xml, and have a
    corresponding entry in strings.xml
    -->
    <ManufactureCategory>
        <ID>Aircraft Units 0</ID>
    </ManufactureCategory>
    <ManufactureCategory>
        <ID>Aircraft Cannon 0</ID>
    </ManufactureCategory>
    <ManufactureCategory>
        <ID>Aircraft Missile & Torpedo 0</ID>
    </ManufactureCategory>
    <ManufactureCategory>
        <ID>Vehicles & Mechs 0</ID>
    </ManufactureCategory>
    <ManufactureCategory>
        <ID>Vehicle Phase 3 & 4 Weapons 0</ID>
    </ManufactureCategory>
    <ManufactureCategory>
        <ID>Armour & Shields 0</ID>
    </ManufactureCategory>

 

Then they need to be added to the strings. This will get alphabetically sorted.

Quote

   <Row ss:AutoFitHeight="0"><Cell><Data ss:Type="String">Aircraft Units 0</Data><NamedCell ss:Name="_FilterDatabase"/></Cell>
    <Cell><Data ss:Type="String">Aircraft</Data><NamedCell ss:Name="_FilterDatabase"/></Cell>
   </Row>
   <Row ss:AutoFitHeight="0"><Cell><Data ss:Type="String">Aircraft Cannon 0</Data><NamedCell ss:Name="_FilterDatabase"/></Cell>
    <Cell><Data ss:Type="String">Aircraft Cannons</Data><NamedCell ss:Name="_FilterDatabase"/></Cell>
   </Row>
   <Row ss:AutoFitHeight="0"><Cell><Data ss:Type="String">Aircraft Missile & Torpedo 0</Data><NamedCell ss:Name="_FilterDatabase"/></Cell>
    <Cell><Data ss:Type="String">Aircraft Missile & Torpedo</Data><NamedCell ss:Name="_FilterDatabase"/></Cell>
   </Row>
   <Row ss:AutoFitHeight="0"><Cell><Data ss:Type="String">Vehicles & Mechs 0</Data><NamedCell ss:Name="_FilterDatabase"/></Cell>
    <Cell><Data ss:Type="String">Vehicles & Mechs</Data><NamedCell ss:Name="_FilterDatabase"/></Cell>
   </Row>
   <Row ss:AutoFitHeight="0"><Cell><Data ss:Type="String">Vehicle Phase 3 & 4 Weapons 0</Data><NamedCell ss:Name="_FilterDatabase"/></Cell>
    <Cell><Data ss:Type="String">Vehicle Phase 3 & 4 Weapons</Data><NamedCell ss:Name="_FilterDatabase"/></Cell>
   </Row>
   <Row ss:AutoFitHeight="0"><Cell><Data ss:Type="String">Armour & Shields 0</Data><NamedCell ss:Name="_FilterDatabase"/></Cell>
    <Cell><Data ss:Type="String">Armour & Shields</Data><NamedCell ss:Name="_FilterDatabase"/></Cell>
   </Row>

 

HTML Entity (decimal) codes are codes for signs or commands which have to be visually/coded presented by the font. An example for this is &#8544; the roman 1 or the more common known  &#10; for a new line. Others are &quote for - " - and similar commands are available. The xenonauts font is very limited which we will use to our advantage.

Normally you put down those commands to insert a sign, we on the other want to look for commands which wont get visually presented but still counted into the alphabetical order.

&#1000; is one of it for example. Put this at the beginning of the String line and go down like &#1001; &#1002; &#1003; etc ... .

Quote

   <Row ss:AutoFitHeight="0"><Cell><Data ss:Type="String">Aircraft Units 0</Data><NamedCell ss:Name="_FilterDatabase"/></Cell>
    <Cell><Data ss:Type="String">&#1000;Aircraft</Data><NamedCell ss:Name="_FilterDatabase"/></Cell>
   </Row>
   <Row ss:AutoFitHeight="0"><Cell><Data ss:Type="String">Aircraft Cannon 0</Data><NamedCell ss:Name="_FilterDatabase"/></Cell>
    <Cell><Data ss:Type="String">&#1001;Aircraft Cannons</Data><NamedCell ss:Name="_FilterDatabase"/></Cell>
   </Row>
   <Row ss:AutoFitHeight="0"><Cell><Data ss:Type="String">Aircraft Missile & Torpedo 0</Data><NamedCell ss:Name="_FilterDatabase"/></Cell>
    <Cell><Data ss:Type="String">&#1002;Aircraft Missile & Torpedo</Data><NamedCell ss:Name="_FilterDatabase"/></Cell>
   </Row>
   <Row ss:AutoFitHeight="0"><Cell><Data ss:Type="String">Vehicles & Mechs 0</Data><NamedCell ss:Name="_FilterDatabase"/></Cell>
    <Cell><Data ss:Type="String">&#1003;Vehicles & Mechs</Data><NamedCell ss:Name="_FilterDatabase"/></Cell>
   </Row>
   <Row ss:AutoFitHeight="0"><Cell><Data ss:Type="String">Vehicle Phase 3 & 4 Weapons 0</Data><NamedCell ss:Name="_FilterDatabase"/></Cell>
    <Cell><Data ss:Type="String">&#1004;Vehicle Phase 3 & 4 Weapons</Data><NamedCell ss:Name="_FilterDatabase"/></Cell>
   </Row>
   <Row ss:AutoFitHeight="0"><Cell><Data ss:Type="String">Armour & Shields 0</Data><NamedCell ss:Name="_FilterDatabase"/></Cell>
    <Cell><Data ss:Type="String">&#1005;Armour & Shields</Data><NamedCell ss:Name="_FilterDatabase"/></Cell>
   </Row>

 

Voíla, sorted.

If you step on a sign which actually gets displayed just continue until you find one that doesnt get displayed and neither leaves a whitespace.

Heres how our example looks like.

[XCE 34.2] Custom Manufacture Sorting ID.jpg

 

Give some feedback if the guide is understandable enough.

Edited by Charon
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...