Template:PortalRequirementsTable/row: Difference between revisions
From IdleOn MMO Wiki
m (Readded some noinclude formatting) |
m (Slightly reworded text if there is no area behind a portal req) |
||
Line 2: | Line 2: | ||
{{#vardefine:rowspan|{{#if:{{{portalreq3|}}}|3|{{#if:{{{portalreq2|}}}|2|1}}}}}} | {{#vardefine:rowspan|{{#if:{{{portalreq3|}}}|3|{{#if:{{{portalreq2|}}}|2|1}}}}}} | ||
{{#vardefine:requirementicon|{{#if:{{{skillname|}}}|{{{skillname}}} Skill Icon.png|Boss Skull.png}}}} | {{#vardefine:requirementicon|{{#if:{{{skillname|}}}|{{{skillname}}} Skill Icon.png|Boss Skull.png}}}} | ||
{{#vardefine:noareatext| | {{#vardefine:noareatext|A portal doesn't exist, or it is hidden/doesn't lead anywhere (except maybe back to town)}} | ||
|- | |- | ||
|rowspan={{#var:rowspan}}|[[Worlds#{{{area}}}|{{{area}}}]] ||rowspan={{#var:rowspan}}|{{#arraymap:{{{targets}}}|,|a|[[File:{{#if:{{{skillname|}}}|a.png|a Idle.gif}}|30px]]|\s}} ||{{#if:{{{portalreq1|}}}|[[File:{{#var:requirementicon}}|30px]]{{Numdisplay|{{{portalreq1}}}}}}} ||{{#if:{{{portalreq1|}}}|{{#if:{{{portalarea1|}}}|[[Worlds#{{{portalarea1}}}|{{{portalarea1}}}]]|{{#var:noareatext}}}} {{#if:{{{portalreq2|}}}|{{|-|}}[[File:{{#var:requirementicon}}|30px]]{{Numdisplay|{{{portalreq2}}}}} {{|-|}}{{#if:{{{portalarea2|}}}|[[Worlds#{{{portalarea2}}}|{{{portalarea2}}}]]|{{#var:noareatext}}}}}} {{#if:{{{portalreq3|}}}|{{|-|}}[[File:{{#var:requirementicon}}|30px]]{{Numdisplay|{{{portalreq3}}}}} {{|-|}}{{#if:{{{portalarea3|}}}|[[Worlds#{{{portalarea3}}}|{{{portalarea3}}}]]|{{#var:noareatext}}}}}}</includeonly><noinclude>Note: Currently uses static portal variables (rather than one comma-separated one), as the table uses formatting which requires knowledge of how many entries there are to display. Template could be refactored by either adding that information as a parameter, or by installing array-extensions, which would allow for functions like #arraydefine and #arrayindex to determine the size dynamically.<pre> | |rowspan={{#var:rowspan}}|[[Worlds#{{{area}}}|{{{area}}}]] ||rowspan={{#var:rowspan}}|{{#arraymap:{{{targets}}}|,|a|[[File:{{#if:{{{skillname|}}}|a.png|a Idle.gif}}|30px]]|\s}} ||{{#if:{{{portalreq1|}}}|[[File:{{#var:requirementicon}}|30px]]{{Numdisplay|{{{portalreq1}}}}}}} ||{{#if:{{{portalreq1|}}}|{{#if:{{{portalarea1|}}}|[[Worlds#{{{portalarea1}}}|{{{portalarea1}}}]]|{{#var:noareatext}}}} {{#if:{{{portalreq2|}}}|{{|-|}}[[File:{{#var:requirementicon}}|30px]]{{Numdisplay|{{{portalreq2}}}}} {{|-|}}{{#if:{{{portalarea2|}}}|[[Worlds#{{{portalarea2}}}|{{{portalarea2}}}]]|{{#var:noareatext}}}}}} {{#if:{{{portalreq3|}}}|{{|-|}}[[File:{{#var:requirementicon}}|30px]]{{Numdisplay|{{{portalreq3}}}}} {{|-|}}{{#if:{{{portalarea3|}}}|[[Worlds#{{{portalarea3}}}|{{{portalarea3}}}]]|{{#var:noareatext}}}}}}</includeonly><noinclude>Note: Currently uses static portal variables (rather than one comma-separated one), as the table uses formatting which requires knowledge of how many entries there are to display. Template could be refactored by either adding that information as a parameter, or by installing array-extensions, which would allow for functions like #arraydefine and #arrayindex to determine the size dynamically.<pre> |
Revision as of 22:52, 29 May 2023
Note: Currently uses static portal variables (rather than one comma-separated one), as the table uses formatting which requires knowledge of how many entries there are to display. Template could be refactored by either adding that information as a parameter, or by installing array-extensions, which would allow for functions like #arraydefine and #arrayindex to determine the size dynamically.
Usage: If portal area variables are ommitted, while a req is set, an infotext regarding hidden portals/portals without target will be displayed instead. {{PortalRequirementsTable/row |area=example |targets=example or example,example (has to differentiate between enemies using idle gifs and skilling nodes using pngs |skillname=example (Optional, if empty assumes the row to represent portals requiring killcounts rather than skill level) |portalreq1=example (Optional) |portalarea1=example (Optional) |portalreq2=example (Optional) |portalarea2=example (Optional) |portalreq3=example (Optional) |portalarea3=example (Optional) }}