Modèle:Exclusive versions : Différence entre versions

De Terraria Wiki
Aller à : navigation, rechercher
m
m
 
Ligne 1 : Ligne 1 :
 
<includeonly><!--
 
<includeonly><!--
  +
// localization info is autoloaded from Template:Exclusive versions/l10n
   
//for l10n text database, see [[template:exclusive versions/l10n]]
 
   
//get exclusive info, set ex_d ex_c ex_m ex_o ex_3 ex_j dplvars.
+
// get exclusive info, set ex_d ex_c ex_m ex_o ex_3 ex_j dplvars:
 
-->{{#invoke:exclusive|getInfo|{{{1|{{{t|}}}}}}|invert={{{invert|}}}|pagenot={{{pagenot|{{{not|}}}}}}}}<!--
 
-->{{#invoke:exclusive|getInfo|{{{1|{{{t|}}}}}}|invert={{{invert|}}}|pagenot={{{pagenot|{{{not|}}}}}}}}<!--
   
//take arguments into consideration:
+
// take arguments into consideration:
//version parameter
+
// version parameter
-->{{#if:{{{version|}}}|<!-- eg: version = desktop-console
+
-->{{#if:{{{version|}}}|<!-- e.g.: version = desktop-console
 
-->{{#ifeq:{{{version}}}|all|<!--
 
-->{{#ifeq:{{{version}}}|all|<!--
 
-->{{#dplvar:set<!--
 
-->{{#dplvar:set<!--
Ligne 26 : Ligne 26 :
 
-->}}<!--
 
-->}}<!--
 
-->}}<!--
 
-->}}<!--
//regular version parameters
+
// regular version parameters
 
-->{{#switch:{{{dsk|{{{desktop|{{{pc|}}}}}}}}}|y|yes={{#dplvar:set|ex_d|y}}|n|no={{#dplvar:set|ex_d|}}}}<!--
 
-->{{#switch:{{{dsk|{{{desktop|{{{pc|}}}}}}}}}|y|yes={{#dplvar:set|ex_d|y}}|n|no={{#dplvar:set|ex_d|}}}}<!--
 
-->{{#switch:{{{cns|{{{console|}}}}}}|y|yes={{#dplvar:set|ex_c|y}}|n|no={{#dplvar:set|ex_c|}}}}<!--
 
-->{{#switch:{{{cns|{{{console|}}}}}}|y|yes={{#dplvar:set|ex_c|y}}|n|no={{#dplvar:set|ex_c|}}}}<!--
Ligne 34 : Ligne 34 :
 
-->{{#switch:{{{jas|{{{japan|{{{japanese|{{{j-console|{{{japanese-console|}}}}}}}}}}}}}}}|y|yes={{#dplvar:set|ex_j|y}}|n|no={{#dplvar:set|ex_j|}}}}<!--
 
-->{{#switch:{{{jas|{{{japan|{{{japanese|{{{j-console|{{{japanese-console|}}}}}}}}}}}}}}}|y|yes={{#dplvar:set|ex_j|y}}|n|no={{#dplvar:set|ex_j|}}}}<!--
   
-->{{#if:{{{raw|{{{code|}}}}}}|<!--
+
-->{{#if:{{{raw|{{{code|}}}}}}|<!-- if $code or $raw
 
-->{{#dplvar:set|glue|{{{delimit|{{{replace|/}}}}}}}}<!--
 
-->{{#dplvar:set|glue|{{{delimit|{{{replace|/}}}}}}}}<!--
 
-->{{#dplvar:set|output|{{#sub:<!--
 
-->{{#dplvar:set|output|{{#sub:<!--
Ligne 48 : Ligne 48 :
 
-->}}<!--
 
-->}}<!--
 
-->{{#dplvar:output}}<!--
 
-->{{#dplvar:output}}<!--
-->|<!--else, not $code and not $raw
 
 
// error check
 
-->{{#ifeq:{{#dplvar:ex_d}}{{#dplvar:ex_c}}{{#dplvar:ex_j}}{{#dplvar:ex_o}}{{#dplvar:ex_m}}{{#dplvar:ex_3}}||<!-- if no input, valid parameter check
 
-->{{error|{{l10n|eversions|no_valid_parameter_text}}|{{l10n|eversions|no_valid_parameter_cate}}}}<!--
 
-->|<!--ELSEIF-->{{#ifeq:{{#dplvar:ex_d}}{{#dplvar:ex_c}}{{#dplvar:ex_m}}{{#dplvar:ex_3}}{{#dplvar:ex_o}}|yyyyy|<!-- allversions check
 
//(Japanese console is not included because those exclusives are indeed exclusive)
 
-->{{error|{{l10n|eversions|all_versions_text}}|{{l10n|eversions|all_versions_cate}}}}<!--
 
-->|<!--ELSE
 
// check passed
 
 
//version links
 
-->{{versions|{{#if:{{{nl|{{{nolink|}}}}}}|{{#if:{{{nlicons|}}}||text}}|{{#if:{{{noicons|}}}|text}}}}|short={{{short|{{#ifeq:{{{2|}}}|short|y}}}}}|nl={{{nl|{{{nolink|}}}}}}|dsk={{#dplvar:ex_d}}|cns={{#dplvar:ex_c}}|old={{#dplvar:ex_o}}|mbl={{#dplvar:ex_m}}|3ds={{#dplvar:ex_3}}|jas={{#dplvar:ex_j}}}}<!--
 
   
 
-->|<!-- else (not $code and not $raw)
   
 
// error check:
  +
// error: no input
 
-->{{#ifeq:{{#dplvar:ex_d}}{{#dplvar:ex_c}}{{#dplvar:ex_j}}{{#dplvar:ex_o}}{{#dplvar:ex_m}}{{#dplvar:ex_3}}||<!-- (if no input, valid parameter check)
  +
-->{{error<!--
 
-->|{{l10n|eversions|no_valid_parameter_text|$tl$={{tl|eversions}}}}<!--
  +
-->|{{l10n|eversions|no_valid_parameter_cate}}<!--
  +
-->}}<!--
  +
// error: all versions
 
-->|{{#ifeq:{{#dplvar:ex_d}}{{#dplvar:ex_c}}{{#dplvar:ex_m}}{{#dplvar:ex_3}}{{#dplvar:ex_o}}|yyyyy|<!-- (else if all versions are set)
 
// (Japanese console is not included because those exclusives are indeed exclusive)
  +
-->{{error<!--
 
-->|{{l10n|eversions|all_versions_text|$tl$={{tl|eversions}}}}<!--
  +
-->|{{l10n|eversions|all_versions_cate}}<!--
  +
-->}}<!--
 
// error check passed
 
-->|<!-- (else)
 
// version links
  +
-->{{versions<!--
  +
-->|{{#if:{{{nl|{{{nolink|}}}}}}|{{#if:{{{nlicons|}}}||text}}|{{#if:{{{noicons|}}}|text}}}}<!-- "text" if ($nl/nolink and not $nlicons) or (not $nl/nolink and $noicons)
  +
-->|short={{{short|{{#ifeq:{{{2|}}}|short|y}}}}}<!--
  +
-->|nl={{{nl|{{{nolink|}}}}}}<!--
  +
-->|dsk={{#dplvar:ex_d}}<!--
  +
-->|cns={{#dplvar:ex_c}}<!--
  +
-->|old={{#dplvar:ex_o}}<!--
  +
-->|mbl={{#dplvar:ex_m}}<!--
  +
-->|3ds={{#dplvar:ex_3}}<!--
  +
-->|jas={{#dplvar:ex_j}}<!--
  +
-->}}<!--
 
-->}}}}<!-- end error check
 
-->}}}}<!-- end error check
   
 
-->}}<!--
 
-->}}<!--
  +
 
--></includeonly><!--
 
--></includeonly><!--
   

Version actuelle datée du 17 septembre 2020 à 13:07

Lua logo.svg
Ce modèle utilise Module:Exclusive, qui est écrit avec un script dans le language de programmation Lua. Pour en apprendre plus à propos de Lua, visiter Wikipédia:Lua et mw:Extension:Scribunto.
Ce modèle est considéré comme prêt pour i18n, signifiant qu'il est facile à régionaliser pour les différentes langues. Veuillez regarder I18n & l10n pour les modèles (en) pour en apprendre plus.
Voir Modèle:Exclusive versions/l10n pour la localisation de ce modèle.
Template-info.svg Documentation La documentation ci-dessous est transcluse de Modèle:Exclusive versions/doc. (modifier | historique)

This template is similar to {{Exclusive icons}}, except instead of icons it outputs versions. {{Eversions}} can be used as a shortcut for this template.

Parameter Usage

{{exclusive versions|page|short|invert=yes|nl=yes|nlicons=yes|raw=yes|delimit=delimiter|upper3ds=yes}}

Short(2nd unamed paramter) or short=y
Use short to make all of the versions have the short parameter. Example:
{{eversions|Traveling Merchant|short}} —> Version Bureau Bureau, Version Console Console, Version Console old-gen Console old-gen et Version Mobile Mobile
{{eversions|Traveling Merchant|short=y}} —> Version Bureau Bureau, Version Console Console, Version Console old-gen Console old-gen et Version Mobile Mobile
{{eversions|Traveling Merchant|short|nl=yes}} —> Bureau, Console, Console old-gen et Mobile
raw=yes, delimit=delimiter, and upper3ds=yes (code and replace are partially deprecated)
Use raw=yes to output raw text.
This text will output with "/" character in-between each version name by default, but another delimiter may be specified with delimit=delimiter.
If 3ds outputs, "ds" is lowercase by default. Change this to uppercase by using upper3ds=yes (upper3DS=yes is also acceptable).
{{eversions|Horned God set|3DS=y|raw=y|delimit=-}} —> console-old-gen-3ds
nl/nolink=yes, nlicons=yes, and noicons=yes
Use nl=yes to output version names without links or icons. Example:
{{eversions|Palm Wood|nl=yes}} —> Version Bureau, Version Console, Version Console old-gen et Version Mobile
Use nlicons=yes to re-add the version icons when using nl.
{{eversions|Ocram Mask|nl=yes|nlicons=yes}} —> Version Console Version Console et Version Console old-gen Version Console old-gen
Use noicons=yes to print links, but no icons.
{{eversions|Ocram Mask|noicons=yes}} —> Version Console et Version Console old-gen
invert=yes
Use invert=yes to output the opposite of the page's exclusivity. Example:
{{eversions|Traveling Merchant|invert=yes}} —> Version Version 3DS 3DS
Important Note: This disables the sensor of Japanese Console content.
desktop/dsk=y/n, console/cns=y/n, old-gen/oldgen/old = y/n, mobile/mbl=y/n, and 3DS/3ds=y/n
Override options. For example, {{eversions|Zapinator|desktop=y}} outputs Version Bureau Version Bureau et Version Version 3DS 3DS. See {{exclusive}} and {{eicons}}

Examples

The Ocram Mask is available on the Version Console Version Console et Version Console old-gen Version Console old-gen. (displayed with {{eversions|Ocram Mask}})

Ocram is available on the Version Console old-gen Version Console old-gen et Version Version 3DS 3DS. (displayed with {{eversions|Ocram}})

1.3 is on the Version Bureau Version Bureau, Version Console Version Console et Version Mobile Version Mobile. (displayed with {{eversions|1.3.0.1}})

Version Console old-gen Version Console old-gen et Version Version 3DS 3DS. (displayed with {{eversions|1.3.0.1|invert=y}})

The Monokuma costume is exclusive to the Version Console japonaise Version Console japonaise. (displayed with {{eversions|Monokuma set}})