Modèle:Item infobox/infoboxView : Différence entre versions

De Terraria Wiki
Aller à : navigation, rechercher
 
(4 révisions intermédiaires par le même utilisateur non affichées)
Ligne 34 : Ligne 34 :
 
-->{{#if:{{#var:ii:autoswing}}|<!--
 
-->{{#if:{{#var:ii:autoswing}}|<!--
 
--><div class="auto">[[File:Auto icon.png|18px|link={{tr|Autoswing|link=y}}|<!--
 
--><div class="auto">[[File:Auto icon.png|18px|link={{tr|Autoswing|link=y}}|<!--
-->{{#if:{{#rmatch:{{#var:ii:damagetype}}|/melee/i|y}}|{{l10n|item_infobox|Autoswing}}<!-- melee -> Autoswing
+
--> {{#if:{{#rmatch:{{#var:ii:damagetype}}|/melee/i|y}}|{{l10n|item_infobox|Autoswing}}<!-- melee -> Autoswing
 
-->|{{#if:{{#rmatch:{{#var:ii:damagetype}}|/throwing/i|y}}|{{l10n|item_infobox|Auto-use}}<!-- throwing -> Auto-use
 
-->|{{#if:{{#rmatch:{{#var:ii:damagetype}}|/throwing/i|y}}|{{l10n|item_infobox|Auto-use}}<!-- throwing -> Auto-use
 
-->|{{#if:{{#rmatch:{{#var:ii:damagetype}}|/ranged{{!}}magic/i|y}}|{{l10n|item_infobox|Autofire}}<!-- ranged/magic -> Autofire
 
-->|{{#if:{{#rmatch:{{#var:ii:damagetype}}|/ranged{{!}}magic/i|y}}|{{l10n|item_infobox|Autofire}}<!-- ranged/magic -> Autofire
Ligne 43 : Ligne 43 :
 
-->}}<!--
 
-->}}<!--
 
//stack
 
//stack
-->{{#if:{{#var:ii:stack}}|{{#iferror:{{#expr:{{#var:ii:stack}}>0}}||<!--
+
-->{{#if:{{isNumber|{{#var:ii:stack}}}}|<!-- if $stack is a number (if it is not, then the raw text is displayed like a regular stat further down)
 
--><div class="stack" title="{{l10n|item_infobox|title:maxstack|$stack$={{#var:ii:stack}}}}">{{stack|{{#var:ii:stack}}}}</div><!--
 
--><div class="stack" title="{{l10n|item_infobox|title:maxstack|$stack$={{#var:ii:stack}}}}">{{stack|{{#var:ii:stack}}}}</div><!--
-->}}}}<!--
+
-->}}<!--
 
--></div><!-- div.section.images
 
--></div><!-- div.section.images
   
Ligne 52 : Ligne 52 :
 
-->{{#if:{{#var:ii:hammer}}{{#var:ii:pick}}{{#var:ii:axe}}|<!--
 
-->{{#if:{{#var:ii:hammer}}{{#var:ii:pick}}{{#var:ii:axe}}|<!--
 
--><ul class="toolpower"><!--
 
--><ul class="toolpower"><!--
--><li title="{{l10n|item_infobox|pickaxe_power}}" class="{{#if:{{#var:ii:pick}}||zero}} pickaxe">[[File:Pickaxe mask.png|link=]] {{percent|{{#iferror:{{#expr:{{#var:ii:pick}}+1}}|{{inline block|css=text-align:left;|{{#var:ii:pick}}}}|{{#var:ii:pick|0}}%}}}}</li><!--
+
--><li title="{{l10n|item_infobox|pickaxe_power}}" class="{{#if:{{#var:ii:pick}}||zero}} pickaxe"><!--
  +
-->[[File:Pickaxe mask.png|link=]] <!--
--><li title="{{l10n|item_infobox|hammer_power}}" class="{{#if:{{#var:ii:hammer}}||zero}} hammer">[[File:Hammer mask.png|link=]] {{percent|{{#iferror:{{#expr:{{#var:ii:hammer}}+1}}|{{inline block|css=text-align:left;|{{#var:ii:hammer}}}}|{{#var:ii:hammer|0}}%}}}}</li><!--
 
--><li title="{{l10n|item_infobox|axe_power}}" class="{{#if:{{#var:ii:axe}}||zero}} axe">[[File:Axe mask.png|link=]] {{percent|{{#iferror:{{#expr:{{#var:ii:axe}}+1}}|{{inline block|css=text-align:left;|{{#var:ii:axe}}}}|{{#var:ii:axe|0}}%}}}}</li><!--
+
-->{{percent|{{#iferror:{{#expr:{{#var:ii:pick}}+1}}|{{inline block|css=text-align:left;|{{#var:ii:pick}}}}|{{#var:ii:pick|0}}%}}}}<!--
 
--></li><!--
  +
--><li title="{{l10n|item_infobox|hammer_power}}" class="{{#if:{{#var:ii:hammer}}||zero}} hammer"><!--
  +
-->[[File:Hammer mask.png|link=]] <!--
 
-->{{percent|{{#iferror:{{#expr:{{#var:ii:hammer}}+1}}|{{inline block|css=text-align:left;|{{#var:ii:hammer}}}}|{{#var:ii:hammer|0}}%}}}}<!--
  +
--></li><!--
  +
--><li title="{{l10n|item_infobox|axe_power}}" class="{{#if:{{#var:ii:axe}}||zero}} axe"><!--
  +
-->[[File:Axe mask.png|link=]] <!--
 
-->{{percent|{{#iferror:{{#expr:{{#var:ii:axe}}+1}}|{{inline block|css=text-align:left;|{{#var:ii:axe}}}}|{{#var:ii:axe|0}}%}}}}<!--
  +
--></li><!--
 
--></ul><!--
 
--></ul><!--
 
-->}}<!--
 
-->}}<!--
 
-->{{#if:{{#var:ii:pickreq}}|<!--
 
-->{{#if:{{#var:ii:pickreq}}|<!--
 
--><ul class="toolpower"><!--
 
--><ul class="toolpower"><!--
--><li title="{{l10n|item_infobox|pickreq}}">[[File:Pickaxe icon.png|16px|link=]] {{percent|{{#iferror:{{#expr:{{#var:ii:pickreq}}+1}}|{{inline block|css=text-align:left;|{{#var:ii:pickreq}}}}|{{#var:ii:pickreq|0}}%}}}}</li><!--
+
--><li title="{{l10n|item_infobox|pickreq}}"><!--
  +
-->[[File:Pickaxe icon.png|16px|link=]] <!--
 
-->{{percent|{{#iferror:{{#expr:{{#var:ii:pickreq}}+1}}|{{inline block|css=text-align:left;|{{#var:ii:pickreq}}}}|{{#var:ii:pickreq|0}}%}}}}<!--
  +
--></li><!--
 
--></ul><!--
 
--></ul><!--
 
-->}}<!--
 
-->}}<!--
 
-->{{#if:{{#var:ii:hammerreq}}|<!--
 
-->{{#if:{{#var:ii:hammerreq}}|<!--
 
--><ul class="toolpower"><!--
 
--><ul class="toolpower"><!--
  +
--><li title="{{l10n|item_infobox|hammerreq}}"><!--
--><li title="{{l10n|item_infobox|hammerreq}}">[[File:Hammer icon.png|16px|link=]] {{percent|{{#iferror:{{#expr:{{#var:ii:hammerreq}}+1}}|{{inline block|css=text-align:left;|{{#var:ii:hammerreq}}}}|{{#var:ii:hammerreq|0}}%}}}} {{note|small=y|{{l10n|item_infobox|hammerreq_note}}}}</li><!--
 
  +
-->[[File:Hammer icon.png|16px|link=]] <!--
  +
-->{{percent|{{#iferror:{{#expr:{{#var:ii:hammerreq}}+1}}|{{inline block|css=text-align:left;|{{#var:ii:hammerreq}}}}|{{#var:ii:hammerreq|0}}%}}}} <!--
  +
-->{{note|small=y|{{l10n|item_infobox|hammerreq_note}}}}<!--
  +
--></li><!--
 
--></ul><!--
 
--></ul><!--
 
-->}}<!--
 
-->}}<!--
Ligne 90 : Ligne 106 :
 
--><th>{{l10n|item_infobox|th:baitpower}}</th><!--
 
--><th>{{l10n|item_infobox|th:baitpower}}</th><!--
 
--><td>{{percent|{{#var:ii:bait}}%}}</td><!--
 
--><td>{{percent|{{#var:ii:bait}}%}}</td><!--
  +
--></tr><!--
  +
-->}}<!--
  +
-->{{#if:{{#iferror:{{#ifexpr:{{#var:ii:fishing|0}}|y}}|y}}|<!-- display fishing power if it is greater than 0 or not a raw number
  +
--><tr><!--
  +
--><th>{{l10n|item_infobox|th:fishingpower}}</th><!--
  +
--><td><!--
  +
-->{{percent|<!--
  +
-->{{#var:ii:fishing}}<!--
  +
-->{{#iferror:{{#expr:{{#var:ii:fishing}}+1}}||%}}<!-- append a percentage sign if ii:fishing is a raw number
  +
-->}}<!--
  +
--></td><!--
 
--></tr><!--
 
--></tr><!--
 
-->}}<!--
 
-->}}<!--
Ligne 155 : Ligne 182 :
 
--></span>}}</td><!--
 
--></span>}}</td><!--
 
--></tr><!--
 
--></tr><!--
-->|{{#if:{{#var:ii:ammo}}||<!-- "place" will consume item, so only needed when not placeable. And not is ammo
+
-->|{{#if:{{#lstind:ammunition|{{#var:ii:types}}|/}}||<!--
 
-->{{#if:{{#var:ii:consumable}}|<!--
 
-->{{#if:{{#var:ii:consumable}}|<!--
  +
// only display consumable if not placeable and not ammo
 
--><tr><!--
 
--><tr><!--
 
--><th>{{l10n|item_infobox|th:consumable}}</th><!--
 
--><th>{{l10n|item_infobox|th:consumable}}</th><!--
Ligne 183 : Ligne 211 :
 
--><tr><!--
 
--><tr><!--
 
--><th>{{l10n|item_infobox|th:cri}}</th><!--
 
--><th>{{l10n|item_infobox|th:cri}}</th><!--
  +
--><td><!--
--><td>{{#iferror:{{#expr:{{#var:ii:critical}}+1}}|{{#var:ii:critical}}|{{percent|{{#var:ii:critical}}%}}}}</td><!--
 
  +
-->{{percent|<!--
  +
-->{{#var:ii:critical}}<!--
  +
-->{{#iferror:{{#expr:{{#var:ii:critical}}+1}}||%}}<!-- append a percentage sign if ii:critical is a raw number
  +
-->}}<!--
  +
--></td><!--
 
--></tr><!--
 
--></tr><!--
 
-->}}<!--
 
-->}}<!--
Ligne 234 : Ligne 267 :
 
--><tr><!--
 
--><tr><!--
 
--><th>{{l10n|item_infobox|th:tooltip}}</th><!--
 
--><th>{{l10n|item_infobox|th:tooltip}}</th><!--
--><td><i>{{#var:ii:tooltip}}</i></td><!-- Using apostrophes here can cause some tooltips to be bolded. Escape them with &#39;
+
--><td><i>{{#var:ii:tooltip}}</i></td><!--
 
--></tr><!--
 
--></tr><!--
 
-->}}<!--
 
-->}}<!--
   
-->{{#if:{{#var:ii:stack}}|{{#iferror:{{#expr:{{#var:ii:stack}}>0}}|<!--
+
-->{{#if:{{isNumber|{{#var:ii:stack}}}}||<!-- if $stack is not a number (if it is, then it is displayed with {{stack}} at the top)
 
--><tr><!--
 
--><tr><!--
 
--><th>{{l10n|item_infobox|th:stack}}</th><!--
 
--><th>{{l10n|item_infobox|th:stack}}</th><!--
 
--><td>{{#var:ii:stack}}</td><!--
 
--><td>{{#var:ii:stack}}</td><!--
 
--></tr><!--
 
--></tr><!--
-->|}}}}<!--
+
-->}}<!--
 
-->{{#if:{{#var:ii:rare}}|<!--
 
-->{{#if:{{#var:ii:rare}}|<!--
 
--><tr><!--
 
--><tr><!--
Ligne 408 : Ligne 441 :
 
-->}}<!--
 
-->}}<!--
 
-->{{#if:{{#var:ii:idbuff}}|<!--
 
-->{{#if:{{#var:ii:idbuff}}|<!--
--><li>{{l10n|item_infobox|id:buff}}<b>{{#var:ii:ext:idbuffshow|<!--
+
--><li>{{l10n|item_infobox|id:buff}}<b><!--
  +
-->{{#listmap:<!--
-->{{#lstmap:{{#lstrm:₰₰|{{#var:ii:idbuff}}|₪|₪}}|₪|@@@@|<esc>{{#or:<!-- remove empty elements
 
-->{{#explode:@@@@||2}}<!-- custom vanity id
+
-->|list={{#lstrm:₰₰|{{#var:ii:idbuff}}||}}<!-- remove empty elements
-->|<!--
+
-->|insep=₪|outsep={{l10n|comma|sep1}}<!--
  +
-->|fieldsep=₰|token=$1,$2,$3<!-- split elements on ₰: $1=mobile, $2=ID, $3=vanity ID
-->{{#explode:@@@@|₰|1}} {{eicons|errorcate=n|{{getBuffInfo|{{#explode:@@@@|₰|0}}{{#explode:@@@@|₰|1}}|page}}}}<!--
 
-->}}</esc>|{{l10n|comma|sep1}}}}<!-- comma-separated
+
-->|pattern=<esc>{{#or:$3|<!--
  +
-->$2 {{eicons|errorcate=n|{{pagename2en|{{getBuffInfo|$1$2|page}}}}}}<!--
-->}}</b></li><!--
 
  +
-->}}</esc><!--
  +
-->}}<!--
  +
--></b></li><!--
 
-->}}<!--
 
-->}}<!--
 
-->{{#if:{{#var:ii:idprojectile}}|<!--
 
-->{{#if:{{#var:ii:idprojectile}}|<!--
--><li>{{l10n|item_infobox|id:projectile}}<b>{{#lstsep:{{#var:ii:idprojectile}}|,|,\_}}</b></li><!--
+
--><li>{{l10n|item_infobox|id:projectile}}<b>{{#lstsep:{{#var:ii:idprojectile}}|,|{{l10n|comma|sep1}}}}</b></li><!--
 
-->}}<!--
 
-->}}<!--
 
--></ul></div><!-- div.section.ids
 
--></ul></div><!-- div.section.ids

Version actuelle datée du 3 mai 2021 à 05:31

Internal subtemplate. Handles the output of the default "infobox" view of {{item infobox}}.