Template:Module: Difference between revisions
No edit summary |
Speedybrain (talk | contribs) Release 1d: module data and number format |
||
| (2 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
[[File:{{{1}}} Module.png|{{{1}}}|{{{size|x30px}}}|alt={{{1}}} Module]]<noinclude> | {{#if:{{{id|}}}{{{name|}}}|{{#invoke:ModuleView|main}}|[[File:{{{1}}} Module.png|{{{1}}}|{{{size|x30px}}}|alt={{{1}}} Module]]}}<noinclude> | ||
Shows a module from the game. With <code>id</code> or <code>name</code>, the facts come from the game's own data and update with every game version, so nobody has to copy them by hand. Without them, it shows a category icon, as before. | |||
{| class="wikitable" | |||
! Code !! Shows | |||
|- | |||
| <code><nowiki>{{Module|id=boost.neutral}}</nowiki></code> || {{Module|id=boost.neutral}} | |||
|- | |||
| <code><nowiki>{{Module|name=Stampede|view=compact}}</nowiki></code> || {{Module|name=Stampede|view=compact}} | |||
|- | |||
| <code><nowiki>{{Module|Offensive|size=30px}}</nowiki></code> || {{Module|Offensive|size=30px}} | |||
|} | |||
<pre>{{Module|id=stampede.goats|view=full}}</pre> | |||
{{Module|id=stampede.goats|view=full}} | |||
A module's id is in the [https://www.perfecttower2.com/tools/modules/ module database]: open the module, and the id is the part of the address after <code>#</code>. Names work too, in any case. A module the game doesn't have shows "Unknown module" and puts the page in [[:Category:Pages with unknown modules]]. | |||
<templatedata> | <templatedata> | ||
{ | { | ||
"description": "A module from the game: its name, a card or a full panel, from the game's own data. Without id or name, a category icon.", | |||
"format": "inline", | |||
"params": { | "params": { | ||
"id": { | |||
"label": "Module id", | |||
"description": "The module's id, as in the module database", | |||
"example": "boost.neutral", | |||
"type": "string", | |||
"suggested": true | |||
}, | |||
"name": { | |||
"label": "Module name", | |||
"description": "The module's name in the game, instead of the id", | |||
"example": "Anti-Neutral Projectiles", | |||
"type": "string" | |||
}, | |||
"view": { | |||
"label": "View", | |||
"description": "icon: the name in the text; compact: a card; full: a panel with the description, numbers and tags", | |||
"suggestedvalues": ["icon", "compact", "full"], | |||
"default": "icon", | |||
"type": "string" | |||
}, | |||
"text": { | |||
"label": "Text", | |||
"description": "Text to show instead of the module's name", | |||
"type": "string" | |||
}, | |||
"link": { | |||
"label": "Wiki page", | |||
"description": "Link the name to this wiki page instead of the module database", | |||
"type": "wiki-page-name" | |||
}, | |||
"1": { | "1": { | ||
"label": " | "label": "Category icon", | ||
"description": " | "description": "Without id or name: the category whose icon to show (Offensive, Defensive, Utility, Ultimate, Legendary, Special)", | ||
"example": "Offensive", | "example": "Offensive", | ||
"type": "string" | "type": "string" | ||
}, | }, | ||
"size": { | "size": { | ||
"label": " | "label": "Icon size", | ||
"description": "Size of the icon, as a | "description": "Size of the category icon, as a MediaWiki image size", | ||
" | "default": "x30px", | ||
"type": "string | "type": "string" | ||
} | } | ||
}, | }, | ||
" | "paramOrder": ["id", "name", "view", "text", "link", "1", "size"] | ||
} | } | ||
</templatedata> | </templatedata> | ||
</noinclude> | </noinclude> | ||
Latest revision as of 20:38, 6 October 2026
[[File:{{{1}}} Module.png|{{{1}}}|x30px|alt={{{1}}} Module]]
Shows a module from the game. With id or name, the facts come from the game's own data and update with every game version, so nobody has to copy them by hand. Without them, it shows a category icon, as before.
{{Module|id=stampede.goats|view=full}}
stampede.goatsA module's id is in the module database: open the module, and the id is the part of the address after #. Names work too, in any case. A module the game doesn't have shows "Unknown module" and puts the page in Category:Pages with unknown modules.
A module from the game: its name, a card or a full panel, from the game's own data. Without id or name, a category icon.
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| Module id | id | The module's id, as in the module database
| String | suggested |
| Module name | name | The module's name in the game, instead of the id
| String | optional |
| View | view | icon: the name in the text; compact: a card; full: a panel with the description, numbers and tags
| String | optional |
| Text | text | Text to show instead of the module's name | String | optional |
| Wiki page | link | Link the name to this wiki page instead of the module database | Page name | optional |
| Category icon | 1 | Without id or name: the category whose icon to show (Offensive, Defensive, Utility, Ultimate, Legendary, Special)
| String | optional |
| Icon size | size | Size of the category icon, as a MediaWiki image size
| String | optional |