(merge from official wiki) |
(merge from official wiki) |
||
| 第1行: | 第1行: | ||
< | <includeonly>{{template doc page transcluded}}</includeonly><noinclude>{{template doc page viewed directly}}</noinclude> | ||
<!-- EDIT TEMPLATE DOCUMENTATION BELOW THIS LINE --> | |||
__NOTOC__ | |||
'''Unit''' can be used to create info tooltips or table rows for units. | |||
== Parameters == | |||
< | {| class="wikitable" | ||
! 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 <code>table</code> || ''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)"): | |||
{| class="wikitable" style="float:left; margin-right:5px;" | |||
|+ 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 | |||
| | |||
| | |||
|} | |||
{| class="wikitable" style="float:left; margin-right:5px;" | |||
|+ 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) | |||
| | |||
| | |||
|} | |||
{{clear}} | |||
== Tooltip usage == | |||
This template can be used in paragraphs by wrapping the paragraph in a <nowiki><div></div></nowiki> or <nowiki><span></span></nowiki> tag, otherwise it breaks the paragraph layout. It can be used in wiki lists or table cells without issue otherwise. If <code>index</code> 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. | |||
{| class = "wikitable plainlist" | |||
! Type !! Stats !! Upkeep | |||
|- | |||
| <code>Template goes here</code> | |||
|} | |||
Each unit in the table requires its own use of the template in a new row. | |||
== Examples == | |||
<code><nowiki>{{Unit|Irregular Infantry|index=1}}</nowiki></code> results in <div>{{Unit|Irregular Infantry|index=1}}</div> | |||
Note the line break; wrapping the paragraph in <nowiki><span></span></nowiki> results in: | |||
<div><code><nowiki>{{Unit|Irregular Infantry|index=1}}</nowiki></code> results in {{Unit|Irregular Infantry|index=1}}</div> | |||
Setting the index to a non-number or a number above 3 prevents a tooltip and sets just a basic icon display: | |||
<code><nowiki>{{Unit|Battleships}}</nowiki></code> results in {{Unit|Battleships}} | |||
Table usage appears as follows | |||
{| class = "wikitable plainlist" | |||
! Type !! Stats !! Upkeep | |||
|- | |||
| colspan=3 | <code><nowiki>{{Unit|Frigates|table=1}}</nowiki></code> results in | |||
|- | |||
| {{Unit|Frigates|table=1}} | |||
|} | |||
2025年7月9日 (三) 23:12的最新版本
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
|
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)"):
| 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 |
| 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
Always unlocked
Note the line break; wrapping the paragraph in <span></span> results in:
{{Unit|Irregular Infantry|index=1}} results in Always unlocked
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
|
|
|