Difference between revisions of "Template:Consumable test"

From Stoneshard wiki
Jump to navigation Jump to search
 
Line 1: Line 1:
<includeonly><!--
<includeonly><!--
--- Define variables for properties used more than once in the template - goal is to only load each property from the Data page once. ---
--- Define variables for properties used more than once in the template - goal is to only load each property from the Data page once. ---
-->{{#vardefine:Name|{{:Consumable_data|{{ROOTPAGENAME}}|Name}}}}<!--
-->{{#vardefine:Page|{{#if:{{{1|}}}|{{{1|}}}|{{ROOTPAGENAME}}}}}}<!--
-->{{#vardefine:PropertyText|{{:Consumable_data|{{ROOTPAGENAME}}|PropertyText}}}}<!--
-->{{#vardefine:SubPage|{{#if:{{SUBPAGENAME}}|{{SUBPAGENAME}}|{{#var:Page}}}}}}<!--
-->{{#vardefine:Freshness|{{:Consumable_data|{{ROOTPAGENAME}}|Freshness}}}}<!--
-->{{#vardefine:BasePage|{{#if:{{BASEPAGENAME}}|{{BASEPAGENAME}}|{{#var:Page}}}}}}<!--
-->{{#vardefine:Uses|{{:Consumable_data|{{ROOTPAGENAME}}|Uses}}}}<!--
-->{{#vardefine:OtherPage|{{#if:{{PAGENAME}}|{{PAGENAME}}|{{#var:Page}}}}}}<!--
-->{{#vardefine:Durability|{{:Consumable_data|{{ROOTPAGENAME}}|Durability}}}}<!--
-->{{#vardefine:Name|{{:Consumable_data|{{#var:Page}}|Name}}}}<!--
-->{{#vardefine:Description|{{:Consumable_data|{{ROOTPAGENAME}}|Description}}}}<!--
-->{{#vardefine:PropertyText|{{:Consumable_data|{{#var:Page}}|PropertyText}}}}<!--
-->{{#vardefine:Price|{{:Consumable_data|{{ROOTPAGENAME}}|Price}}}}<!--
-->{{#vardefine:Freshness|{{:Consumable_data|{{#var:Page}}|Freshness}}}}<!--
-->{{#vardefine:Image|{{:Consumable_data|{{ROOTPAGENAME}}|Image}}}}<!--
-->{{#vardefine:Uses|{{:Consumable_data|{{#var:Page}}|Uses}}}}<!--
-->{{#vardefine:Image2|{{:Consumable_data|{{ROOTPAGENAME}}|Image2}}}}<!--
-->{{#vardefine:Durability|{{:Consumable_data|{{#var:Page}}|Durability}}}}<!--
-->{{#vardefine:Description|{{:Consumable_data|{{#var:Page}}|Description}}}}<!--
-->{{#vardefine:Price|{{:Consumable_data|{{#var:Page}}|Price}}}}<!--
-->{{#vardefine:Image|{{:Consumable_data|{{#var:Page}}|Image}}}}<!--
-->{{#vardefine:Image2|{{:Consumable_data|{{#var:Page}}|Image2}}}}<!--
--- Consumable Tooltip start. ---
--- Consumable Tooltip start. ---
-->{| width=300px;
-->{| width=300px;
|style="text-align:center;"|<!--
|style="text-align:center;"|<!--
--- Check if item is marked as unobtainable. ---
--- Check if item is marked as unobtainable. ---
-->{{#if:{{:Consumable data|{{ROOTPAGENAME}}|Unobtainable}}|{{Unobtainable}}<br />|}}<!--
-->{{#if:{{:Consumable data|{{#var:Page}}|Unobtainable}}|{{Unobtainable}}<br />|}}<!--
--- Check if parameter Name exists, if yes, use that parameter value as Name, otherwise use ROOTPAGENAME. For items with name identical to another (Dirk item vs Dirk NPC). ---
--- Check if parameter Name exists, if yes, use that parameter value as Name, otherwise use #var:Page. For items with name identical to another (Dirk item vs Dirk NPC). ---
--><span style="font-size: 20px;">{{Translate|{{#if:{{#var:Name}}|{{#var:Name}}|{{ROOTPAGENAME}}}}|ConsumableNames}}</span><br /><!--
--><span style="font-size: 20px;">{{Translate|{{#if:{{#var:Name}}|{{#var:Name}}|{{#var:Page}}}}|ConsumableNames}}</span><br /><!--
--><span style="color:#9d9a9a;">{{Translate|{{:Consumable data|{{ROOTPAGENAME}}|ItemType}}|Properties}}</span><!--
--><span style="color:#9d9a9a;">{{Translate|{{:Consumable data|{{#var:Page}}|ItemType}}|Properties}}</span><!--
--- Check if item has no Properties at all, if yes, then don't add a horizontal rule, otherwise add it. ---
--- Check if item has no Properties at all, if yes, then don't add a horizontal rule, otherwise add it. ---
-->{{#if: {{:Consumable data|{{ROOTPAGENAME}}|NoProperties}}||{{Tooltip rule}}}}
-->{{#if: {{:Consumable data|{{#var:Page}}|NoProperties}}||{{Tooltip rule}}}}
|-
|-
|<div style="width:100%;color:white;">{{Test|{{ROOTPAGENAME}}}}<!--
|<div style="width:100%;color:white;">{{Test|{{#var:Page}}}}<!--
-->{{#if: {{#var:PropertyText}} | <div>{{#if: {{#titleparts: {{PAGENAME}} | 1 | 2}} | {{#ifeq: {{PAGENAME}} | {{ROOTPAGENAME}}/Tooltip | {{#var:PropertyText}} | {{Translate|{{ROOTPAGENAME}}|ConsumableDescriptions}}}} | {{#var:PropertyText}}}}</div>{{#if: {{#var:Freshness}}|<br>}}|}}</div><!--
-->{{#if: {{#var:PropertyText}} | <div>{{#if: {{#titleparts: {{#var:OtherPage}} | 1 | 2}} | {{#ifeq: {{#var:OtherPage}} | {{#var:Page}}/Tooltip | {{#var:PropertyText}} | {{Translate|{{#var:Page}}|ConsumableDescriptions}}}} | {{#var:PropertyText}}}}</div>{{#if: {{#var:Freshness}}|<br>}}|}}</div><!--
-->{{#if: {{#var:Freshness}} | {{#ifeq: {{#var:Freshness}}|0|<div><span style="color:white;">Does not spoil over time.</span></div>{{#if: {{#var:Uses}}|<br>}}|<div style="color:#9d9a9a;">{{Translate|Will spoil in|Properties}} <span style="color:white;">{{#iferror: {{#expr: ceil({{#var:Freshness}}/24) }}|error}} {{#iferror: {{#ifexpr: {{#var:Freshness}} > 24 |days|day}}|error}}.</span></div>}}}}<!--
-->{{#if: {{#var:Freshness}} | {{#ifeq: {{#var:Freshness}}|0|<div><span style="color:white;">Does not spoil over time.</span></div>{{#if: {{#var:Uses}}|<br>}}|<div style="color:#9d9a9a;">{{Translate|Will spoil in|Properties}} <span style="color:white;">{{#iferror: {{#expr: ceil({{#var:Freshness}}/24) }}|error}} {{#iferror: {{#ifexpr: {{#var:Freshness}} > 24 |days|day}}|error}}.</span></div>}}}}<!--
-->{{#if: {{#switch:{{#var:Uses}}|0|1=|{{#var:Uses}}}} |<div style="color:#9d9a9a;">{{Translate|Uses|Properties}}: <span style="color:white;">{{#var:Uses}}/{{#var:Uses}}</span></div>{{#if: {{#var:Durability}}|<br>}}| }}<!--
-->{{#if: {{#switch:{{#var:Uses}}|0|1=|{{#var:Uses}}}} |<div style="color:#9d9a9a;">{{Translate|Uses|Properties}}: <span style="color:white;">{{#var:Uses}}/{{#var:Uses}}</span></div>{{#if: {{#var:Durability}}|<br>}}| }}<!--
-->{{#if: {{#var:Durability}} |<div style="color:#9d9a9a;">{{Translate|Durability|Properties}}: <span style="color:white;">{{#var:Durability}}/{{#var:Durability}}</span></div> | }}
-->{{#if: {{#var:Durability}} |<div style="color:#9d9a9a;">{{Translate|Durability|Properties}}: <span style="color:white;">{{#var:Durability}}/{{#var:Durability}}</span></div> | }}
|-
|-
|style="color:#9d7969;"|{{Tooltip rule}}{{#if: {{#titleparts: {{PAGENAME}} | 1 | 2}} | {{#ifeq: {{PAGENAME}} | {{ROOTPAGENAME}}/Tooltip | {{#var:Description}} | {{Translate|{{ROOTPAGENAME}}|ConsumableDescriptions}}}} | {{#var:Description}}}}{{#if:{{#var:Price}}|<div style="float:right">[[File:Gold_Icon.png|18px|alt={{Translate|Price|Properties}}|link=|{{Translate|Price|Properties}}]]{{W|{{#var:Price}}}}</div>}} <br />
|style="color:#9d7969;"|{{Tooltip rule}}{{#if: {{#titleparts: {{#var:OtherPage}} | 1 | 2}} | {{#ifeq: {{#var:OtherPage}} | {{#var:Page}}/Tooltip | {{#var:Description}} | {{Translate|{{#var:Page}}|ConsumableDescriptions}}}} | {{#var:Description}}}}{{#if:{{#var:Price}}|<div style="float:right">[[File:Gold_Icon.png|18px|alt={{Translate|Price|Properties}}|link=|{{Translate|Price|Properties}}]]{{W|{{#var:Price}}}}</div>}} <br />
|-
|-
|style="text-align:center;"|[[File:{{#if:{{#var:Image}}|{{#var:Image}}|{{ROOTPAGENAME}}.png}}|class=image2x|link={{#ifeq:{{SUBPAGENAME}}|Tooltip|{{BASEPAGENAME}}|{{PAGENAME}}/Tooltip}}|alt={{Translate|{{ROOTPAGENAME}}|ConsumableNames}}|{{Translate|{{ROOTPAGENAME}}|ConsumableNames}}]]{{#if:{{#var:Image2}}|[[File:{{#var:Image2}}|class=image2x|link={{#ifeq:{{SUBPAGENAME}}|Tooltip|{{BASEPAGENAME}}|{{PAGENAME}}/Tooltip}}|alt={{Translate|{{ROOTPAGENAME}}|ConsumableNames}}|{{Translate|{{ROOTPAGENAME}}|ConsumableNames}}]]}}
|style="text-align:center;"|[[File:{{#if:{{#var:Image}}|{{#var:Image}}|{{#var:Page}}.png}}|class=image2x|link={{#ifeq:{{#var:SubPage}}|Tooltip|{{#var:BasePage}}|{{#var:OtherPage}}/Tooltip}}|alt={{Translate|{{#var:Page}}|ConsumableNames}}|{{Translate|{{#var:Page}}|ConsumableNames}}]]{{#if:{{#var:Image2}}|[[File:{{#var:Image2}}|class=image2x|link={{#ifeq:{{#var:SubPage}}|Tooltip|{{#var:BasePage}}|{{#var:OtherPage}}/Tooltip}}|alt={{Translate|{{#var:Page}}|ConsumableNames}}|{{Translate|{{#var:Page}}|ConsumableNames}}]]}}
|}
|}
</includeonly><noinclude>{{doc}}
</includeonly><noinclude>{{doc}}


[[Category:Tooltip templates]]</noinclude>
[[Category:Tooltip templates]]</noinclude>

Latest revision as of 16:38, 27 July 2022

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