Template:Altnames: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
m (Moved doc content to their own pages.)
Line 14: Line 14:
-->{{#switch:{{{suf|}}}|#default=.|:zh-cn=。}} {{{misc|}}} }}</includeonly></onlyinclude>
-->{{#switch:{{{suf|}}}|#default=.|:zh-cn=。}} {{{misc|}}} }}</includeonly></onlyinclude>


{{doc|content=
{{doc}}
{{inline note templates}}
This template is intended to be used when an entity is tied to multiple classnames, especially those that do not appear to serve any purpose other than deprecation.
 
== Usage ==
=== Parameters ===
* {{param|name1}} ''to'' {{param|name8}} - The alternate classnames.
* {{param|misc}} - ''Optional:'' Use to display additional text in the same note.
* {{param|suf}} - ''Optional:'' This is a suffix that will be added to all elements of the template to display the content in the desired language (if it is translated into it). {{ModernNote|There should be a colon before the language code, for example ":es".}}
=== Example ===
<code style=padding:0><nowiki>{{altnames|name1=x|name2=y|name3=z}}</nowiki></code> would return as:
{{altnames|name1=x|name2=y|name3=z}}
 
<code style=padding:0><nowiki>{{altnames|name1=x|game={{game link|portal}}}}</nowiki></code> would return as:
{{altnames|name1=x|game={{game link|Portal}}}}<!--
 
-->{{clr}}
|content/zh-cn=
{{inline note templates|suf=:zh-cn|title=注释模板}}
此模板旨在当实体绑定到多个 Classname 时使用,尤其是那些除了弃用之外似乎没有任何用途的类名。
 
== 用法 ==
=== 参数 ===
* {{param|name1}} ''到'' {{param|name8}} - 备用 Classname。
* {{param|misc}} - ''可选:''用于在同一注意中显示其他文本。
* {{param|suf}} - ''可选:''这是一个后缀,将添加到模板的所有元素中,以所需的语言显示内容(如果已翻译成该语言)。{{ModernNote|suf=:zh-cn|语言代码前应该有一个冒号,例如“:es”。}}
=== 示例 ===
<code style=padding:0><nowiki>{{altnames|suf=:zh-cn|name1=x|name2=y|name3=z}}</nowiki></code> 会返回:
{{altnames|suf=:zh-cn|name1=x|name2=y|name3=z}}
 
<code style=padding:0><nowiki>{{altnames|suf=:zh-cn|name1=x|game={{game link|portal}}}}</nowiki></code> 会返回:
{{altnames|suf=:zh-cn|name1=x|game={{game link|Portal}}}}
{{clr}}
}}
 
[[Category:Inline note templates]]
[[Category:Notice templates]]

Revision as of 16:43, 4 April 2023


English (en)Deutsch (de)Esperanto (eo)Español (es)Français (fr)Suomi (fi)Hrvatski (hr)Magyar (hu)Italiano (it)日本語 (ja)한국어 (ko)Nederlands (nl)Polski (pl)Português (pt)Português do Brasil (pt-br)Русский (ru)Slovenčina (sk)Svenska (sv)Türkçe (tr)Українська (uk)Tiếng Việt (vi)中文 (zh)中文(臺灣) (zh-tw)
Curly brackets white.pngTemplate Documentation [view] [edit]
Icon-translate.png Available doc translations
View
Page history
Inline note templates
Template Pages using it
28 August 2024
{{note}} 6,436
{{warning}} 1,253
{{bug}} 1,192
{{tip}} 1,516
{{todo}} 1,628
{{inline note}} 2,188
{{confirm}} 672
{{question}} 11
{{fix}} 170
{{important}} 459
{{clarify}} 169
{{elaborate}} 18
{{main}} 143
{{distinguish}} 85
{{workaround}} 122
{{seealso}} 145
{{when}} 1
{{where}} 0
{{which}} 2
{{why}} 38
{{idea}} 21
{{placementTip}} 13
{{codenote}} 21
{{altnames}} 35
{{deprecated}} 109
{{how}} 23
{{example}} 16
{{confusion}} 53
{{thanks}} 7
{{code Fix}} 9 + 7 (16)
{{vote}} 4

This template is intended to be used when multiple entity classnames are tied to single C++ class and they are also usable interchangeably with no or very little side effects, especially those that do not appear to serve any purpose other than deprecation.

Best example of this is prop_physics and physics_prop because physics_prop's classname keyvalue is also fixed-up to prop_physics immediately as it spawns before any classname checks can happen. But prop_physics_override which is also fixed-up shortly after spawning to prop_physics would not be marked as altname because the usage of the entity differs and there are checks in code that allowed it to spawn despite the model not having prop data.

Usage

Parameters

  • {{{name1}}} to {{{name8}}} - The alternate classnames.
  • {{{misc}}} - Optional: Use to display additional text in the same note.
  • {{{suf}}} - Optional: This is a suffix that will be added to all elements of the template to display the content in the desired language (if it is translated into it).
    Note.pngNote:There should be a colon before the language code, for example ":es".

Example

{{altnames|name1=x|name2=y|name3=z}} would return as:

This entity is also tied to xy and z.

{{altnames|name1=x|game={{game link|portal}}}} would return as:

In Portal Portal , this entity is also tied to x.