Module:Icon/doc: Difference between revisions

From The Deadlock Wiki
Jump to navigation Jump to search
LVL (talk | contribs)
Added explanation about legacyitems
m mc
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
Main module for rendering game icons (heroes, abilities, and items).
Main module for rendering game icons.


'''Note: This module is not intended for direct use.''' Use the templates below.
'''Note: This module is not intended for direct use.''' Use the templates below.


== Data Sources ==
== Data sources ==
The module reads from [[Data:ResourceLookup.json]], a pre-indexed lookup table generated by [[User:Deadbot|Deadbot]] at deploy time. When the bot uploads new game files, icons update automatically.
The module reads from [[Data:ResourceLookup.json]], a pre-indexed lookup table generated by [[User:Deadbot|Deadbot]] at deploy time. When the bot uploads new game files, hero, ability, and item icons update automatically.


=== Legacy Items ===
An additional resource for other icons can be found at [[Data:ResourceLookup2.json]], a manually maintained table; some entries may rely on a dictionary key.
Items that have been removed from the game files but still exist on the wiki (e.g., in "Unused" sections) are stored in a local <code>legacyItems</code> table within the module. This ensures icons for historical items continue to render correctly even after the bot removes them from the data JSON.


To add a new legacy item, edit the <code>legacyItems</code> table in [[Module:Icon]].
See [[Module:Icon/data]] for manual overrides, legacy items, aliases, and renames used by this module.


== Usage ==
== Usage ==
Any of these templates work for any icon type (hero, ability, or item). The module auto-detects the type:
Any of the following templates can be used. The module automatically detects the icon type:
* {{tl|HeroIcon}}
* {{tl|AbilityIcon}}
* {{tl|ItemIcon}}
* {{tl|EntityIcon}}


* {{tl|HeroIcon}} - Can display heroes, abilities, or items
'''Note:''' While all four templates work identically, it is recommended to use the appropriate one for clarity (e.g., use <nowiki>{{AbilityIcon|Siphon Life}}</nowiki> even though <nowiki>{{HeroIcon|Siphon Life}}</nowiki> will also work).
* {{tl|AbilityIcon}} - Can display heroes, abilities, or items 
* {{tl|ItemIcon}} - Can display heroes, abilities, or items


'''Note:''' While all three templates work identically, you can use whichever name makes the wiki source code more readable (e.g., use <nowiki>{{AbilityIcon|Siphon Life}}</nowiki> for clarity even though <nowiki>{{HeroIcon|Siphon Life}}</nowiki> works the same).
== Error tracking ==
 
Icons that fail to render are added to [[:Category:Module:Icon ERROR]].
== Error Tracking ==
<includeonly>[[Category:Modules]]</includeonly><noinclude>[[Category:Module documentation]]</noinclude>
Icons that fail to render are tracked in: [[:Category:Module:Icon ERROR]]
 
== Aliases ==
Some icons have alternate names that redirect to the correct entry:
* "Doorman" → "The Doorman"
* "Mo and Krill" / "Mo" / "Krill" → "Mo & Krill"
* "Curse" → "Cursed Relic"
* "Debuff Remover" → "Dispel Magic"
 
To add new aliases, edit the aliases table in [[Module:Icon]].

Latest revision as of 02:22, 23 May 2026

Main module for rendering game icons.

Note: This module is not intended for direct use. Use the templates below.

Data sources

[edit source]

The module reads from Data:ResourceLookup.json, a pre-indexed lookup table generated by Deadbot at deploy time. When the bot uploads new game files, hero, ability, and item icons update automatically.

An additional resource for other icons can be found at Data:ResourceLookup2.json, a manually maintained table; some entries may rely on a dictionary key.

See Module:Icon/data for manual overrides, legacy items, aliases, and renames used by this module.

Any of the following templates can be used. The module automatically detects the icon type:

Note: While all four templates work identically, it is recommended to use the appropriate one for clarity (e.g., use {{AbilityIcon|Siphon Life}} even though {{HeroIcon|Siphon Life}} will also work).

Error tracking

[edit source]

Icons that fail to render are added to Category:Module:Icon ERROR.