Template:PortalRequirementsTable/row: Difference between revisions

From IdleOn MMO Wiki
mNo edit summary
mNo edit summary
 
(18 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<includeonly>{{#vardefine:rowspan|{{#if:{{{portalreq3|}}}|3|{{#if:{{{portalreq2|}}}|2|1}}}}}}{{#vardefine:requirementicon|[[File:{{#if:{{{skillname|}}}|{{{skillname}}} Skill Icon.png|Boss Skull.png}}|30px]]}}{{#vardefine:noareatext|This portal connects to nothing, or returns to a random default location.}}|-
<includeonly><tr>
|rowspan={{#var:rowspan}}|[[Worlds#{{{area}}}|{{{area}}}]]
<td rowspan='{{#vardefineecho:rowspan|{{#expr:{{#count:{{{portalreqs|}}}|,}} + 1}}}}'>[[Worlds#{{{area}}}|{{{area}}}]]</td>
|rowspan={{#var:rowspan}}|{{#if:{{{skillname|}}}|{{#arraymap:{{{targets}}}|,|a|[[File:a.png|30px]]|\n}}|{{#arraymap:{{{targets}}}|,|a|[[File:a Idle.gif|30px]]|\n}}}}
<td rowspan='{{#var:rowspan}}'>{{#if:{{{skillname|}}}|{{#arraymap:{{{targets}}}|,|a|[[File:a.png|30px]]|\s}}|{{#arraymap:{{{targets}}}|,|a|[[File:a Idle.gif|30px]]|\n}}}}</td>
{{#invoke:Loops|parseLoop
<td rowspan='{{#var:rowspan}}'>{{#if:{{{skillname|}}}|—|{{{mobAmount|}}}}}</td>
|list1={{{portalreqs|}}}
{{#invoke:Loops|portalRowLoop
|list2={{{portalareas|}}}
|reqs={{{portalreqs|}}}
|replaceString=<td>{{#var:requirementicon}} {{Numdisplay|(1)}}</td><td>{{#ifeq:|NULL|{{#var:noareatext}}|[[Worlds#(2)|(2)]]}}</td>
|areas={{{portalareas|}}}
|returnDelimiter=</tr><tr>
|icon={{{skillname|Boss}}}
}}</tr><!--
}}</tr></includeonly><noinclude><pre>
{{#if:{{{portalreq1|}}}|{{#var:requirementicon}} {{Numdisplay|{{{portalreq1}}}}}}}
|{{#if:{{{portalreq1|}}}|
  {{#if:{{{portalarea1|}}}|[[Worlds#{{{portalarea1}}}|{{{portalarea1}}}]]|{{#var:noareatext}}}}
  {{#if:{{{portalreq2|}}}|{{|-|}}{{#var:requirementicon}}{{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>


Usage:
Usage:
Line 23: Line 16:
|targets=example or example,example (has to differentiate between enemies using idle gifs and skilling nodes using pngs
|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)
|skillname=example (Optional, if empty assumes the row to represent portals requiring killcounts rather than skill level)
|portalreq1=example (Optional)
|portalreqs=example,list
|portalarea1=example (Optional)
|portalareas=example,list
|portalreq2=example (Optional)
|portalarea2=example (Optional)
|portalreq3=example (Optional)
|portalarea3=example (Optional)
}}
}}
</pre>[[Category:Table templates]]</noinclude>
</pre>[[Category:Table templates]]</noinclude>

Latest revision as of 01:42, 12 March 2024


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)
|portalreqs=example,list
|portalareas=example,list
}}