Module:AbilityHints/doc: Difference between revisions

From The Deadlock Wiki
Jump to navigation Jump to search
Vergir (talk | contribs)
Document unlinked automatic icons and linkable tooltips (with help from vergir-bot LLM)
Vergir (talk | contribs)
m update doc
 
Line 1: Line 1:
== Overview ==
== Overview ==


Renders the interaction-hint rail on ability cards (via [[Module:AbilitySection]]): a small strip of item icons showing how an ability interacts with items — dispellable, duration-reduced, blocked, etc. Each icon displays a configured image and has a hover tooltip. Automatic icons are not clickable; the links live in the tooltip text instead, and the tooltip can be hovered into to reach them.
Renders a small strip of item icons showing how an ability interacts with items and used by [[Module:AbilitySection]].  
Each icon displays a configured image and has a hover tooltip.


Membership is decided by <code>is_member</code> in [[Module:AbilityTable]]. To change ability-icon matching, edit [[Module:AbilityTable/Lists]] (this will also update relevant ability tables).
Hints can be "automatic" and "manual".
* Automatic come from [[Module:AbilityTable/Lists]]. If an ability is part of 'debuffresist' list, then it will show automatic debuff resist hint. List of enabled automatic hints is configured through CONFIG in this module. Clicking on an icon does nothing, however tooltip often will have a link to relevant item/mechanic.
* Manual hints come from {{tl|AbilityInteraction}} blocks used on AbilitySection. Whenetever an editor describes an interaction using that block a hint will be displayed. Clicking on a hint reveals that hand-written block.


== Entry point ==
== Entry point ==


=== <code>p.get_icons(ability_key, ability_num)</code> ===
=== <code>p.get_icons(ability_key, ability_num)</code> ===
Returns the rail HTML for one ability, or an empty string when the ability matches no lists. <code>ability_key</code> is the ability's <code>Key</code> (from [[Data:AbilityCards.json]]); <code>ability_num</code> is its slot (1–4).
Returns the rail HTML for one ability, or an empty string when the ability matches no lists.


== Configuration ==
== Configuration ==


=== <code>CONFIG</code> ===
=== <code>CONFIG</code> ===
Ordered list of the icons the rail can show; order here is the display order. Each entry:
List of the icons the rail can show. Order within <code>CONFIG</code> does not affect the rendered output — see [[#Display order|Display order]]. Each entry:


{| class="wikitable"
{| class="wikitable"
Line 20: Line 23:
| <code>list</code> || List name in [[Module:AbilityTable/Lists]] whose membership triggers the icon.
| <code>list</code> || List name in [[Module:AbilityTable/Lists]] whose membership triggers the icon.
|-
|-
| <code>file</code> || Image file to display, e.g. <code>Reactive Barrier.png</code>.
| <code>file</code> || Image file to display, e.g. <code>Reactive Barrier.png</code>. Also determines the icon's position in the rail.
|-
|-
| <code>tip</code> || Hover tooltip text. May contain wikilinks and simple HTML (<code><nowiki><br></nowiki></code>, <code><nowiki><b></nowiki></code>).
| <code>tip</code> || Hover tooltip text. May contain wikilinks and simple HTML (<code><nowiki><br></nowiki></code>, <code><nowiki><b></nowiki></code>).
|}
|}


To add an icon, add a <code>CONFIG</code> row: pick the triggering <code>list</code>, the display <code>file</code>, and the <code>tip</code>. The <code>file</code> is arbitrary — it need not correspond to a single item. To re-scope which abilities an icon covers, edit the list in [[Module:AbilityTable/Lists]].
To add an icon, add a <code>CONFIG</code> row: pick the triggering <code>list</code>, the display <code>file</code>, and the <code>tip</code>. To re-scope which abilities an icon covers, edit the list in [[Module:AbilityTable/Lists]].
 
== See also ==
* [[Module:AbilitySection]] — renders the rail into the ability section
* [[Module:AbilityTable]] — provides <code>is_member</code> and the lists
* [[Template:AbilitySection/styles.css]] — rail and tooltip styling

Latest revision as of 22:54, 15 July 2026

Overview

[edit source]

Renders a small strip of item icons showing how an ability interacts with items and used by Module:AbilitySection. Each icon displays a configured image and has a hover tooltip.

Hints can be "automatic" and "manual".

  • Automatic come from Module:AbilityTable/Lists. If an ability is part of 'debuffresist' list, then it will show automatic debuff resist hint. List of enabled automatic hints is configured through CONFIG in this module. Clicking on an icon does nothing, however tooltip often will have a link to relevant item/mechanic.
  • Manual hints come from {{AbilityInteraction}} blocks used on AbilitySection. Whenetever an editor describes an interaction using that block a hint will be displayed. Clicking on a hint reveals that hand-written block.

Entry point

[edit source]

p.get_icons(ability_key, ability_num)

[edit source]

Returns the rail HTML for one ability, or an empty string when the ability matches no lists.

Configuration

[edit source]

CONFIG

[edit source]

List of the icons the rail can show. Order within CONFIG does not affect the rendered output — see Display order. Each entry:

Field Description
list List name in Module:AbilityTable/Lists whose membership triggers the icon.
file Image file to display, e.g. Reactive Barrier.png. Also determines the icon's position in the rail.
tip Hover tooltip text. May contain wikilinks and simple HTML (<br>, <b>).

To add an icon, add a CONFIG row: pick the triggering list, the display file, and the tip. To re-scope which abilities an icon covers, edit the list in Module:AbilityTable/Lists.