ModEnc is currently in Maintenance Mode: Changes could occur at any given moment, without advance warning.

Difference between revisions of "Template:Flag"

From ModEnc
Jump to: navigation, search
m (Cleaning up..)
m (Minor revision on usage notes; added a line break after template to space things out better.)
Line 43: Line 43:
 
{{!}}style="background-color:#ff5e5e"{{!}}'''Warning:'''
 
{{!}}style="background-color:#ff5e5e"{{!}}'''Warning:'''
 
{{!}}style="background-color:#ff8888"{{!}}One or more numbered subpages exist: {{ #ifexist: {{PAGENAME}}_I|[[{{PAGENAME}} I]]|}}{{ #ifexist: {{PAGENAME}}_II|, [[{{PAGENAME}} II]]|}}{{ #ifexist: {{PAGENAME}}_III|, [[{{PAGENAME}} III]]|}}{{ #ifexist: {{PAGENAME}}_IIII|, [[{{PAGENAME}} IIII]]|}}. These should be merged into ''this'' page. [[Category:Flags with import-generated subpages]]|}}
 
{{!}}style="background-color:#ff8888"{{!}}One or more numbered subpages exist: {{ #ifexist: {{PAGENAME}}_I|[[{{PAGENAME}} I]]|}}{{ #ifexist: {{PAGENAME}}_II|, [[{{PAGENAME}} II]]|}}{{ #ifexist: {{PAGENAME}}_III|, [[{{PAGENAME}} III]]|}}{{ #ifexist: {{PAGENAME}}_IIII|, [[{{PAGENAME}} IIII]]|}}. These should be merged into ''this'' page. [[Category:Flags with import-generated subpages]]|}}
|}</div>{{clr}}[[Category:INI_Flags]]</includeonly><noinclude>This template generates a standardized flag header.
+
|}</div>{{clr}}[[Category:INI_Flags]]<br /></includeonly><noinclude>This template generates a standardized flag header.
  
 
==Usage==
 
==Usage==
Line 63: Line 63:
  
 
; <code>name</code> : The exact name of the flag. Defaults to <code><nowiki>{{PAGENAME}}</nowiki></code>.
 
; <code>name</code> : The exact name of the flag. Defaults to <code><nowiki>{{PAGENAME}}</nowiki></code>.
; <code>files</code> : Which file the flag can be used in. [[Template:Categ]], with the <code>ini</code> parameter set to the correct ''ini-name'', should be used for consistency. Defaults to <code><nowiki>{{Categ|ini=rules}}</nowiki></code>.
+
; <code>files</code> : Which file the flag can be used in. [[Template:Categ]], with <nowiki>{{{ini}}}</nowiki> set to the correct ''ini-name'', should be used for consistency. Defaults to <code><nowiki>{{Categ|ini=rules}}</nowiki></code>.
 
; <code>values</code> : Possible [[Help:Values|values]] the flag accepts. [[Template:Values]] should be used for consistency.
 
; <code>values</code> : Possible [[Help:Values|values]] the flag accepts. [[Template:Values]] should be used for consistency.
 
; <code>special</code> : Special values, if any. For example, &minus;1{{fnl|1}} is a special value for {{TTL|Ammo}}. This parameter is optional{{fnl|2}}.
 
; <code>special</code> : Special values, if any. For example, &minus;1{{fnl|1}} is a special value for {{TTL|Ammo}}. This parameter is optional{{fnl|2}}.
 
; <code>default</code> : The default value for the flag. This parameter is optional{{fnl|2}}.
 
; <code>default</code> : The default value for the flag. This parameter is optional{{fnl|2}}.
; <code>types</code> : The sections the flag pertains to. [[Template:Categ]] should be used for consistency{{fnl|3}}.
+
; <code>types</code> : The sections the flag pertains to. [[Template:Categ]] should be used for consistency.
 
; <code>''games''</code> : Which games the flag is parsed in. To select a game, add a parameter in the form of <code>''code''=yes</code>. For example, <code>yr=yes</code> indicates that the flag is parsed in {{yr}}.
 
; <code>''games''</code> : Which games the flag is parsed in. To select a game, add a parameter in the form of <code>''code''=yes</code>. For example, <code>yr=yes</code> indicates that the flag is parsed in {{yr}}.
  
Line 124: Line 124:
 
{{fn|1|For negative numbers, <code>&amp;minus;</code> should be used for the sign instead of a hyphen.}}
 
{{fn|1|For negative numbers, <code>&amp;minus;</code> should be used for the sign instead of a hyphen.}}
 
{{fn|2|If there is no explicit value, do not set this parameter.}}
 
{{fn|2|If there is no explicit value, do not set this parameter.}}
{{fn|3|If the flag is parsed for all [[TechnoTypes]], use [[Template:CatAllTypes]].}}
 
 
</noinclude>
 
</noinclude>

Revision as of 19:49, 29 May 2008

This template generates a standardized flag header.

Usage

A separate flag header should be used for each context the flag is used in. Distinct contexts include files and sections where flag usage differs. For example, Template:TTL is used in rules(md).ini for SuperWeaponTypes, sound(md).ini for VocTypes, and eva(md).ini for VoxTypes. This ensures that contextual flag usage is documented with accuracy.

This template includes Category:INI Flags automatically.

{{Flag
|name=
|files={{Categ|ini=ini-name}}, ...
|values={{values|value-type}}
|special=
|default=
|types={{Categ|section-name}}, ...
|games
}}

Copy-paste the code above and fill out the parameters as follows:

name 
The exact name of the flag. Defaults to {{PAGENAME}}.
files 
Which file the flag can be used in. Template:Categ, with {{{ini}}} set to the correct ini-name, should be used for consistency. Defaults to {{Categ|ini=rules}}.
values 
Possible values the flag accepts. Template:Values should be used for consistency.
special 
Special values, if any. For example, −11 is a special value for Template:TTL. This parameter is optional2.
default 
The default value for the flag. This parameter is optional2.
types 
The sections the flag pertains to. Template:Categ should be used for consistency.
games 
Which games the flag is parsed in. To select a game, add a parameter in the form of code=yes. For example, yr=yes indicates that the flag is parsed in Yuri's Revenge.

Parameter Codes for games

Code Game
td Tiberian Dawn
co The Covert Operations
ra Red Alert
cs Counterstrike
am Aftermath
ts Tiberian Sun
fs Firestorm
ets Extended Tiberian Sun
ra2 Red Alert 2
yr Yuri's Revenge
rp RockPatch
gen Generals
zh Zero Hour
tw Tiberium Wars
kw Kane's Wrath

Notes

1 For negative numbers, &minus; should be used for the sign instead of a hyphen.

2 If there is no explicit value, do not set this parameter.