Template:Unit

This template uses the following modules:
Module:Unit
[阅读] [编辑]Template-info.png 模板文档


Unit can be used to create info tooltips or table rows for units.

Parameters

Parameter Description Required Default
1 English localized unit name Required none
index Tooltip index, for tooltip-in-a-tooltip use
  • 1, 2, or 3
Optional none
w Width of icon, no effect if used with table Optional 24px
table Formats output as a table row instead of tooltip, if set to anything Optional none

Parameter 1 must be the proper English localized name of the unit; names that are localized in plural can also be singular (indicated with "(s)"):

Land units
Irregular Infantry Cannon Artillery Hussar(s)
Line Infantry Mobile Artillery Dragoon(s)
Skirmish Infantry Shrapnel Artillery Cuirassier(s)
Trench Infantry Siege Artillery Lancer(s)
Squad Infantry Heavy Tank(s) Light Tank(s)
Mechanized Infantry
Naval units
Frigate(s) Man-o-War(s) Submarine(s)
Monitor(s) Ironclad(s) Carrier(s)
Destroyer(s) Dreadnought(s)
Torpedo Boat(s) Battleship(s)
Scout Cruiser(s)

Tooltip usage

This template can be used in paragraphs by wrapping the paragraph in a <div></div> or <span></span> tag, otherwise it breaks the paragraph layout. It can be used in wiki lists or table cells without issue otherwise. If index is not set, this is not necessary.

Table usage

This template outputs into the following table format. The template should be put in the first column and it generates the remaining columns for its row.

Type Stats Upkeep
Template goes here

Each unit in the table requires its own use of the template in a new row.

Examples

{{Unit|Irregular Infantry|index=1}} results in
Irregular Infantry Irregular Infantry
InfantryIrregular Infantry
Always unlocked

Stats:
Military offense.png 10 Offense
Military defense.png 10 Defense
Military morale.png 15 Morale loss
No upkeep goods
Can upgrade to:
Line Infantry Line InfantrySkirmish Infantry Skirmish InfantryTrench Infantry Trench InfantrySquad Infantry Squad InfantryMechanized Infantry Mechanized Infantry

Note the line break; wrapping the paragraph in <span></span> results in:

{{Unit|Irregular Infantry|index=1}} results in
Irregular Infantry Irregular Infantry
InfantryIrregular Infantry
Always unlocked

Stats:
Military offense.png 10 Offense
Military defense.png 10 Defense
Military morale.png 15 Morale loss
No upkeep goods
Can upgrade to:
Line Infantry Line InfantrySkirmish Infantry Skirmish InfantryTrench Infantry Trench InfantrySquad Infantry Squad InfantryMechanized Infantry Mechanized Infantry

Setting the index to a non-number or a number above 3 prevents a tooltip and sets just a basic icon display:

{{Unit|Battleships}} results in Battleships Battleships

Table usage appears as follows

Type Stats Upkeep
{{Unit|Frigates|table=1}} results in
Frigates Frigates
  • Unlocked by:
    • Navigation Navigation

  • Can upgrade from:
    • None
  • Man-o-Wars 1 Man-o-Wars