Difference between revisions of "Template:TraitAbility"

From Holdfast: Nations At War
Jump to navigation Jump to search
(Initial template for traits and abilities)
 
m
 
(16 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
<noinclude>
 
<noinclude>
 +
== USAGE ==
 
Used to create a single row detailing a trait / ability
 
Used to create a single row detailing a trait / ability
  
It'd be great to drive this with ParserFunctions and one of the simple data extensions like Cargo, External Data or Semantic MediaWiki so we can update in one place
+
<!--{{#cargo_declare:_table=TraitAbility|Type=String (allowed values=Trait,Ability;mandatory)|Enum=String (mandatory;unique)|Name=String|Description=Wikitext string (size=500)}}-->
 +
 
 +
Usage:
 +
<pre>{{TraitAbility|enum=Enum of Ability}</pre>
 +
 
 +
e.g.
 +
<pre>{{TraitAbility|enum=AbleSwimmer}</pre>
 +
{{TraitAbility|enum=AbleSwimmer}}
 +
 
 +
== SETUP ==
 +
This is driven by sub-templates for the data used (these also feed other uses of trait/ability data).  To add a new trait to the template, do not edit this page, but edit the sub-templates and upload a trait image.  This should be resized to 55x55px and should be named Trait_[enum].png, replacing [enum] with the name of the trait.
 +
 
 +
So:
 +
 
 +
<code>
 +
[[Template:TraitAbility/Type|<nowiki>{{TraitAbility/Type|AbleSwimmer}}</nowiki>]]
 +
 
 +
[[Template:TraitAbility/Name|<nowiki>{{TraitAbility/Name|AbleSwimmer}}</nowiki>]]
 +
 
 +
[[Template:TraitAbility/Description|<nowiki>{{TraitAbility/Description|AbleSwimmer}}</nowiki>]]
 +
</code>
 +
 
 +
Results in:
 +
 
 +
<code>
 +
{{TraitAbility/Type|AbleSwimmer}}
 +
 
 +
{{TraitAbility/Name|AbleSwimmer}}
 +
 
 +
{{TraitAbility/Description|AbleSwimmer}}
 +
</code>
 +
 
 
</noinclude>
 
</noinclude>
 
<includeonly>
 
<includeonly>
{| class=wikitable
+
{| class=wikitable style="margin-bottom:0px;margin-top:0px"
 
|-
 
|-
| <!-- Icon --> style="width: 250px" [[File:Trait_{{{ trait |blank }}}]]
+
| style="width: 100px;text-align: center" | [[File:{{TraitAbility/Type|{{{enum}}}}}_{{{ enum|blank }}}.png|55x55px]]
| <!-- Name --> style="width: 350px" {{{ name }}}
+
| style="width: 350px" | {{TraitAbility/Name|{{{enum}}}}}
| <!-- Description --> style="width: 500px" {{{ description }}}
+
| style="width: 500px" | {{TraitAbility/Description|{{{enum}}}}}
|}
+
|}</includeonly>
</includeonly>
 

Latest revision as of 19:44, 22 February 2020

USAGE

Used to create a single row detailing a trait / ability


Usage:

{{TraitAbility|enum=Enum of Ability}

e.g.

{{TraitAbility|enum=AbleSwimmer}


Trait AbleSwimmer.png Able Swimmer Lightly equipped. Your swimming speed is increased by 35%.

SETUP

This is driven by sub-templates for the data used (these also feed other uses of trait/ability data). To add a new trait to the template, do not edit this page, but edit the sub-templates and upload a trait image. This should be resized to 55x55px and should be named Trait_[enum].png, replacing [enum] with the name of the trait.

So:

{{TraitAbility/Type|AbleSwimmer}}

{{TraitAbility/Name|AbleSwimmer}}

{{TraitAbility/Description|AbleSwimmer}}

Results in:

Trait

Able Swimmer

Lightly equipped. Your swimming speed is increased by 35%.