Module:AbilityTable/doc: Difference between revisions

From The Deadlock Wiki
Jump to navigation Jump to search
Vergir (talk | contribs)
create documentation page for Module:AbilityTable (with help from vergir-bot LLM)
 
Vergir (talk | contribs)
Docs: document is_member (shared membership predicate) and its use by Module:AbilityHints (with help from vergir-bot LLM)
Line 1: Line 1:
This module exposes one function, <code>render</code>, which generates a table of hero abilities matching a named list. It is invoked via [[Template:AbilityTable|<code><nowiki>{{AbilityTable}}</nowiki></code>]].
This module exposes two functions. <code>render</code> generates a table of hero abilities matching a named list, and is invoked via [[Template:AbilityTable|<code><nowiki>{{AbilityTable}}</nowiki></code>]]. <code>is_member(list, record, ability_num)</code> is the shared membership predicate that decides whether a single ability belongs to a list (applying the same properties and exclusions); it is used both internally by <code>render</code> and externally by [[Module:AbilityHints]], so the ability-hint icons always stay in sync with these tables.


The module reads ability lists and exclusions from submodules, matches them against [[Data:AbilityData.json]], and renders the results as either a sortable wikitable or a compact list.
The module reads ability lists and exclusions from submodules, matches them against [[Data:AbilityData.json]], and renders the results as either a sortable wikitable or a compact list.
Line 8: Line 8:
* [[Module:AbilityTable/Notes]] — editor-authored notes displayed in the Notes column
* [[Module:AbilityTable/Notes]] — editor-authored notes displayed in the Notes column
* [[Module:AbilityTable/ComplexRenderers]] — custom column renderers for lists that need more than just Notes
* [[Module:AbilityTable/ComplexRenderers]] — custom column renderers for lists that need more than just Notes
* [[Module:AbilityHints]] — reuses <code>is_member</code> to render interaction-hint icons on ability cards

Revision as of 19:27, 12 July 2026

This module exposes two functions. render generates a table of hero abilities matching a named list, and is invoked via {{AbilityTable}}. is_member(list, record, ability_num) is the shared membership predicate that decides whether a single ability belongs to a list (applying the same properties and exclusions); it is used both internally by render and externally by Module:AbilityHints, so the ability-hint icons always stay in sync with these tables.

The module reads ability lists and exclusions from submodules, matches them against Data:AbilityData.json, and renders the results as either a sortable wikitable or a compact list.

See also