User:Tiddlywinks/fa-row: Difference between revisions

From Bulbapedia, the community-driven Pokémon encyclopedia.
Jump to navigationJump to search
(Well that's kinda inconvenient, expr can't resolve templates...)
(Forgot, wikis are weird...parameters are substituted not resolved "logically". I think I've figured out alternate logic, though)
Line 1: Line 1:
{{#ifeq: {{{2|ELEPHINO}}} | ELEPHINO<!--No info for {1} (ndex)--> ||
{{#ifeq: {{User:Tiddlywinks/FormImageData|{{{1|0}}}|name}} | ELEPHINO<!--No info for {1} (ndex)--> ||
  {{#ifexpr: {{{2|ELEPHINO}}} - {{{start|0}}} < 1 <!-- There must be at least one unprinted form --> |
  {{#ifeq: {{#ifexpr: {{{start|0}}} = 0 | pass | fail }}{{#if: {{User:Tiddlywinks/FormImageData|{{{1|0}}}|form|{{{start|0}}}}} | pass | fail }} | failfail <!--Check if {start} has form data to print by checking form name. It's often empty for 0, so auto-pass on that. Only fail if index is non-0 AND name is empty (failfail).-->||
   {{#ifexpr: {{{start|0}}} = 0 <!-- We definitely need to print at least one row... If it's the first one, add the species data --> |
   {{#ifexpr: {{{start|0}}} = 0 <!-- We definitely need to print at least one row... If it's the first one, add the species data --> |
{{!}}-
{{!}}-
{{!}} rowspan="{{{2|ELEPHINO}}}" {{!}} {{padleft:{{{1|0}}}|4|0}}
{{!}} rowspan="{{User:Tiddlywinks/FormImageData|{{{1|0}}}|formcount}}" {{!}} {{padleft:{{{1|0}}}|4|0}}
{{!}} rowspan="{{{2|ELEPHINO}}}" {{!}} {{User:Tiddlywinks/FormImageData|{{{1|0}}}|name}}
{{!}} rowspan="{{User:Tiddlywinks/FormImageData|{{{1|0}}}|formcount}}" {{!}} {{User:Tiddlywinks/FormImageData|{{{1|0}}}|name}}
{{!}} rowspan="{{{2|ELEPHINO}}}" {{!}} {{{2|ELEPHINO}}}
{{!}} rowspan="{{User:Tiddlywinks/FormImageData|{{{1|0}}}|formcount}}" {{!}} {{User:Tiddlywinks/FormImageData|{{{1|0}}}|formcount}}
{{!}} 0 {{!}}{{!}} {{User:Tiddlywinks/FormImageData|{{{1|0}}}|form|0}} {{!}}{{!}} {{User:Tiddlywinks/FormImageData|{{{1|0}}}|ms|0}} {{!}}{{!}} {{{{{ms|MS/6}}}|{{padleft:{{{1|0}}}|{{{padding|3}}}|0}}|form={{User:Tiddlywinks/FormImageData|{{{1|0}}}|ms|0}} }} {{!}}{{!}} {{User:Tiddlywinks/FormImageData|{{{1|0}}}|art|0}} {{!}}{{!}} {{Art|{{padleft:{{{1|0}}}|4|0}}|{{User:Tiddlywinks/FormImageData|{{{1|0}}}|name}}|form={{User:Tiddlywinks/FormImageData|{{{1|0}}}|art|0}} }}
{{!}} 0 {{!}}{{!}} {{User:Tiddlywinks/FormImageData|{{{1|0}}}|form|0}} {{!}}{{!}} {{User:Tiddlywinks/FormImageData|{{{1|0}}}|ms|0}} {{!}}{{!}} {{{{{ms|MS/6}}}|{{padleft:{{{1|0}}}|{{{padding|3}}}|0}}|form={{User:Tiddlywinks/FormImageData|{{{1|0}}}|ms|0}} }} {{!}}{{!}} {{User:Tiddlywinks/FormImageData|{{{1|0}}}|art|0}} {{!}}{{!}} {{Art|{{padleft:{{{1|0}}}|4|0}}|{{User:Tiddlywinks/FormImageData|{{{1|0}}}|name}}|form={{User:Tiddlywinks/FormImageData|{{{1|0}}}|art|0}} }}
{{!}} rowspan="{{{2|ELEPHINO}}}" {{!}} {{User:Tiddlywinks/FormImageData|{{{1|0}}}|notes}}|
{{!}} rowspan="{{User:Tiddlywinks/FormImageData|{{{1|0}}}|formcount}}" {{!}} {{User:Tiddlywinks/FormImageData|{{{1|0}}}|notes}}|
{{!}} {{{start}}} {{!}}{{!}} {{User:Tiddlywinks/FormImageData|{{{1|0}}}|form|{{{start}}}}} {{!}}{{!}} {{User:Tiddlywinks/FormImageData|{{{1|0}}}|ms|{{{start}}}}} {{!}}{{!}} {{{{{ms|MS/6}}}|{{padleft:{{{1|0}}}|{{{padding|3}}}|0}}|form={{User:Tiddlywinks/FormImageData|{{{1|0}}}|ms|{{{start}}}}} }} {{!}}{{!}} {{User:Tiddlywinks/FormImageData|{{{1|0}}}|art|{{{start}}}}} {{!}}{{!}} {{Art|{{padleft:{{{1|0}}}|4|0}}|{{User:Tiddlywinks/FormImageData|{{{1|0}}}|name}}|form={{User:Tiddlywinks/FormImageData|{{{1|0}}}|art|{{{start}}}}} }} }}
{{!}} {{{start}}} {{!}}{{!}} {{User:Tiddlywinks/FormImageData|{{{1|0}}}|form|{{{start}}}}} {{!}}{{!}} {{User:Tiddlywinks/FormImageData|{{{1|0}}}|ms|{{{start}}}}} {{!}}{{!}} {{{{{ms|MS/6}}}|{{padleft:{{{1|0}}}|{{{padding|3}}}|0}}|form={{User:Tiddlywinks/FormImageData|{{{1|0}}}|ms|{{{start}}}}} }} {{!}}{{!}} {{User:Tiddlywinks/FormImageData|{{{1|0}}}|art|{{{start}}}}} {{!}}{{!}} {{Art|{{padleft:{{{1|0}}}|4|0}}|{{User:Tiddlywinks/FormImageData|{{{1|0}}}|name}}|form={{User:Tiddlywinks/FormImageData|{{{1|0}}}|art|{{{start}}}}} }} }}
   {{#switch: {{#expr: {{{2|ELEPHINO}}} - {{{start|0}}} }} <!-- At this point, we know that max-start >= 1; if it's 2, 3, or 4, do those and return; else do the rest of the batch and recurse-->
   {{#if: {{User:Tiddlywinks/FormImageData|{{{1|0}}}|form|{{#expr: {{{start}}} + 1}}}}<!-- If the next form has a name, print it. AND if the following form has a name...etc -->|
  |2=
{{!}} {{#expr: {{{start}}} + 1}} {{!}}{{!}} {{User:Tiddlywinks/FormImageData|{{{1|0}}}|form|{{#expr: {{{start}}} + 1}}}} {{!}}{{!}} {{User:Tiddlywinks/FormImageData|{{{1|0}}}|ms|{{#expr: {{{start}}} + 1}}}} {{!}}{{!}} {{{{{ms|MS/6}}}|{{padleft:{{{1|0}}}|{{{padding|3}}}|0}}|form={{User:Tiddlywinks/FormImageData|{{{1|0}}}|ms|{{#expr: {{{start}}} + 1}}}} }} {{!}}{{!}} {{User:Tiddlywinks/FormImageData|{{{1|0}}}|art|{{#expr: {{{start}}} + 1}}}} {{!}}{{!}} {{Art|{{padleft:{{{1|0}}}|4|0}}|{{User:Tiddlywinks/FormImageData|{{{1|0}}}|name}}|form={{User:Tiddlywinks/FormImageData|{{{1|0}}}|art|{{#expr: {{{start}}} + 1}}}} }}
  |3=
{{!}} {{#expr: {{{start}}} + 1}} {{!}}{{!}} {{User:Tiddlywinks/FormImageData|{{{1|0}}}|form|{{#expr: {{{start}}} + 1}}}} {{!}}{{!}} {{User:Tiddlywinks/FormImageData|{{{1|0}}}|ms|{{#expr: {{{start}}} + 1}}}} {{!}}{{!}} {{{{{ms|MS/6}}}|{{padleft:{{{1|0}}}|{{{padding|3}}}|0}}|form={{User:Tiddlywinks/FormImageData|{{{1|0}}}|ms|{{#expr: {{{start}}} + 1}}}} }} {{!}}{{!}} {{User:Tiddlywinks/FormImageData|{{{1|0}}}|art|{{#expr: {{{start}}} + 1}}}} {{!}}{{!}} {{Art|{{padleft:{{{1|0}}}|4|0}}|{{User:Tiddlywinks/FormImageData|{{{1|0}}}|name}}|form={{User:Tiddlywinks/FormImageData|{{{1|0}}}|art|{{#expr: {{{start}}} + 1}}}} }}
{{!}} {{#expr: {{{start}}} + 2}} {{!}}{{!}} {{User:Tiddlywinks/FormImageData|{{{1|0}}}|form|{{#expr: {{{start}}} + 2}}}} {{!}}{{!}} {{User:Tiddlywinks/FormImageData|{{{1|0}}}|ms|{{#expr: {{{start}}} + 2}}}} {{!}}{{!}} {{{{{ms|MS/6}}}|{{padleft:{{{1|0}}}|{{{padding|3}}}|0}}|form={{User:Tiddlywinks/FormImageData|{{{1|0}}}|ms|{{#expr: {{{start}}} + 2}}}} }} {{!}}{{!}} {{User:Tiddlywinks/FormImageData|{{{1|0}}}|art|{{#expr: {{{start}}} + 2}}}} {{!}}{{!}} {{Art|{{padleft:{{{1|0}}}|4|0}}|{{User:Tiddlywinks/FormImageData|{{{1|0}}}|name}}|form={{User:Tiddlywinks/FormImageData|{{{1|0}}}|art|{{#expr: {{{start}}} + 2}}}} }}
  |4=
{{!}} {{#expr: {{{start}}} + 1}} {{!}}{{!}} {{User:Tiddlywinks/FormImageData|{{{1|0}}}|form|{{#expr: {{{start}}} + 1}}}} {{!}}{{!}} {{User:Tiddlywinks/FormImageData|{{{1|0}}}|ms|{{#expr: {{{start}}} + 1}}}} {{!}}{{!}} {{{{{ms|MS/6}}}|{{padleft:{{{1|0}}}|{{{padding|3}}}|0}}|form={{User:Tiddlywinks/FormImageData|{{{1|0}}}|ms|{{#expr: {{{start}}} + 1}}}} }} {{!}}{{!}} {{User:Tiddlywinks/FormImageData|{{{1|0}}}|art|{{#expr: {{{start}}} + 1}}}} {{!}}{{!}} {{Art|{{padleft:{{{1|0}}}|4|0}}|{{User:Tiddlywinks/FormImageData|{{{1|0}}}|name}}|form={{User:Tiddlywinks/FormImageData|{{{1|0}}}|art|{{#expr: {{{start}}} + 1}}}} }}
{{!}} {{#expr: {{{start}}} + 2}} {{!}}{{!}} {{User:Tiddlywinks/FormImageData|{{{1|0}}}|form|{{#expr: {{{start}}} + 2}}}} {{!}}{{!}} {{User:Tiddlywinks/FormImageData|{{{1|0}}}|ms|{{#expr: {{{start}}} + 2}}}} {{!}}{{!}} {{{{{ms|MS/6}}}|{{padleft:{{{1|0}}}|{{{padding|3}}}|0}}|form={{User:Tiddlywinks/FormImageData|{{{1|0}}}|ms|{{#expr: {{{start}}} + 2}}}} }} {{!}}{{!}} {{User:Tiddlywinks/FormImageData|{{{1|0}}}|art|{{#expr: {{{start}}} + 2}}}} {{!}}{{!}} {{Art|{{padleft:{{{1|0}}}|4|0}}|{{User:Tiddlywinks/FormImageData|{{{1|0}}}|name}}|form={{User:Tiddlywinks/FormImageData|{{{1|0}}}|art|{{#expr: {{{start}}} + 2}}}} }}
{{!}} {{#expr: {{{start}}} + 3}} {{!}}{{!}} {{User:Tiddlywinks/FormImageData|{{{1|0}}}|form|{{#expr: {{{start}}} + 3}}}} {{!}}{{!}} {{User:Tiddlywinks/FormImageData|{{{1|0}}}|ms|{{#expr: {{{start}}} + 3}}}} {{!}}{{!}} {{{{{ms|MS/6}}}|{{padleft:{{{1|0}}}|{{{padding|3}}}|0}}|form={{User:Tiddlywinks/FormImageData|{{{1|0}}}|ms|{{#expr: {{{start}}} + 3}}}} }} {{!}}{{!}} {{User:Tiddlywinks/FormImageData|{{{1|0}}}|art|{{#expr: {{{start}}} + 3}}}} {{!}}{{!}} {{Art|{{padleft:{{{1|0}}}|4|0}}|{{User:Tiddlywinks/FormImageData|{{{1|0}}}|name}}|form={{User:Tiddlywinks/FormImageData|{{{1|0}}}|art|{{#expr: {{{start}}} + 3}}}} }}
  |
{{!}} {{#expr: {{{start}}} + 1}} {{!}}{{!}} {{User:Tiddlywinks/FormImageData|{{{1|0}}}|form|{{#expr: {{{start}}} + 1}}}} {{!}}{{!}} {{User:Tiddlywinks/FormImageData|{{{1|0}}}|ms|{{#expr: {{{start}}} + 1}}}} {{!}}{{!}} {{{{{ms|MS/6}}}|{{padleft:{{{1|0}}}|{{{padding|3}}}|0}}|form={{User:Tiddlywinks/FormImageData|{{{1|0}}}|ms|{{#expr: {{{start}}} + 1}}}} }} {{!}}{{!}} {{User:Tiddlywinks/FormImageData|{{{1|0}}}|art|{{#expr: {{{start}}} + 1}}}} {{!}}{{!}} {{Art|{{padleft:{{{1|0}}}|4|0}}|{{User:Tiddlywinks/FormImageData|{{{1|0}}}|name}}|form={{User:Tiddlywinks/FormImageData|{{{1|0}}}|art|{{#expr: {{{start}}} + 1}}}} }}
{{!}} {{#expr: {{{start}}} + 1}} {{!}}{{!}} {{User:Tiddlywinks/FormImageData|{{{1|0}}}|form|{{#expr: {{{start}}} + 1}}}} {{!}}{{!}} {{User:Tiddlywinks/FormImageData|{{{1|0}}}|ms|{{#expr: {{{start}}} + 1}}}} {{!}}{{!}} {{{{{ms|MS/6}}}|{{padleft:{{{1|0}}}|{{{padding|3}}}|0}}|form={{User:Tiddlywinks/FormImageData|{{{1|0}}}|ms|{{#expr: {{{start}}} + 1}}}} }} {{!}}{{!}} {{User:Tiddlywinks/FormImageData|{{{1|0}}}|art|{{#expr: {{{start}}} + 1}}}} {{!}}{{!}} {{Art|{{padleft:{{{1|0}}}|4|0}}|{{User:Tiddlywinks/FormImageData|{{{1|0}}}|name}}|form={{User:Tiddlywinks/FormImageData|{{{1|0}}}|art|{{#expr: {{{start}}} + 1}}}} }}
{{#if: {{User:Tiddlywinks/FormImageData|{{{1|0}}}|form|{{#expr: {{{start}}} + 2}}}}|
{{!}} {{#expr: {{{start}}} + 2}} {{!}}{{!}} {{User:Tiddlywinks/FormImageData|{{{1|0}}}|form|{{#expr: {{{start}}} + 2}}}} {{!}}{{!}} {{User:Tiddlywinks/FormImageData|{{{1|0}}}|ms|{{#expr: {{{start}}} + 2}}}} {{!}}{{!}} {{{{{ms|MS/6}}}|{{padleft:{{{1|0}}}|{{{padding|3}}}|0}}|form={{User:Tiddlywinks/FormImageData|{{{1|0}}}|ms|{{#expr: {{{start}}} + 2}}}} }} {{!}}{{!}} {{User:Tiddlywinks/FormImageData|{{{1|0}}}|art|{{#expr: {{{start}}} + 2}}}} {{!}}{{!}} {{Art|{{padleft:{{{1|0}}}|4|0}}|{{User:Tiddlywinks/FormImageData|{{{1|0}}}|name}}|form={{User:Tiddlywinks/FormImageData|{{{1|0}}}|art|{{#expr: {{{start}}} + 2}}}} }}
{{!}} {{#expr: {{{start}}} + 2}} {{!}}{{!}} {{User:Tiddlywinks/FormImageData|{{{1|0}}}|form|{{#expr: {{{start}}} + 2}}}} {{!}}{{!}} {{User:Tiddlywinks/FormImageData|{{{1|0}}}|ms|{{#expr: {{{start}}} + 2}}}} {{!}}{{!}} {{{{{ms|MS/6}}}|{{padleft:{{{1|0}}}|{{{padding|3}}}|0}}|form={{User:Tiddlywinks/FormImageData|{{{1|0}}}|ms|{{#expr: {{{start}}} + 2}}}} }} {{!}}{{!}} {{User:Tiddlywinks/FormImageData|{{{1|0}}}|art|{{#expr: {{{start}}} + 2}}}} {{!}}{{!}} {{Art|{{padleft:{{{1|0}}}|4|0}}|{{User:Tiddlywinks/FormImageData|{{{1|0}}}|name}}|form={{User:Tiddlywinks/FormImageData|{{{1|0}}}|art|{{#expr: {{{start}}} + 2}}}} }}
{{#if: {{User:Tiddlywinks/FormImageData|{{{1|0}}}|form|{{#expr: {{{start}}} + 3}}}}|
{{!}} {{#expr: {{{start}}} + 3}} {{!}}{{!}} {{User:Tiddlywinks/FormImageData|{{{1|0}}}|form|{{#expr: {{{start}}} + 3}}}} {{!}}{{!}} {{User:Tiddlywinks/FormImageData|{{{1|0}}}|ms|{{#expr: {{{start}}} + 3}}}} {{!}}{{!}} {{{{{ms|MS/6}}}|{{padleft:{{{1|0}}}|{{{padding|3}}}|0}}|form={{User:Tiddlywinks/FormImageData|{{{1|0}}}|ms|{{#expr: {{{start}}} + 3}}}} }} {{!}}{{!}} {{User:Tiddlywinks/FormImageData|{{{1|0}}}|art|{{#expr: {{{start}}} + 3}}}} {{!}}{{!}} {{Art|{{padleft:{{{1|0}}}|4|0}}|{{User:Tiddlywinks/FormImageData|{{{1|0}}}|name}}|form={{User:Tiddlywinks/FormImageData|{{{1|0}}}|art|{{#expr: {{{start}}} + 3}}}} }}
{{!}} {{#expr: {{{start}}} + 3}} {{!}}{{!}} {{User:Tiddlywinks/FormImageData|{{{1|0}}}|form|{{#expr: {{{start}}} + 3}}}} {{!}}{{!}} {{User:Tiddlywinks/FormImageData|{{{1|0}}}|ms|{{#expr: {{{start}}} + 3}}}} {{!}}{{!}} {{{{{ms|MS/6}}}|{{padleft:{{{1|0}}}|{{{padding|3}}}|0}}|form={{User:Tiddlywinks/FormImageData|{{{1|0}}}|ms|{{#expr: {{{start}}} + 3}}}} }} {{!}}{{!}} {{User:Tiddlywinks/FormImageData|{{{1|0}}}|art|{{#expr: {{{start}}} + 3}}}} {{!}}{{!}} {{Art|{{padleft:{{{1|0}}}|4|0}}|{{User:Tiddlywinks/FormImageData|{{{1|0}}}|name}}|form={{User:Tiddlywinks/FormImageData|{{{1|0}}}|art|{{#expr: {{{start}}} + 3}}}} }}
{{#if: {{User:Tiddlywinks/FormImageData|{{{1|0}}}|form|{{#expr: {{{start}}} + 4}}}}|
{{!}} {{#expr: {{{start}}} + 4}} {{!}}{{!}} {{User:Tiddlywinks/FormImageData|{{{1|0}}}|form|{{#expr: {{{start}}} + 4}}}} {{!}}{{!}} {{User:Tiddlywinks/FormImageData|{{{1|0}}}|ms|{{#expr: {{{start}}} + 4}}}} {{!}}{{!}} {{{{{ms|MS/6}}}|{{padleft:{{{1|0}}}|{{{padding|3}}}|0}}|form={{User:Tiddlywinks/FormImageData|{{{1|0}}}|ms|{{#expr: {{{start}}} + 4}}}} }} {{!}}{{!}} {{User:Tiddlywinks/FormImageData|{{{1|0}}}|art|{{#expr: {{{start}}} + 4}}}} {{!}}{{!}} {{Art|{{padleft:{{{1|0}}}|4|0}}|{{User:Tiddlywinks/FormImageData|{{{1|0}}}|name}}|form={{User:Tiddlywinks/FormImageData|{{{1|0}}}|art|{{#expr: {{{start}}} + 4}}}} }}
{{!}} {{#expr: {{{start}}} + 4}} {{!}}{{!}} {{User:Tiddlywinks/FormImageData|{{{1|0}}}|form|{{#expr: {{{start}}} + 4}}}} {{!}}{{!}} {{User:Tiddlywinks/FormImageData|{{{1|0}}}|ms|{{#expr: {{{start}}} + 4}}}} {{!}}{{!}} {{{{{ms|MS/6}}}|{{padleft:{{{1|0}}}|{{{padding|3}}}|0}}|form={{User:Tiddlywinks/FormImageData|{{{1|0}}}|ms|{{#expr: {{{start}}} + 4}}}} }} {{!}}{{!}} {{User:Tiddlywinks/FormImageData|{{{1|0}}}|art|{{#expr: {{{start}}} + 4}}}} {{!}}{{!}} {{Art|{{padleft:{{{1|0}}}|4|0}}|{{User:Tiddlywinks/FormImageData|{{{1|0}}}|name}}|form={{User:Tiddlywinks/FormImageData|{{{1|0}}}|art|{{#expr: {{{start}}} + 4}}}} }}
{{User:Tiddlywinks/fa-row|{{{1}}}|{{{2}}}|start={{#expr: {{{start}}} + 5}}}}
{{User:Tiddlywinks/fa-row|{{{1}}}|start={{#expr: {{{start}}} + 5}}}}
  }}
}} }} }} }}
  }}
  }}
}}<noinclude>
}}<noinclude>

Revision as of 03:20, 7 June 2023



This template reads all forms from User:Tiddlywinks/FormImageData for a given NDex and prints table rows for the data. (It reads the data in chunks of 5 and recurses if there is more data.)

Parameters

Unnamed
  • 1: NDex (note: if you're using ms for a pre-Gen IX image, only use 3 digits)
  • 2: the number of forms this species has
Named
  • ms (optional): switch the MS template used to try to display forms (defaults to MS/6)
  • padding (optional): the number of digits to pad the NDex to for the current MS template (defaults to 3); this does not apply to art (which always pads to 4)
  • start (optional): form # to start from; this is only meant to be used when the function recurses