Difference between revisions of "Template:Armor test"

From Stoneshard wiki
Jump to navigation Jump to search
m (8 revisions imported)
 
(8 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<includeonly>{| width=300px;
<includeonly><!--
|style="text-align:center;"|{{#if:{{:Data|{{ROOTPAGENAME}}|Unobtainable}}|{{Unobtainable}}<br />}}{{#if: {{:Data|{{ROOTPAGENAME}}|Rarity}} | <span style="font-size: 20px;">{{c|{{:Data|{{ROOTPAGENAME}}|Rarity}}|{{Translate|{{ROOTPAGENAME}}|ItemNames}}}}</span> <br /> <span style="color:#9d9a9a;">{{Translate|{{:Data|{{ROOTPAGENAME}}|Rarity}}|Properties}} | <span style="font-size: 20px;">{{Translate|{{ROOTPAGENAME}}|ItemNames}}</span> <br /> <span style="color:#9d9a9a;">{{Translate|Common|Properties}} }} {{Translate|{{:Data|{{ROOTPAGENAME}}|ArmorType}}|Properties}}</span>{{Tooltip rule}}
--- If item name is provided as parameter, use the parameter instead of root page. ---
-->{{#vardefine:Page|{{#if:{{{1|}}}|{{{1|}}}|{{ROOTPAGENAME}}}}}}<!--
--- Load complete datastring into a variable - to only load from the Armor data page once. ---
-->{{#vardefine:Datastring|{{:Armor_data|{{#var:Page}}}}}}<!--
--- Separate values from datastring into individual variables. ---
-->{{#vardefine:Unobtainable|{{#explode: {{#var:Datastring}}|;|-3}}}}<!--
-->{{#vardefine:Rarity|{{#explode: {{#var:Datastring}}|;|4}}}}<!--
-->{{#vardefine:ArmorType|{{#explode: {{#var:Datastring}}|;|2}}}}<!--
-->{{#vardefine:Protection|{{#explode: {{#var:Datastring}}|;|8}}}}<!--
-->{{#vardefine:Durability|{{#explode: {{#var:Datastring}}|;|7}}}}<!--
-->{{#vardefine:Description|{{#explode: {{#var:Datastring}}|;|-1}}}}<!--
-->{{#vardefine:Price|{{#explode: {{#var:Datastring}}|;|6}}}}<!--
-->{{#vardefine:Image|{{#explode: {{#var:Datastring}}|;|-6}}}}<!--
-->{{#vardefine:Image2|{{#explode: {{#var:Datastring}}|;|-5}}}}<!--
-->{{#vardefine:Image3|{{#explode: {{#var:Datastring}}|;|-4}}}}<!--
--- Load translations that are used multiple times into variables. ---
-->{{#vardefine:TranslateName|{{Translate|{{#var:Page}}|ItemNames}}}}<!--
-->{{#vardefine:TranslatePrice|{{Translate|Price|Properties}}}}<!--
-->{| width=300px;
|style="text-align:center;"|<!--
--- Check if item is marked as not obtainable in game (manually in g.sheet) ---
-->{{#if:{{#var:Unobtainable}}|{{Unobtainable}}<br />}}<!--
--- Check if item is of better rarity than common ---
-->{{#if:{{#var:Rarity}}|<span style="font-size: 20px;">{{c|{{#var:Rarity}}|{{#var:TranslateName}}}}</span><br /><span style="color:#9d9a9a;">{{Translate|{{#var:Rarity}}|Properties}}|<span style="font-size: 20px;">{{#var:TranslateName}}</span><br /><span style="color:#9d9a9a;">{{Translate|Common|Properties}} }} <!--
--- Load armor type (headgear, shield, etc.) ---
-->{{Translate|{{#var:ArmorType}}|Properties}}</span>{{Tooltip rule}}
|-
|-
|style="text-align:center;"|{{#if: {{:Data|{{ROOTPAGENAME}}|Protection}} | {{:Data|{{ROOTPAGENAME}}|Protection}} {{Translate|Protection|Properties}} {{Tooltip rule}} | }}
|style="text-align:center;"|<!--
--- Load armor protection ---
-->{{#if:{{#var:Protection}}|{{#var:Protection}} {{Translate|Protection|Properties}} {{Tooltip rule}} |}}
|-
|-
|<div style="width:100%;float: left;color:#9d9a9a;">{{Test|{{ROOTPAGENAME}}}}</div>
|<div style="width:100%;color:#9d9a9a;"><!--
<div style="clear: both;color:#9d9a9a;">{{Translate|Durability|Properties}}: <span style="color:white;">{{:Data|{{ROOTPAGENAME}}|Durability}}/{{:Data|{{ROOTPAGENAME}}|Durability}}</span></div>
--- Load and sort item properties via this template ---
-->{{Test_test|{{#var:Page}}}}</div><!--
--- Load armor durability ---
--><div style="color:#9d9a9a;">{{Translate|Durability|Properties}}: <span style="color:white;">{{#var:Durability}}/{{#var:Durability}}</span></div>
|-
|-
|style="color:#9d7969;text-align:justify"|{{Tooltip rule}}{{#if: {{#titleparts: {{PAGENAME}} | 1 | 2}} | {{#ifeq: {{PAGENAME}} | {{ROOTPAGENAME}}/Tooltip | {{:Data|{{ROOTPAGENAME}}|Description}} | {{Translate|{{ROOTPAGENAME}}|ItemDescriptions}}}} | {{:Data|{{ROOTPAGENAME}}|Description}}}}<div style="float:right;">[[File:Gold_Icon.png|18px|alt={{Translate|Price|Properties}}|link=|{{Translate|Price|Properties}}]]{{W|{{:Data|{{ROOTPAGENAME}}|Price}}}}</div><br />
|style="color:#9d7969;text-align:justify"|<!--
--- Load description and price ---
-->{{Tooltip rule}}{{#if: {{#titleparts: {{PAGENAME}} | 1 | 2}} | {{#ifeq: {{PAGENAME}} | {{#var:Page}}/Tooltip | {{#var:Description}} | {{Translate|{{#var:Page}}|ItemDescriptions}}}} | {{#var:Description}}}}<div style="float:right;">[[File:Gold_Icon.png|18px|alt={{#var:TranslatePrice}}|link=|{{#var:TranslatePrice}}]]{{W|{{#var:Price}}}}</div><br />
|-
|-
|style="text-align:center;"|[[File:{{#if:{{:Data|{{ROOTPAGENAME}}|Image}}|{{:Data|{{ROOTPAGENAME}}|Image}}|{{ROOTPAGENAME}}.png}}|class=image2x|link={{#ifeq:{{SUBPAGENAME}}|Tooltip|{{BASEPAGENAME}}|{{PAGENAME}}/Tooltip}}|alt={{Translate|{{ROOTPAGENAME}}|ItemNames}}|{{Translate|{{ROOTPAGENAME}}|ItemNames}}]]<!--
|style="text-align:center;"|<!--
--- Load item images (up to 3 supported now, no item uses more than 3) ---
-->[[File:{{#if:{{#var:Image}}|{{#var:Image}}|{{#var:Page}}.png}}|class=image2x|link=|alt={{#var:TranslateName}}|{{#var:TranslateName}}]]<!--


-->{{#if:{{:Data|{{ROOTPAGENAME}}|Image2}}|[[File:{{:Data|{{ROOTPAGENAME}}|Image2}}|class=image2x|link={{#ifeq:{{SUBPAGENAME}}|Tooltip|{{BASEPAGENAME}}|{{PAGENAME}}/Tooltip}}|alt={{#if:{{:Data|{{ROOTPAGENAME}}|Name2}}|{{Translate|{{:Data|{{ROOTPAGENAME}}|Name2}}|ItemNames}}|{{ROOTPAGENAME}}}}|{{#if:{{:Data|{{ROOTPAGENAME}}|Name2}}|{{Translate|{{:Data|{{ROOTPAGENAME}}|Name2}}|ItemNames}}|{{Translate|{{ROOTPAGENAME}}|ItemNames}}}}]]<!--
-->{{#if:{{#var:Image2}}|[[File:{{#var:Image2}}|class=image2x|link=|alt={{#var:TranslateName}}|{{#var:TranslateName}}]]<!--


-->{{#if:{{:Data|{{ROOTPAGENAME}}|Image3}}|<br />[[File:{{:Data|{{ROOTPAGENAME}}|Image3}}|class=image2x|link={{#ifeq:{{SUBPAGENAME}}|Tooltip|{{BASEPAGENAME}}|{{PAGENAME}}/Tooltip}}|alt={{#if:{{:Data|{{ROOTPAGENAME}}|Name3}}|{{Translate|{{:Data|{{ROOTPAGENAME}}|Name3}}|ItemNames}}|{{ROOTPAGENAME}}}}|{{#if:{{:Data|{{ROOTPAGENAME}}|Name3}}|{{Translate|{{:Data|{{ROOTPAGENAME}}|Name3}}|ItemNames}}|{{Translate|{{ROOTPAGENAME}}|ItemNames}}}}]]<!--
-->{{#if:{{#var:Image3}}|<br />[[File:{{#var:Image3}}|class=image2x|link=|alt={{#var:TranslateName}}|{{#var:TranslateName}}]]}}}}
 
-->{{#if:{{:Data|{{ROOTPAGENAME}}|Image4}}|[[File:{{:Data|{{ROOTPAGENAME}}|Image4}}|class=image2x|link={{#ifeq:{{SUBPAGENAME}}|Tooltip|{{BASEPAGENAME}}|{{PAGENAME}}/Tooltip}}|alt={{#if:{{:Data|{{ROOTPAGENAME}}|Name4}}|{{Translate|{{:Data|{{ROOTPAGENAME}}|Name4}}|ItemNames}}|{{ROOTPAGENAME}}}}|{{#if:{{:Data|{{ROOTPAGENAME}}|Name4}}|{{Translate|{{:Data|{{ROOTPAGENAME}}|Name4}}|ItemNames}}|{{Translate|{{ROOTPAGENAME}}|ItemNames}}}}]]}}}}}}
|}
|}
{{#if: {{#titleparts: {{PAGENAME}} | 1 | 2}} | {{#ifeq: {{PAGENAME}} | {{ROOTPAGENAME}}/Tooltip |[[Category:{{:Data|{{ROOTPAGENAME}}|ArmorType}} Tooltips]]|{{#if: {{#titleparts: {{PAGENAME}} | 1 | 3}}|[[Category: {{uc:{{#titleparts: {{PAGENAME}} | 1 | 2}}}} {{:Data|{{ROOTPAGENAME}}|ArmorType}} Tooltips]]|[[Category: {{uc:{{#titleparts: {{PAGENAME}} | 1 | 2}}}} {{:Data|{{ROOTPAGENAME}}|ArmorType}}]]}}}}|[[Category: {{:Data|{{ROOTPAGENAME}}|ArmorType}}]]}}</includeonly><noinclude>{{doc}}
{{#if: {{#titleparts: {{PAGENAME}} | 1 | 2}} | {{#ifeq: {{PAGENAME}} | {{#var:Page}}/Tooltip |[[Category:{{#var:ArmorType}} Tooltips]]|{{#if: {{#titleparts: {{PAGENAME}} | 1 | 3}}|[[Category: {{uc:{{#titleparts: {{PAGENAME}} | 1 | 2}}}} {{#var:ArmorType}} Tooltips]]|[[Category: {{uc:{{#titleparts: {{PAGENAME}} | 1 | 2}}}} {{#var:ArmorType}}]]}}}}|[[Category: {{#var:ArmorType}}]]}}</includeonly><noinclude>{{doc}}
[[Category:Tooltip templates]]</noinclude>
[[Category:Tooltip templates]]</noinclude>

Latest revision as of 16:23, 26 May 2023

This template has no documentation. If you know how to use this template, please add some.