Module:ItemData/nav/doc: Difference between revisions

From The Deadlock Wiki
Jump to navigation Jump to search
Sur (talk | contribs)
m write_item_slot_subgroup initial
Sur (talk | contribs)
m write_item_slot_subgroup added type parameter
Line 51: Line 51:
===Parameters===
===Parameters===
* '''slot''' - Slot/category to create the subgroup for, ie Weapon, Armor, or Tech
* '''slot''' - Slot/category to create the subgroup for, ie Weapon, Armor, or Tech
* '''type''' - The subfunction to call that determines the list formatting style. Options are 'get_item_nav_bulletpoints' or 'get_item_nav_cards'
* '''debug_mode''' - (OPTIONAL) - if set to 'true', the wikitext is unprocessed, allowing for it to be read more clearly. Also used for showcasing the documentation examples more clearly.
* '''debug_mode''' - (OPTIONAL) - if set to 'true', the wikitext is unprocessed, allowing for it to be read more clearly. Also used for showcasing the documentation examples more clearly.


===Examples===
===Examples===
With debug_mode on (for illustration purposes)
With debug_mode on (for illustration purposes)
<code><nowiki>{{#invoke:ItemData/nav|write_item_slot_subgroup|Weapon|debug_mode=true}}</nowiki></code>
<code><nowiki>{{#invoke:ItemData/nav|write_item_slot_subgroup|Weapon|get_item_nav_bulletpoints|debug_mode=true}}</nowiki></code>


{{#invoke:ItemData/nav|write_item_slot_subgroup|Weapon|debug_mode=true}}
{{#invoke:ItemData/nav|write_item_slot_subgroup|Weapon|get_item_nav_bulletpoints|debug_mode=true}}




With debug_mode off
With debug_mode off
<code><nowiki>{{#invoke:ItemData/nav|write_item_slot_subgroup|Weapon}}</nowiki></code>
<code><nowiki>{{#invoke:ItemData/nav|write_item_slot_subgroup|Weapon|get_item_nav_bulletpoints}}</nowiki></code>


{{#invoke:ItemData/nav|write_item_slot_subgroup|Weapon}}
{{#invoke:ItemData/nav|write_item_slot_subgroup|Weapon|get_item_nav_bulletpoints}}


Recall that it adds subgroup parameters for the mentioned templates.
Recall that it creates subgroup parameters for the mentioned templates.

Revision as of 18:21, 1 November 2024

Overview

Functions for creating navigation boxes/lists for items, grouped by a slot/category and souls

Functions

get_item_nav_bulletpoints

Gets a list of items that are each sent to the Template:ItemIcon template, separated by bullet points.

Filters down to a slot/specific category, and within a range of souls.

Parameters

  • slot - Slot/category that the items should be, should be Weapon, Armor, or Tech
  • min_souls - Minimum souls that the items should have
  • max_souls - Maximum souls that the items should have
  • debug_mode - (OPTIONAL) - if set to 'true', the wikitext is unprocessed, allowing for it to be read more clearly. Also used for showcasing the documentation examples more clearly.

Examples

With debug_mode on (for illustration purposes) {{#invoke:ItemData/nav|get_item_nav_bulletpoints|Armor|1250|3000|debug_mode=true}}

{{ItemIcon|Battle Vest|size=26px}}{{ItemIcon|Bullet Lifesteal|size=26px}}{{ItemIcon|Debuff Reducer|size=26px}}{{ItemIcon|Enchanter's Emblem|size=26px}}{{ItemIcon|Enduring Speed|size=26px}}{{ItemIcon|Guardian Ward|size=26px}}{{ItemIcon|Healbane|size=26px}}{{ItemIcon|Healing Booster|size=26px}}{{ItemIcon|Reactive Barrier|size=26px}}{{ItemIcon|Restorative Locket|size=26px}}{{ItemIcon|Return Fire|size=26px}}{{ItemIcon|Spirit Lifesteal|size=26px}}{{ItemIcon|Spirit Shielding|size=26px}}{{ItemIcon|Trophy Collector|size=26px}}{{ItemIcon|Weapon Shielding|size=26px}}


With debug_mode off {{#invoke:ItemData/nav|get_item_nav_bulletpoints|Armor|1250|3000}}

Battle Vest Bullet Lifesteal Debuff Reducer Enchanter's Emblem Enduring Speed Guardian Ward Healbane Healing Booster Reactive Barrier Restorative Locket Return Fire Spirit Lifesteal Spirit Shielding Trophy Collector Weapon Shielding

get_item_nav_cards

Gets a list of items that are each sent to the Template:ItemBox template, separated by space.

Filters down to a specific slot/category, and within a range of souls.

Parameters

Same as get_item_nav_bulletpoints

Examples

With debug_mode on (for illustration purposes) {{#invoke:ItemData/nav|get_item_nav_bulletpoints|Armor|1250|3000|debug_mode=true}}

{{ItemBox|itemName=Battle Vest|overrideLinkClick=Battle Vest|lowGraphics=true}} {{ItemBox|itemName=Bullet Lifesteal|overrideLinkClick=Bullet Lifesteal (item)|lowGraphics=true}} {{ItemBox|itemName=Debuff Reducer|overrideLinkClick=Debuff Reducer|lowGraphics=true}} {{ItemBox|itemName=Enchanter's Emblem|overrideLinkClick=Enchanter's Emblem|lowGraphics=true}} {{ItemBox|itemName=Enduring Speed|overrideLinkClick=Enduring Speed|lowGraphics=true}} {{ItemBox|itemName=Guardian Ward|overrideLinkClick=Guardian Ward|lowGraphics=true}} {{ItemBox|itemName=Healbane|overrideLinkClick=Healbane|lowGraphics=true}} {{ItemBox|itemName=Healing Booster|overrideLinkClick=Healing Booster|lowGraphics=true}} {{ItemBox|itemName=Reactive Barrier|overrideLinkClick=Reactive Barrier|lowGraphics=true}} {{ItemBox|itemName=Restorative Locket|overrideLinkClick=Restorative Locket|lowGraphics=true}} {{ItemBox|itemName=Return Fire|overrideLinkClick=Return Fire|lowGraphics=true}} {{ItemBox|itemName=Spirit Lifesteal|overrideLinkClick=Spirit Lifesteal (item)|lowGraphics=true}} {{ItemBox|itemName=Spirit Shielding|overrideLinkClick=Spirit Shielding|lowGraphics=true}} {{ItemBox|itemName=Trophy Collector|overrideLinkClick=Trophy Collector|lowGraphics=true}} {{ItemBox|itemName=Weapon Shielding|overrideLinkClick=Weapon Shielding|lowGraphics=true}}


With debug_mode off {{#invoke:ItemData/nav|get_item_nav_bulletpoints|Armor|1250|3000}}

Imbue

Battle Vest

Active
Imbue

Bullet Lifesteal

Active
Imbue

Debuff Reducer

Active
Imbue

Enchanter's Emblem

Active
Imbue

Enduring Speed

Active
Imbue

Guardian Ward

Active
Imbue

Healbane

Active
Imbue

Healing Booster

Active
Imbue

Reactive Barrier

Active
Imbue

Restorative Locket

Active
Imbue

Return Fire

Active
Imbue

Spirit Lifesteal

Active
Imbue

Spirit Shielding

Active
Imbue

Trophy Collector

Active
Imbue

Weapon Shielding

Active

write_item_slot_subgroup

Writes a sub group for the navbox on Template:Item Navbox and Template:Infobox ShopItems. The sub group contains all items in each price range from "ItemPricePerTier" in Data:GenericData.json

Parameters

  • slot - Slot/category to create the subgroup for, ie Weapon, Armor, or Tech
  • type - The subfunction to call that determines the list formatting style. Options are 'get_item_nav_bulletpoints' or 'get_item_nav_cards'
  • debug_mode - (OPTIONAL) - if set to 'true', the wikitext is unprocessed, allowing for it to be read more clearly. Also used for showcasing the documentation examples more clearly.

Examples

With debug_mode on (for illustration purposes) {{#invoke:ItemData/nav|write_item_slot_subgroup|Weapon|get_item_nav_bulletpoints|debug_mode=true}}


With debug_mode off {{#invoke:ItemData/nav|write_item_slot_subgroup|Weapon|get_item_nav_bulletpoints}}

Recall that it creates subgroup parameters for the mentioned templates.