Template:AbilitySection/doc: Difference between revisions

Vergir (talk | contribs)
Add AbilitySection doc
 
Vergir (talk | contribs)
m update doc once more
 
(12 intermediate revisions by 2 users not shown)
Line 3: Line 3:
Two-column layout wrapping [[Template:Ability card v2]] on the left and an optional tabbed details panel on the right. Backed by [[Module:AbilitySection]].
Two-column layout wrapping [[Template:Ability card v2]] on the left and an optional tabbed details panel on the right. Backed by [[Module:AbilitySection]].


On narrow viewports the two columns stack vertically via CSS flex-wrap. Styles are loaded from [[Template:Vergir/AbilitySection/styles.css]] via TemplateStyles.
On narrow viewports the two columns stack vertically via CSS flex-wrap. Styles are loaded from [[Template:AbilitySection/styles.css]] via TemplateStyles.


Intended to replace [[Template:Ability tabs]] on hero pages. Editors place four of these blocks in sequence, one per ability, each under its own <code>=== Ability Name ===</code> heading directly on the hero page.
An interaction-hint rail is generated automatically between the card and the details panel: small item icons showing how the ability interacts with items, driven by [[Module:AbilityHints]].
 
Tab visibility rules:
* Only tabs with content are shown.
* A <code>Show All</code> tab is appended automatically if two or more tabs have content.
* If no content parameters are provided, no details panel is rendered at all — only the ability card (and its hint rail, if any).


=== Parameters ===
=== Parameters ===


{| class="wikitable"
<templatedata>
! Parameter !! Description !! Required
{
|-
"params": {
| <code>hero_name</code> || Hero name, passed to [[Template:Ability card v2]]. || Yes
"hero_name": {
|-
"description": "Hero name, passed to Template:Ability card v2.",
| <code>ability_num</code> || Ability index (1–4), passed to [[Template:Ability card v2]]. || Yes
"example": "Doorman",
|-
"type": "string",
| <code>notes</code> || Freeform wikitext for the Notes tab. Supports links, templates, bullet points. || No
"required": true
|-
},
| <code>interactions</code> || One or more [[User:Vergir/AbilityInteraction]] calls for the Interactions tab. || No
"ability_num": {
|-
"description": "Ability index (1–4), passed to Template:Ability card v2.",
| <code>tips</code> || Freeform wikitext for the Tips tab. || No
"example": "1",
|}
"type": "number",
 
"required": true
Tab visibility rules:
},
* Only tabs with content are shown.
"notes": {
* A <code>Show All</code> tab is appended if two or more tabs with content
"description": "Wikitext for the Notes tab.",
* If no parameters are provided, no notes panel is rendered at all.
"example": "* Can be detonated by [[Melee Attack|melee attacks]].",
"type": "string",
"required": false
},
"tips": {
"description": "Wikitext for the Tips tab.",
"example": "* T3 talent allows stacking several bells for high damage traps.",
"type": "string",
"required": false
},
"interactions": {
"description": "Wikitext for the Interactions tab. Use {{AbilityInteraction}} blocks.",
"example": "{{AbilityInteraction | interaction = stun | text = ... }}",
"type": "string",
"required": false
}
},
"paramOrder": [
"hero_name",
"ability_num",
"notes",
"tips",
"interactions"
],
"description": "Generates ability cards in hero pages. Uses Ability card v2/Card"
}
</templatedata>


=== Example ===
=== Example ===


<pre>
<pre>
=== Call Bell ===
{{AbilitySection
| hero_name  = The Doorman
| ability_num = 1
| notes      =
* Bells can be detonated by [[Melee Attack|melee attacks]].
| tips        =
* T3 talent allows stacking several bells for high damage traps.
| interactions =
{{AbilityInteraction
| interaction = debuff resist
| text      = Debuff Resist shortens duration of [[Movement Slow|move slow]] and accuracy debuff.
}}
}}
</pre>


{{User:Vergir/AbilitySection
{{AbilitySection
| hero_name  = The Doorman
| hero_name  = The Doorman
| ability_num = 1
| ability_num = 1
| notes      =
| notes      =
* Bells can be detonated by [[Melee Attack|melee attacks]].
* Bells can be detonated by [[Melee Attack|melee attacks]].
| tips        =
* T3 talent allows stacking several bells for high damage traps.
| interactions =
| interactions =
* The cast range (throwing distance) is not affected by Ability Range
{{AbilityInteraction
| tips =
| interaction = debuff resist
* T3 talent allows stacking several bells for making high damage traps.
| text        = Debuff Resist shortens duration of [[Movement Slow|move slow]] and accuracy debuff.
}}
}}
}}
</pre>


=== Related pages ===
=== Related pages ===


* [[Module:AbilitySection]] — Lua backend
* [[Module:AbilitySection]] — Lua backend
* [[Module:AbilityHints]] — interaction-hint icons rendered beside the card
* [[Template:AbilitySection/styles.css]] — CSS
* [[Template:AbilitySection/styles.css]] — CSS
<noinclude>[[Category:Template documentation]]</noinclude>
<noinclude>[[Category:Template documentation]]</noinclude>