From Dark and Darker Wiki
(template to filter weapons) |
(changed comma) |
||
Line 5: | Line 5: | ||
| 0 <!-- loops start value for {{ #var:i }} --> | | 0 <!-- loops start value for {{ #var:i }} --> | ||
| {{ #arraysize:weapons }} <!-- number of loops --> | | {{ #arraysize:weapons }} <!-- number of loops --> | ||
| <nowiki/>{{#vardefine:currentweapon|{{ #arrayindex:weapons | {{ #var:i }} }}}}{{#if:{{#pos:{{Weapon_Data|{{#var:currentweapon}}|{{{filtercategory}}}}}|{{{filterkey}}}}}|{{#ifeq:{{ #var:first }}|true|{{#vardefine:first|false}}| | | <nowiki/>{{#vardefine:currentweapon|{{ #arrayindex:weapons | {{ #var:i }} }}}}{{#if:{{#pos:{{Weapon_Data|{{#var:currentweapon}}|{{{filtercategory}}}}}|{{{filterkey}}}}}|{{#ifeq:{{ #var:first }}|true|{{#vardefine:first|false}}| • }}[[{{#var:currentweapon}}]]}} | ||
}} | }} | ||
</includeonly><noinclude>Loops through all weapons, filters them according to "filtercategory" and "filterkey" | </includeonly><noinclude>Loops through all weapons, filters them according to "filtercategory" and "filterkey" |
Latest revision as of 19:36, 30 August 2023
Loops through all weapons, filters them according to "filtercategory" and "filterkey"
Examples
Code | Preview |
---|---|
{{FilterWeapons |filtercategory = classes |filterkey = Bard }} |
|
{{FilterWeapons |filtercategory = weapontype |filterkey = Axe }} |
|
No description.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Variable name to call from Weapon_Data | filtercategory | Filter Category
| String | required |
Key to be searched in the variable pulled from Weapon_Data | filterkey | Filter Key
| String | required |