Difference between revisions of "Template:ValuableTable/row"

From Stoneshard wiki
Jump to navigation Jump to search
(Test Fix image limiting because of "#ifeq" in excess. Add vardefine for item link. Add loop for variants. New problem, 2 extra spaces between name and image.)
Line 5: Line 5:
     -->{{#vardefine:ItemID|{{#explode: {{#var:Datastring}}|;|0}}}}<!-- valuable00;
     -->{{#vardefine:ItemID|{{#explode: {{#var:Datastring}}|;|0}}}}<!-- valuable00;
     -->{{#vardefine:ImageBase|{{#explode: {{#var:Datastring}}|;|1}}}}<!-- (valuable name);
     -->{{#vardefine:ImageBase|{{#explode: {{#var:Datastring}}|;|1}}}}<!-- (valuable name);
     -->{{#vardefine:InvSlots|{{#explode: {{#var:Datastring}}|;|2}}}}<!-- 1x1;
    -->{{#vardefine:Variants|{{#explode: {{#var:Datastring}}|;|2}}}}<!--
     -->{{#vardefine:Price|{{#explode: {{#var:Datastring}}|;|3}}}}<!-- 100;
     -->{{#vardefine:InvSlots|{{#explode: {{#var:Datastring}}|;|3}}}}<!-- 1x1;
     -->{{#vardefine:ItemDescription|{{#explode: {{#var:Datastring}}|;|4}}}}<!-- (valuable description)
     -->{{#vardefine:Price|{{#explode: {{#var:Datastring}}|;|4}}}}<!-- 100;
     -->{{#vardefine:ItemDescription|{{#explode: {{#var:Datastring}}|;|5}}}}<!-- (valuable description)
     --- Load translations that are used multiple times into variables. ---
     --- Load translations that are used multiple times into variables. ---
     -->{{#vardefine:TranslateName|{{Translate|{{{1}}}|ValuableNames}}}}
     -->{{#vardefine:TranslateName|{{Translate|{{{1}}}|ValuableNames}}}}
Line 33: Line 34:
         }}
         }}
     }}
     }}
    Variants: {{#var:ImageBase}}
     <!-- Display the rest of the data in the row -->
     <!-- Display the rest of the data in the row -->
     | {{slots|{{#explode: {{#var:InvSlots}}|x|0}}|{{#explode: {{#var:InvSlots}}|x|1}}}}
     | {{slots|{{#explode: {{#var:InvSlots}}|x|0}}|{{#explode: {{#var:InvSlots}}|x|1}}}}

Revision as of 02:01, 22 January 2025

Template-info.png Documentation

This article is a stub. You can help Stoneshard wiki by expanding it.

This Template replicates the logic used for the Template:WeaponTable/row.

Syntax

{{ValuableTable/row|Agate}}

Usage

It should be used with a 'header', right before it.
{{ValuableTable/head}}
{{ValuableTable/row|Agate}}.

Any Valuables added in Valuable Data, can be used with the '/row' template.

Debug

For future modifications or debugging, you can add this, after the "ItemDescription" variable (Open Source to verify code):

   [...]
   |{{{1}}}
   Base Image: 
   Variants: 
   Datastring: 

Examples

Single Image

Item Inv. Slots Price Gold Icon Description


Agate



   Variants: 
50× Common folk believe agate to bring good luck. It's often used to make cheap jewelry. Gold.png Agate


Multiple Images

Item Inv. Slots Price Gold Icon Description


Horse Pelt



   Variants: Horse Pelt A.png,Horse Pelt B.png,Horse Pelt C.png,Horse Pelt D.png
60× Peasants only kill horses that are hopelessly sick or already half-dead from old age. Gold.png Horse Pelt



Rabbit Pelt



   Variants: Rabbit Pelt A.png,Rabbit Pelt B.png
40-50× Despite how cautious and skittish rabbits can be, hunting one down isn't that hard. Their pelts are usually used to make clothes. Gold.png Rabbit Pelt