Line 1: |
Line 1: |
− | <includeonly><span style="display:inline; margin-right:0;">{{#switch: {{lc:{{{1}}}}} | + | <includeonly><!-- |
− | | spring = [[File:Spring.png|{{{width|24px}}}|link=Spring]] [[Spring]] | + | |
− | | summer = [[File:Summer.png|{{{width|24px}}}|link=Summer]] [[Summer]] | + | // Define the allowed values. Handling multiple quirks/oddities. Ideally, all of the names would work equally well |
− | | fall | autumn = [[File:Fall.png|{{{width|24px}}}|link=Fall]] [[Fall]] | + | // as displayed text, wiki page names, and icon names. But that's not possible. So top priority is to |
− | | winter = [[File:Winter.png|{{{width|24px}}}|link=Winter]] [[Winter]] | + | // create a list of valid page names. That's why 'Seasons' is primary name for 'All', 'Any', 'All Seasons' |
− | | marriage = [[File:Mermaid's Pendant.png|{{{width|24px}}}|link=Marriage]] [[Marriage]] | + | // Marriage, Deviations are for sake of NPC schedule sections (and translations) |
− | | deviations = Deviations | + | -->{{#arraydefine:$engl_seasons|Spring, Summer, Fall, Winter, Seasons, Marriage, Deviations, Fall, Seasons, Seasons}}<!-- |
− | | all | any = [[File:All_Seasons_Icon.png|{{{width|24px}}}|link=Seasons]] [[Seasons|All Seasons]] | + | -->{{#arraydefine:$lang_seasons|Spring, Summer, Fall, Winter, Seasons, Marriage, Deviations, Autumn, All, Any}}<!-- |
− | |{{ucfirst:{{{1|}}} }} }}</span></includeonly><noinclude>{{{{FULLPAGENAME}}/doc}}</noinclude> | + | -->{{#arraydefine:$lang_allshort | All }}<!-- |
| + | -->{{#arraydefine:$lang_alllong | All Seasons}}<!-- |
| + | |
| + | // END OF translated text |
| + | |
| + | // Check whether there's already a file link in {{{1}}}... implying this is probably a recursive call. Return immediately |
| + | -->{{#if:{{#pos:{{{1|}}}|<nowiki>[[File</nowiki>}}|{{{1}}}|<!-- |
| + | // Parse input data, then loop over all extracted entries |
| + | -->{{#arraydefine:$sseason|{{ParseInputValues|{{{1|}}}|{{#arrayprint:$engl_seasons}}|{{#arrayprint:$lang_seasons}}|default=true}}}}<!-- |
| + | -->{{#if:{{#arrayprint:$sseason}} | |
| + | <span style="display:inline; margin-right:0;"><!-- |
| + | -->{{#arrayprint:$sseason||@season@|<!-- |
| + | |
| + | // Add space and bullet if this is not first entry |
| + | -->{{#ifexpr:{{#arraysearch:$sseason|@season@}}>0| • }}<!-- |
| + | |
| + | // Convert @season@ (english page name) into translated page name |
| + | -->{{#arraydefine:$slink_text|{{#arrayindex:$lang_seasons|{{#arraysearch:$engl_seasons|@season@}}}}}}<!-- |
| + | |
| + | // Display the non-icon, non-linkable cases: Devations, and unmatched text (detected by empty link_text) |
| + | // This is also how text_only option is handled |
| + | -->{{#ifeq:{{#arrayprint:$slink_text}}| |
| + | | {{ucfirst:@season@}} |
| + | | {{#ifexpr: {{#ifeq:@season@|Deviations|1|0}} or {{#if:{{{text_only|}}}|1|0}} |
| + | | {{#if:{{{no_translate|}}}|@season@|{{#arrayprint:$slink_text}}}} |
| + | | <!-- |
| + | |
| + | // Display the normal cases: first display icon |
| + | -->[[File:{{#switch:@season@ |
| + | |Spring |
| + | |Summer |
| + | |Fall |
| + | |Winter = @season@ |
| + | |Seasons = All_Seasons_Icon |
| + | |Marriage = Mermaid's Pendant |
| + | }}.png | {{{width|24px}}} | link={{#arrayprint:$slink_text}} | alt={{#arrayprint:$slink_text}}]] <!-- |
| + | |
| + | // Add link, with special treatment for text of All Seasons |
| + | -->[[{{#arrayprint:$slink_text}}|<!-- |
| + | -->{{#ifeq:@season@|Seasons |
| + | |{{#if:{{{do_short|}}}|{{#arrayprint:$lang_allshort}}|{{#arrayprint:$lang_alllong}}}} |
| + | |{{#arrayprint:$slink_text}}}}]]<!-- |
| + | -->}}}}}}</span>}}}}</includeonly><noinclude>{{Englishdoc}}{{#ifexist:{{FULLPAGENAME}}/doc |<nowiki/> |
| + | {{{{FULLPAGENAME}}/doc}} }}</noinclude> |