:Source code ref/doc

Terraria Wiki
둘러보기로 이동 검색으로 이동

This template can be used to mark information as being taken from Terraria's source code. It prints a short, modifiable text wrapped in a <ref> tag.

Usage

{{source code ref | v = <current version> | <further comments> | method = <method name(s)> | noref = y/yes | name = <custom <ref> name> }}

v

Set it to the version of Terraria from which the information was taken. This is important because the game and source code change over time, and it helps identifying potentially outdated information in future updates.

First unnamed parameter

Can be used to add further comments, like method names or other specifications.

method

If there is a specific method that the information was taken from, its name (including full namespace) can be passed to this parameter. This is useful for an automatic, standardized formatting and localization. Multiple method names can be passed as well, separated by a slash (/). The first unnamed parameter always takes precedence over this parameter.

noref

Set to y/yes to suppress the <ref> tag.

name

Can be used to specify a custom name for the <ref>, so that a <ref> can be reused several times (via <ref name="<name>" />). Only has an effect if $noref is not set.

Notes

  • Although all parameters are optional, $v should always be set.
  • If the version passed in $v is different from the current Desktop version (determined via {{version|desktop}}), a note will be appended. The page will furthermore be categorized in Category:Pages with information based on outdated versions of Terraria's source code.
  • If there is at least one call of {{source code ref}} without $noref on the page, a new section "References" or "Footnotes" with {{reflist}} needs to be added.

Examples

Code Result
{{source code ref|v=틀:V|noref=y}} 틀:Source code ref
{{source code ref|v=1.3.0.1|noref=y}} 틀:Source code ref
{{source code ref|v=틀:V|the first block in method {{code|Foo()}} in {{code|Bar.cs}}.|noref=y}} 틀:Source code ref
{{source code ref|v=틀:V|method=Bar.Foo / Lorem.Ipsum.Dolor / Bar.Bas|noref=y}} 틀:Source code ref
The thing takes three seconds to be done in Classic Mode and six seconds in Expert Mode.{{source code ref|v=1.3.0.1|method=Bar.Foo}} The thing takes three seconds to be done in Classic Mode and six seconds in Expert Mode.틀:Source code ref

References