Difference between revisions of "Template:SetProp/doc"

From Salem Wiki
Jump to: navigation, search
m (IsLiftable not set always, to accommodate flexible use. Technology pages would not need this fe.)
Line 15: Line 15:
 
:*:It defaults to a comma '''',''''
 
:*:It defaults to a comma '''',''''
 
===Supported propname's===
 
===Supported propname's===
*It currently supports these '''multi-value''' properties:
+
It currently supports these properties in preferred sequence:
**[[Property:IsinGameMenu|IsinGameMenu]]
+
*[[Property:IsGameMenu|IsGameMenu]] (''Type: Boolean, single-value'')
**: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!
+
*:Will '''always''' be set.
**[[Property:RequiresTech|RequiresTech]]
+
*:Defaults to 'false'.
**[[Property:RequiresObj|RequiresObj]]
+
*[[Property:IsinGameMenu|IsinGameMenu]] (''Type: String, multi-value'')
**[[Property:RepairedWith|RepairedWith]]
+
*: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!
*It currently supports these '''single-value''' properties:
+
*[[Property:Has icon|Has icon]] (''Type: Page, single-value'')
**[[Property:IsGameMenu|IsGameMenu]] (Boolean)
+
*:Only supply the filename, it will automatically prepend the final property-value with <code><nowiki>Image:</nowiki></code>
**:Will '''always''' be set.
+
*:When not used, it will auto-set this property to <code><nowiki>Image:{{SUBPAGENAME}} icon.png</nowiki></code>
**:Defaults to 'false'.
+
*[[Property:Caption|Caption]] (''Type: Text, single-value'')
**[[Property:Has icon|Has icon]] (Page)
+
*:Can hold free text.
**:Only supply the filename, it will automatically prepend the final property-value with <code><nowiki>Image:</nowiki></code>
+
*[[Property:Has fullview|Has fullview]] (''Type: Page, single-value'')
**:When not used, it will auto-set this property to <code><nowiki>Image:{{SUBPAGENAME}} icon.png</nowiki></code>
+
*:Only supply the filename, it will automatically prepend the final property-value with <code><nowiki>Image:</nowiki></code>
**[[Property:Has fullview|Has fullview]] (Page)
+
*[[Property:RequiresTech|RequiresTech]] (''Type: Page, multi-value'')
**:Only supply the filename, it will automatically prepend the final property-value with <code><nowiki>Image:</nowiki></code>
+
*[[Property:RequiresObj|RequiresObj]] (''Type: String, multi-value'')
**[[Property:IsLiftable|IsLiftable]] (Boolean)
+
*[[Property:RepairedWith|RepairedWith]] (''Type: String, multi-value'')
**[[Property:IsLiftableWhenEmpty|IsLiftableWhenEmpty]] (Boolean)
+
*[[Property:IsLiftable|IsLiftable]] (''Type: Boolean, single-value'')
**:<u>When used</u> will '''always''' be set to 'true', and auto-set [[Property:IsLiftable|IsLiftable]]='true'.
+
*[[Property:IsLiftableWhenEmpty|IsLiftableWhenEmpty]] (''Type: Boolean, single-value'')
**[[Property:HP|HP]] (Number)
+
*:<u>When used</u> will '''always''' be set to 'true', and auto-set [[Property:IsLiftable|IsLiftable]]='true'.
**[[Property:Soak|Soak]] (Number)
+
*[[Property:HP|HP]] (''Type: Number, single-value'')
 +
*[[Property:Soak|Soak]] (''Type: Number, single-value'')
  
 
==Examples==
 
==Examples==

Revision as of 17:16, 29 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...

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 properties in preferred sequence:

  • IsGameMenu (Type: Boolean, single-value)
    Will always be set.
    Defaults to 'false'.
  • IsinGameMenu (Type: String, multi-value)
    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!
  • Has icon (Type: Page, single-value)
    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
  • Caption (Type: Text, single-value)
    Can hold free text.
  • Has fullview (Type: Page, single-value)
    Only supply the filename, it will automatically prepend the final property-value with Image:
  • RequiresTech (Type: Page, multi-value)
  • RequiresObj (Type: String, multi-value)
  • RepairedWith (Type: String, multi-value)
  • IsLiftable (Type: Boolean, single-value)
  • IsLiftableWhenEmpty (Type: Boolean, single-value)
    When used will always be set to 'true', and auto-set IsLiftable='true'.
  • HP (Type: Number, single-value)
  • Soak (Type: Number, single-value)

Examples

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