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 (made "Values:" a link to my new value types tutorial - I hope it's OK)
(Added missing closing p tags)
 
(62 intermediate revisions by 10 users not shown)
Line 1: Line 1:
{|align="left" width="100%" cellspacing="0" cellpadding="0" style="border-collapse: collapse;"
+
<includeonly><div style="position:relative;">
|-style="border-bottom-color:#aaaaaa;border-bottom-style:solid;border-bottom-width:1px;"
+
{| class="template_modbar_table gamegallery"
|style="padding-left: 2px;" bgcolor="#e5e5e5" width="15%"|'''Flag:'''
+
|[[Image:Game_td_{{#switch:{{{td}}}|yes|true|1=yes|no}}.png|Tiberian Dawn]]
|style="padding-left: 3px;" bgcolor="#f0f0f0"|{{{name}}}
+
|[[Image:Game_co_{{#switch:{{{co}}}|yes|true|1=yes|no}}.png|The Covert Operations]]
|-style="border-bottom-color:#aaaaaa;border-bottom-style:solid;border-bottom-width:1px;"
+
|[[Image:Game_ra_{{#switch:{{{ra}}}|yes|true|1=yes|no}}.png|Red Alert]]
|style="padding-left: 2px;" bgcolor="#e5e5e5"|'''Files:'''
+
|[[Image:Game_cs_{{#switch:{{{cs}}}|yes|true|1=yes|no}}.png|Counterstrike]]
|style="padding-left: 3px;" bgcolor="#f0f0f0"|{{{files}}}
+
|[[Image:Game_am_{{#switch:{{{am}}}|yes|true|1=yes|no}}.png|Aftermath]]
|-style="border-bottom-color:#aaaaaa;border-bottom-style:solid;border-bottom-width:1px;"
+
|[[Image:Game_ts_{{#switch:{{{ts}}}|yes|true|1=yes|no}}.png|Tiberian Sun]]
|style="padding-left: 2px;" bgcolor="#e5e5e5"|'''[[Value types|Values]]:'''
+
|[[Image:Game_fs_{{#switch:{{{fs}}}|yes|true|1=yes|no}}.png|Firestorm]]
|style="padding-left: 3px;" bgcolor="#f0f0f0"|{{{values}}}
+
|[[Image:Game_hp_{{#switch:{{{hp}}}|yes|true|1=yes|no}}.png|HyperPatch|32px]]
|-style="border-bottom-color:#aaaaaa;border-bottom-style:solid;border-bottom-width:1px;"
+
|[[Image:Game_ra2_{{#switch:{{{ra2}}}|yes|true|1=yes|no}}.png|Red Alert 2]]
|style="padding-left: 2px;" bgcolor="#e5e5e5"|'''Special Values:'''
+
|[[Image:Game_yr_{{#switch:{{{yr}}}|yes|true|1=yes|no}}.png|Yuri's Revenge]]
|style="padding-left: 3px;" bgcolor="#f0f0f0"|{{{special}}}
+
|[[Image:Game_ares_{{#switch:{{{ares}}}|yes|true|1=yes|no}}.png|Ares]]
|-style="border-bottom-color:#aaaaaa;border-bottom-style:solid;border-bottom-width:1px;"
+
|[[Image:Game_gen_{{#switch:{{{gen}}}|yes|true|1=yes|no}}.png|Generals]]
|style="padding-left: 2px;" bgcolor="#e5e5e5"|'''Default:'''
+
|[[Image:Game_zh_{{#switch:{{{zh}}}|yes|true|1=yes|no}}.png|Zero Hour]]
|style="padding-left: 3px;" bgcolor="#f0f0f0"|{{{default}}}
+
|[[Image:Game_tw_{{#switch:{{{tw}}}|yes|true|1=yes|no}}.png|Tiberium Wars]]
|-style="border-bottom-color:#aaaaaa;border-bottom-style:solid;border-bottom-width:1px;"
+
|[[Image:Game_kw_{{#switch:{{{kw}}}|yes|true|1=yes|no}}.png|Kane's Wrath]]
|style="padding-left: 2px;" bgcolor="#e5e5e5"|'''Applicable to:'''
+
|}
|style="padding-left: 3px;" bgcolor="#f0f0f0"|{{{types}}}
+
{|align="left" width="100%" cellspacing="0" cellpadding="0" class="template_flag" height="100%"
|-style="border-bottom-color:#aaaaaa;border-bottom-style:solid;border-bottom-width:1px;"
+
|-
|style="padding-left: 2px;" bgcolor="#e5e5e5"|'''Works in Game(s):'''
+
|'''Flag:'''
|style="padding-left: 3px;" bgcolor="#f0f0f0"|{{{games}}}
+
|{{{name|{{PAGENAME}}}}}
|}<br><br><br><br><br><br><br><br>
+
|-
<includeonly>[[Category:INI Flags]]</includeonly>
+
|'''File(s):'''
<noinclude>
+
|{{{files|{{Categ|ini=rules}}}}}
<pre>{{Flag
+
|-
|name=
+
|'''Values:'''
|files=
+
|{{{values|ERROR &ndash; No value types set! Please <span class="plainlinks">[{{fullurl:{{FULLPAGENAME}}|action=edit}} edit]</span> this page and fix the [[Template:Flag|Flag template]]![[Category:Flags missing value types]]}}}
|values=
+
|-{{#if:{{{special|}}}|<br />
|special=
+
{{!}}'''Special Values:'''
|default=
+
{{!}}{{{special}}}
|types=
+
{{!}}-}}{{#if:{{{default|}}}|<br />
|games=
+
{{!}}'''Default:'''
}}</pre>
+
{{!}}{{{default}}}
Copy-paste the code above and fill out the parameters as follows:<br>
+
{{!}}-}}{{#if:{{{extver|}}}|<br />
*'''name:''' The exact name of the flag
+
{{!}}'''Extension Version:'''
*'''files:''' In which files this flag can be used
+
{{!}}{{{extver}}}
*'''values:''' Possible values
+
{{!}}-}}{{#if:{{{types|}}}|<br />
*'''special:''' Special values, if any (like -1 for unlimited)
+
{{!}}'''Applicable to:'''
*'''default:''' The default value for this flag
+
{{!}}{{{types}}}|[[Category:Flags missing object types they can be applied to]]}}{{#ifeq:{{{deezire}}}|yes|<br />
*'''types:''' Where you can use this flag
+
{{!}}-
*'''games:''' In which games this flag is usable
+
{{!}}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 />
If there is no value, put "None"; capitalization is important in this case, as there may also be the ''value'' "none", which would be lower-case only.
+
{{!}}-
<br>'''Note:''' 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>.
+
{{!}}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>}}{{#ifeq:{{{ra2obsolete}}}|yes|<br />
<br>Template includes Category:INI Flags automatically.
+
{{!}}-
<br><br>
+
{{!}}colspan="2" style="background-color:#ff8888"{{!}}<p style="font-size:85%; padding:0.1em;">'''[[Image:Cc_cnrdelete-all.png]]Logic related to {{tt|{{PAGENAME}}}}, as a whole or in part, is ''obsolete'' in {{ra2}} and/or {{yr}}.</p>[[Category:Obsolete]]}}{{#ifeq:{{{tsobsolete}}}|yes|<br />
''See example usages [[Ammo|here]] and [[ButtonList|here]].''
+
{{!}}-
</noinclude>
+
{{!}}colspan="2" style="background-color:#ff8888"{{!}}<p style="font-size:85%; padding:0.1em;">'''[[Image:Cc_cnrdelete-all.png]]Logic related to {{tt|{{PAGENAME}}}}, as a whole or in part, is ''obsolete'' in {{ts}}, {{ra2}} and/or {{yr}}.</p>[[Category:Obsolete]]}}{{#ifeq:{{{rponly}}}|yes|<br />
 +
{{!}}-
 +
{{!}}colspan="2" style="background-color:#8A2BE2"{{!}}<p style="font-size:100%; padding:0.1em">'''[[Image:Game_rp_yes.png]]{{co|This flag is part of the |white}}<b>[[RockPatch]]</b>.</p>[[Category:RockPatch Flags]]}}{{#ifeq:{{{aresflag}}}|yes|<br />
 +
{{!}}-
 +
{{!}}colspan="2" style="background-color:#0E2765"{{!}}<p style="font-size:100%; padding:0.1em;color:#E0E8FB">'''[[Image:Game_ares_yes.png]]This flag is part of <b>[[Ares|{{Co|Ares|white}}]]</b>. Do not use it without Ares installed.</p>[[Category:Ares Flags]]}}{{#ifeq:{{{hpflag}}}|yes|<br />
 +
{{!}}-
 +
{{!}}colspan="2" style="background-color:#F0C420"{{!}}<p style="font-size:100%; padding:0.1em">'''[[Image:Game_hp_yes.png|32px]]This flag is part of <b>[[HyperPatch]]</b>. Do not use it without HyperPatch installed.</p>[[Category:HyperPatch Flags]]}}{{#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:#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]]|}}
 +
|}{{clr}}[[Category:INI_Flags]]<br /></includeonly><noinclude>
 +
{{Doc}}</noinclude>

Latest revision as of 21:35, 3 April 2024

Template-info.png Template Documentation  [View] [Edit] [History] [Help] [Refresh]

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, Type 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=
|extver=
|types={{Categ|''section-name''}}, ...
|ra2obsolete=
|tsobsolete=
|rponly=
|aresflag=
|hpflag=
|''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 Ammo. This parameter is optional2.
default The default value for the flag. This parameter is optional2.
extver What version of the appropriate EXE extension (Ares or HyperPatch) is required before this flag can be used. This parameter should only be used if rponly, aresflag or hpflag is set to yes.
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.
ra2obsolete If this flag is obsolete in Red Alert 2 and Yuri's Revenge, then add this to include the Obsolete banner.
tsobsolete Add this one instead of 'ra2obsolete' if the flag is obsolete in Tiberian Sun as well as Red Alert 2 and Yuri's Revenge.
rponly If this is a flag introduced in the RockPatch, add this.
aresflag If this is a flag introduced in Ares, add this.
hpflag If this flag is introduced by HyperPatch, add this.

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
hp HyperPatch
ra2 Red Alert 2
yr Yuri's Revenge
ares Ares
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.