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 (Trying to make things easier without breaking a whole lot.. please bear with it..)
m (Cleaning up..)
Line 1: Line 1:
<includeonly><div style="position: relative; top: -1em; left: 0em;">
+
<includeonly><div style="position:relative;">
 
{| class="template_modbar_table gamegallery"
 
{| class="template_modbar_table gamegallery"
|[[Image:Game_td_{{ #ifeq: {{{td}}} | yes | yes | no }}.png|Tiberian Dawn]]
+
|[[Image:Game_td_{{#switch:{{{td}}}|yes|true|1=yes|no}}.png|Tiberian Dawn]]
|[[Image:Game_co_{{ #ifeq: {{{co}}} | yes | yes | no }}.png|The Covert Operations]]
+
|[[Image:Game_co_{{#switch:{{{co}}}|yes|true|1=yes|no}}.png|The Covert Operations]]
|[[Image:Game_ra_{{ #ifeq: {{{ra}}} | yes | yes | no }}.png|Red Alert]]
+
|[[Image:Game_ra_{{#switch:{{{ra}}}|yes|true|1=yes|no}}.png|Red Alert]]
|[[Image:Game_cs_{{ #ifeq: {{{cs}}} | yes | yes | no }}.png|Counterstrike]]
+
|[[Image:Game_cs_{{#switch:{{{cs}}}|yes|true|1=yes|no}}.png|Counterstrike]]
|[[Image:Game_am_{{ #ifeq: {{{am}}} | yes | yes | no }}.png|Aftermath]]
+
|[[Image:Game_am_{{#switch:{{{am}}}|yes|true|1=yes|no}}.png|Aftermath]]
|[[Image:Game_ts_{{ #ifeq: {{{ts}}} | yes | yes | no }}.png|Tiberian Sun]]
+
|[[Image:Game_ts_{{#switch:{{{ts}}}|yes|true|1=yes|no}}.png|Tiberian Sun]]
|[[Image:Game_fs_{{ #ifeq: {{{fs}}} | yes | yes | no }}.png|Firestorm]]
+
|[[Image:Game_fs_{{#switch:{{{fs}}}|yes|true|1=yes|no}}.png|Firestorm]]
|[[Image:Game_ets_{{ #ifeq: {{{ets}}} | yes | yes | no }}.png|Extended Tiberian Sun]]
+
|[[Image:Game_ets_{{#switch:{{{ets}}}|yes|true|1=yes|no}}.png|Extended Tiberian Sun]]
|[[Image:Game_ra2_{{ #ifeq: {{{ra2}}} | yes | yes | no }}.png|Red Alert 2]]
+
|[[Image:Game_ra2_{{#switch:{{{ra2}}}|yes|true|1=yes|no}}.png|Red Alert 2]]
|[[Image:Game_yr_{{ #ifeq: {{{yr}}} | yes | yes | no }}.png|Yuri's Revenge]]
+
|[[Image:Game_yr_{{#switch:{{{yr}}}|yes|true|1=yes|no}}.png|Yuri's Revenge]]
|[[Image:Game_rp_{{ #ifeq: {{{rp}}} | yes | yes | no }}.png|RockPatch]]
+
|[[Image:Game_rp_{{#switch:{{{rp}}}|yes|true|1=yes|no}}.png|RockPatch]]
|[[Image:Game_gen_{{ #ifeq: {{{gen}}} | yes | yes | no }}.png|Generals]]
+
|[[Image:Game_gen_{{#switch:{{{gen}}}|yes|true|1=yes|no}}.png|Generals]]
|[[Image:Game_zh_{{ #ifeq: {{{zh}}} | yes | yes | no }}.png|Zero Hour]]
+
|[[Image:Game_zh_{{#switch:{{{zh}}}|yes|true|1=yes|no}}.png|Zero Hour]]
|[[Image:Game_tw_{{ #ifeq: {{{tw}}} | yes | yes | no }}.png|Tiberium Wars]]
+
|[[Image:Game_tw_{{#switch:{{{tw}}}|yes|true|1=yes|no}}.png|Tiberium Wars]]
 +
|[[Image:Game_kw_{{#switch:{{{kw}}}|yes|true|1=yes|no}}.png|Kane's Wrath]]
 
|}
 
|}
 
{|align="left" width="100%" cellspacing="0" cellpadding="0" class="template_flag" height="100%"
 
{|align="left" width="100%" cellspacing="0" cellpadding="0" class="template_flag" height="100%"
Line 25: Line 26:
 
|-
 
|-
 
|'''Values:'''
 
|'''Values:'''
|{{{values|ERROR &ndash; 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 &ndash; No value types 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:'''
 
{{!}}{{{special}}}
 
{{!}}{{{special}}}
{{!}}- }}{{#if: {{{default|}}} |<br>
+
{{!}}-}}{{#if:{{{default|}}}|<br />
 
{{!}}'''Default:'''
 
{{!}}'''Default:'''
 
{{!}}{{{default}}}
 
{{!}}{{{default}}}
{{!}}- }}{{#if: {{{types|}}} |<br>
+
{{!}}-}}{{#if:{{{types|}}}|<br />
 
{{!}}'''Applicable to:'''
 
{{!}}'''Applicable to:'''
{{!}}{{{types}}} }}{{ #ifeq: {{{deezire}}} | yes | <br>
+
{{!}}{{{types}}}|[[Category:Flags missing object types they can be applied to]]}}{{#ifeq:{{{deezire}}}|yes|<br />
 
{{!}}-
 
{{!}}-
{{!}}colspan="2" style="background-color: #FF8888"{{!}}<p style="font-size: 85%; padding: 0.1em;">'''This entry was copied from [[DeeZire's Red Alert 2 and Yuris Revenge INI Editing Guide]] for the sake of completeness. As it is not our intention to rip off DeeZire's work, this article is subject to a re-write and update with the latest community knowledge.'''</p><p style="font-size: x-small; padding: 0.1em;">For further information, please read [[ModEnc:Inclusion of DeeZire's Red Alert 2 and Yuris Revenge INI Editing Guide|this]].</p> }}{{ #ifeq: {{{xgamer}}} | yes | <br>
+
{{!}}colspan="2" style="background-color:#ff8888"{{!}}<p style="font-size:85%; padding:0.1em;">'''This entry was copied from {{theguide}} for the sake of completeness. As it is not our intention to rip off [[DeeZire]]'s work, this article is subject to a re-write and update with the latest community knowledge.'''</p><p style="font-size:x-small; padding:0.1em;">For further information, please read [[ModEnc:Inclusion of DeeZire's Red Alert 2 and Yuris Revenge INI Editing Guide|Inclusion of The Guide]].</p>}}{{#ifeq: {{{xgamer}}}|yes|<br />
 
{{!}}-
 
{{!}}-
{{!}}colspan="2" style="background-color: #FF8888"{{!}}<p style="font-size: 85%; padding: 0.1em;">'''This entry was copied from [[Red Alert 2 ART.INI Guide|XGamer's Red Alert 2 ART.INI Guide]] for the sake of completeness. As it is not our intention to rip off xgamer's work, this article is subject to a re-write and update with the latest community knowledge.'''</p><p style="font-size: x-small; padding: 0.1em;">For further information, please read [[ModEnc:Inclusion of XGamer's ART.INI Guide|this]].</p> }}{{ #ifexpr: {{ #ifexist: {{PAGENAME}} I | 1 | 0 }} or {{ #ifexist: {{PAGENAME}} II | 1 | 0 }} or {{ #ifexist: {{PAGENAME}} III | 1 | 0 }} or {{ #ifexist: {{PAGENAME}} IIII | 1 | 0 }} | <br>
+
{{!}}colspan="2" style="background-color:#ff8888"{{!}}<p style="font-size:85%; padding:0.1em;">'''This entry was copied from [[Red Alert 2 ART.INI Guide|XGamer's Red Alert 2 ART.INI Guide]] for the sake of completeness. As it is not our intention to rip off [[XGamer]]'s work, this article is subject to a re-write and update with the latest community knowledge.'''</p><p style="font-size:x-small; padding:0.1em;">For further information, please read [[ModEnc:Inclusion of XGamer's ART.INI Guide|Inclusion of ART.INI Guide]].</p>}}{{#ifexpr:{{#ifexist:{{PAGENAME}}_I|1|0}} or {{#ifexist:{{PAGENAME}}_II|1|0}} or {{#ifexist:{{PAGENAME}}_III|1|0}} or {{#ifexist:{{PAGENAME}}_IIII|1|0}}|<br />
 
{{!}}-
 
{{!}}-
{{!}}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 a standardized flag header.
+
|}</div>{{clr}}[[Category:INI_Flags]]</includeonly><noinclude>This template generates a standardized flag header.
  
 
==Usage==
 
==Usage==
Line 51: Line 52:
 
  {{Flag
 
  {{Flag
 
  {{!}}name=
 
  {{!}}name=
  {{!}}files={{Categ{{!}}ini{{=}}''ini-name''}}
+
  {{!}}files={{Categ{{!}}ini{{=}}''ini-name''}}, ...
 
  {{!}}values={{values{{!}}''value-type''}}
 
  {{!}}values={{values{{!}}''value-type''}}
 
  {{!}}special=
 
  {{!}}special=
 
  {{!}}default=
 
  {{!}}default=
  {{!}}types=
+
  {{!}}types={{Categ{{!}}''section-name''}}, ...
 
  {{!}}''games''
 
  {{!}}''games''
 
  }}
 
  }}
{| cellpadding="5" class="table_descrow" style="float: right;"
+
 
!Code
+
Copy-paste the code above and fill out the parameters as follows:
!Game
+
 
 +
; <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>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>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>''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}}.
 +
 
 +
===Parameter Codes for ''games''===
 +
{| cellpadding="5" class="table_descrow"
 
!Code
 
!Code
 
!Game
 
!Game
 
|-
 
|-
|td
+
|<code>td</code>
 
|{{td}}
 
|{{td}}
|co
+
|-
 +
|<code>co</code>
 
|{{cop}}
 
|{{cop}}
 
|-
 
|-
|ra
+
|<code>ra</code>
 
|{{ra}}
 
|{{ra}}
|cs
+
|-
 +
|<code>cs</code>
 
|{{cs}}
 
|{{cs}}
 
|-
 
|-
|am
+
|<code>am</code>
 
|{{am}}
 
|{{am}}
|ts
+
|-
 +
|<code>ts</code>
 
|{{ts}}
 
|{{ts}}
 
|-
 
|-
|fs
+
|<code>fs</code>
 
|{{fs}}
 
|{{fs}}
|ets
+
|-
 +
|<code>ets</code>
 
|{{ets}}
 
|{{ets}}
 
|-
 
|-
|ra2
+
|<code>ra2</code>
 
|{{ra2}}
 
|{{ra2}}
|yr
+
|-
 +
|<code>yr</code>
 
|{{yr}}
 
|{{yr}}
 
|-
 
|-
|rp
+
|<code>rp</code>
 
|{{rp}}
 
|{{rp}}
|gen
+
|-
 +
|<code>gen</code>
 
|{{gen}}
 
|{{gen}}
 
|-
 
|-
|zh
+
|<code>zh</code>
 
|{{zh}}
 
|{{zh}}
|tw
+
|-
 +
|<code>tw</code>
 
|{{tw}}
 
|{{tw}}
 +
|-
 +
|<code>kw</code>
 +
|{{kw}}
 
|}
 
|}
Copy-paste the code above and fill out the parameters as follows:<br>
 
; <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>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>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.
 
; <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==
 
{{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 17:07, 23 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 the ini parameter 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 consistency3.
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.

3 If the flag is parsed for all TechnoTypes, use Template:CatAllTypes.