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

Template:Flag: Difference between revisions

From ModEnc
Jump to navigation Jump to search
m xgamer->XGamer
Vinifera7 (talk | contribs)
Attention ModEnc editors! For increased consistency, please review updated usage notes!
Line 22: Line 22:
|-
|-
|'''File(s):'''
|'''File(s):'''
|{{{files|{{Categ|Rules(md).ini}}}}}
|{{{files|{{ini|rules|catinc=yes}}}}}
|-
|-
|'''Values:'''
|'''Values:'''
|{{{values|ERROR - No value type or list set! Please [{{fullurl:{{FULLPAGENAME}}|action=edit}} edit] this page and fix the [[Template:Flag|Flag template]]! [[Category:Flags missing value types]]}}}
|{{{values|ERROR – No value type or list set! Please [{{fullurl:{{FULLPAGENAME}}|action=edit}} edit] this page and fix the [[Template:Flag|Flag template]]! [[Category:Flags missing value types]]}}}
|-{{#if: {{{special|}}} |<br>
|-{{#if: {{{special|}}} |<br>
{{!}}'''Special Values:'''
{{!}}'''Special Values:'''
Line 42: Line 42:
{{!}}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]]{{#if: {{{types|}}} ||[[Category:Flags missing object types they can be applied to]]}}</includeonly><noinclude>This template generates the general flag header to be used at the very top of flag pages.
|}</div>{{clr}}[[Category:INI Flags]]{{#if: {{{types|}}} ||[[Category:Flags missing object types they can be applied to]]}}</includeonly><noinclude>This template generates a standardized flag header.


==Usage==
==Usage==
<pre>{{Flag
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, {{TTL|Type}} is used in {{ini|rules}} for [[SuperWeaponTypes]], {{ini|sound}} for [[VocTypes]], and {{ini|eva}} for [[VoxTypes]]. This ensures that contextual flag usage is documented with accuracy.
|name=
 
|files=
This template includes [[:Category:INI Flags]] automatically.
|values={{values|}}
 
|special=
{{Flag
|default=
{{!}}name=
|types=
{{!}}files={{ini{{!}}''ini-name''{{!}}catinc=yes}}
|games
{{!}}values={{values{{!}}''value-type''}}
}}</pre>
{{!}}special=
{| cellpadding="4" class="table_descrow" style="float: right;"
{{!}}default=
{{!}}types=
{{!}}''games''
}}
{| cellpadding="5" class="table_descrow" style="float: right;"
!Code
!Code
!Game
!Game
Line 61: Line 65:
|-
|-
|td
|td
|[[Tiberian Dawn]]
|{{td}}
|co
|co
|[[The Covert Operations]]
|{{cop}}
|-
|-
|ra
|ra
|[[Red Alert]]
|{{ra}}
|cs
|cs
|[[Counterstrike]]
|{{cs}}
|-
|-
|am
|am
|[[Aftermath]]
|{{am}}
|ts
|ts
|[[Tiberian Sun]]
|{{ts}}
|-
|-
|fs
|fs
|[[Firestorm]]
|{{fs}}
|ets
|ets
|[[Extended Tiberian Sun]]
|{{ets}}
|-
|-
|ra2
|ra2
|[[Red Alert 2]]
|{{ra2}}
|yr
|yr
|[[Yuri's Revenge]]
|{{yr}}
|-
|-
|rp
|rp
|[[RockPatch]]
|{{rp}}
|gen
|gen
|[[Generals]]
|{{gen}}
|-
|-
|zh
|zh
|[[Zero Hour]]
|{{zh}}
|tw
|tw
|[[Tiberium Wars]]
|{{tw}}
|}
|}
Copy-paste the code above and fill out the parameters as follows:<br>
Copy-paste the code above and fill out the parameters as follows:<br>
*'''name:''' The exact name of the flag (Defaults to page name)
; <code>name</code> : The exact name of the flag. Defaults to <code><nowiki>{{PAGENAME}}</nowiki></code>.
*'''files:''' In which files this flag can be used (Defaults to {{rules}})
; <code>files</code> : Which file the flag can be used in. [[Template:Ini]], with the <code>catinc</code> parameter set to <code>yes</code>, should be used for consistency. Defaults to <code><nowiki>{{ini|rules|catinc=yes}}</nowiki></code>.
*'''values:''' Possible values/[[Help:Values|value types]]; use [[Template:Values]] for common ones.
; <code>values</code> : Possible [[Help:Values|values]] the flag accepts. [[Template:Values]] should be used for consistency.
*'''special:''' Special values, if any (like -1 for unlimited) - ''don't set this if there is none''
; <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}}.
*'''default:''' The default value for this flag - ''don't set this if there is none''
; <code>default</code> : The default value for the flag. This parameter is optional{{fnl|2}}.
*'''types:''' Where you can use this flag
; <code>types</code> : The sections the flag pertains to.
*'''games:''' In which games this flag is usable. To select a game, add a parameter in the form of code=yes to your template call, e.g. yr=yes. A list of available codes is to the right of this text.{{clr}}
; <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}}. A list of available codes is to the right of this text.
 
==Notes==
==Notes==
*If there is no value for special or default, do not set anything.
{{fn|1|For negative numbers, <code>&amp;minus;</code> should be used for the sign instead of a hyphen.}}
*If a value begins with a - (minus), write <code>&amp;#8722;value</code> instead.
{{fn|2|If there is no explicit value, do not set this parameter.}}
*This template is intended to be put directly at the page's beginning - no extra horizontal lines, to empty lines, nothing. Either relocate the TOC via <nowiki>__TOC__</nowiki> or disable it entirely via <nowiki>__NOTOC__</nowiki>.
<br>Template includes [[:Category:INI Flags]] automatically.
<br><br>
''See example usages [[Ammo|here]] and [[ButtonList|here]].''
</noinclude>
</noinclude>

Revision as of 23:08, 22 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={{ini|ini-name|catinc=yes}}
|values={{values|value-type}}
|special=
|default=
|types=
|games
}}
Code Game 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

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:Ini, with the catinc parameter set to yes, should be used for consistency. Defaults to {{ini|rules|catinc=yes}}.
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.
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. A list of available codes is to the right of this text.

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.