Editing Module:AbilityHints/doc

Warning: You are not logged in. Once you make an edit, a temporary account will be created for you. Learn more. Log in or create an account to continue receiving notifications after this account expires, and to access other features.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision Your text
Line 1: Line 1:
== Overview ==
== Overview ==


Renders a small strip of item icons showing how an ability interacts with items and used by [[Module:AbilitySection]].  
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, links to a configured URL, and has a hover tooltip.
Each icon displays a configured image and has a hover tooltip.


Hints can be "automatic" and "manual".
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).
* 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.
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).


== Configuration ==
== Configuration ==


=== <code>CONFIG</code> ===
=== <code>CONFIG</code> ===
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:
Ordered list of the icons the rail can show; order here is the display order. Each entry:


{| class="wikitable"
{| class="wikitable"
Line 23: Line 20:
| <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>. Also determines the icon's position in the rail.
| <code>file</code> || Image file to display, e.g. <code>Reactive Barrier.png</code>.
|-
|-
| <code>tip</code> || Hover tooltip text. May contain wikilinks and simple HTML (<code><nowiki><br></nowiki></code>, <code><nowiki><b></nowiki></code>).
| <code>link</code> || URL opened when the icon is clicked. Use a full/absolute URL (e.g. <code>https://deadlock.wiki/Reactive_Barrier</code>): an absolute URL keeps the anchor title-less, so [[mw:Extension:Popups|Page Previews]] ignores it. A bare page name would re-introduce the preview popup.
|-
| <code>tip</code> || Hover tooltip text. May contain 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>. 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>, the click <code>link</code>, and the <code>tip</code>. The <code>file</code> and <code>link</code> are arbitrary — they need not correspond to a single item. 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
Please note that all contributions to The Deadlock Wiki are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see Deadlock:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!
Cancel Editing help (opens in new window)
Preview page with this template

Page included on this page: