Difference between revisions of "Template:SetProp/doc"

From Salem Wiki
Jump to: navigation, search
m (→‎Supported propname's: added new propnames)
Line 18: Line 18:
 
===Supported propname's===
 
===Supported propname's===
 
*It currently supports these '''multi-value''' properties:
 
*It currently supports these '''multi-value''' properties:
**[[Property:IsinGameMenu|IsinGameMenu]] ⇐ Default separator is a '''^''' when no over-ride is used in '''sep''', be careful this property can use a comma in its valid value!
+
**[[Property:IsinGameMenu|IsinGameMenu]]
 +
**:Default separator in this case is a '''^''' when no over-ride is used in '''sep''', be careful this property can use a comma in its valid value!
 
**[[Property:RequiresTech|RequiresTech]]
 
**[[Property:RequiresTech|RequiresTech]]
 
**[[Property:RequiresObj|RequiresObj]]
 
**[[Property:RequiresObj|RequiresObj]]
Line 24: Line 25:
 
*It currently supports these '''single-value''' properties:
 
*It currently supports these '''single-value''' properties:
 
**[[Property:IsGameMenu|IsGameMenu]] (Boolean)
 
**[[Property:IsGameMenu|IsGameMenu]] (Boolean)
 +
**:Will '''always''' be set.
 +
**:Defaults to 'false'.
 
**[[Property:Has icon|Has icon]] (Page)
 
**[[Property:Has icon|Has icon]] (Page)
 
**:Only supply the filename, it will automatically prepend the final property-value with <code><nowiki>Image:</nowiki></code>
 
**:Only supply the filename, it will automatically prepend the final property-value with <code><nowiki>Image:</nowiki></code>
Line 30: Line 33:
 
**:Only supply the filename, it will automatically prepend the final property-value with <code><nowiki>Image:</nowiki></code>
 
**:Only supply the filename, it will automatically prepend the final property-value with <code><nowiki>Image:</nowiki></code>
 
**[[Property:IsLiftable|IsLiftable]] (Boolean)
 
**[[Property:IsLiftable|IsLiftable]] (Boolean)
 +
**:Will '''always''' be set.
 +
**:Defaults to 'false'.
 
**[[Property:IsLiftableWhenEmpty|IsLiftableWhenEmpty]] (Boolean)
 
**[[Property:IsLiftableWhenEmpty|IsLiftableWhenEmpty]] (Boolean)
**:Will auto-set [[Property:IsLiftable|IsLiftable]]='true' when used with '''any''' value, so only use it to assign a true!
+
**:Will '''always''' be set to 'true' <u>when used</u>.
 +
**:Will auto-set [[Property:IsLiftable|IsLiftable]]='true' when used.
 
**[[Property:HP|HP]] (Number)
 
**[[Property:HP|HP]] (Number)
 
**[[Property:Soak|Soak]] (Number)
 
**[[Property:Soak|Soak]] (Number)

Revision as of 17:07, 28 June 2012

Description

This is a wrapper-template that calls {{SetProp/single}} to automatically set property values.
It has a fixed-set of properties it supports, and can be expanded when needed in code...
Some properties are fit to assign multiple values to, using a sep, but those of type Boolean are obviously not...
Supported properties of type Boolean will always automatically be set to "false" as default when not explicitly set.

Syntax

Type the below code somewhere on a page:
{{SetProp
|propname=propvalues
|propname=propvalues
|...
}}
It supports this optional named-parameter:
  • sep
    The default separator used in the propvalues to separate single-values from each other.
    It defaults to a comma ','

Supported propname's

  • It currently supports these multi-value properties:
  • It currently supports these single-value properties:
    • IsGameMenu (Boolean)
      Will always be set.
      Defaults to 'false'.
    • Has icon (Page)
      Only supply the filename, it will automatically prepend the final property-value with Image:
      When not used, it will auto-set this property to Image:{{SUBPAGENAME}} icon.png
    • Has fullview (Page)
      Only supply the filename, it will automatically prepend the final property-value with Image:
    • IsLiftable (Boolean)
      Will always be set.
      Defaults to 'false'.
    • IsLiftableWhenEmpty (Boolean)
      Will always be set to 'true' when used.
      Will auto-set IsLiftable='true' when used.
    • HP (Number)
    • Soak (Number)

Examples

See the example(s) in the documentation of {{SetProp/single}}, this template just passes known properties with their values to it.