Шаблон:Source code ref
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 = <source code version> | old = y/yes | method = <method name(s)> | t = <further comments> | <custom text> | 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.
- old
Setting this parameter signifies that the information is intentionally taken from an outdated version of Terraria's source code, e.g. for historical pieces of trivia.
- 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 (
). Has no effect if the first unnamed parameter is set.
/
- t
Can be used to add further comments to the information passed in
. Has no effect if the first unnamed parameter is set.
$method
- First unnamed parameter
Generally, all relevant information should be provided in
and optionally $method
. However, it may be necessary to use an entirely custom text, in which case this parameter can be used. It overrides both $t
and $method
.
$t
- noref
Set to
/y
to suppress the yes
<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>" />
). Has no effect if
is set.
$noref
Notes
- Although all parameters are optional,
should always be set.$v
- If the version passed in
is different from the current Desktop version (determined via$v
{{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.- This can be prevented with the
parameter.$old
- This can be prevented with the
- If there is at least one call of
{{source code ref}}
without
on the page, a new section "References" or "Footnotes" with {{reflist}} needs to be added.$noref
Examples
Code | Result |
---|---|
{{source code ref|v=1.4.4.9|noref=y}} |
Інформація взята з вихідного коду гри, версії 1.4.4.9 для ПК. |
{{source code ref|v=1.3.0.1|noref=y}} |
Інформація взята з вихідного коду гри, версії 1.3.0.1 для ПК. Можливі неточності, оскільки поточною ПК версією є 1.4.4.9. |
{{source code ref|v=1.2.4.1|old=y|noref=y}} |
Інформація взята з вихідного коду гри, версії 1.2.4.1 для ПК. |
{{source code ref|v=1.4.4.9|the field {{code|FooBar}} in {{code|Bas.cs}}.|noref=y}} |
Інформація взята з вихідного коду гри, версії 1.4.4.9 для ПК, the field in .
|
{{source code ref|v=1.4.4.9|method=Bar.Foo|t=The first <code>if-else</code> block in the method shows that ...|noref=y}} |
Інформація взята з вихідного коду гри, версії 1.4.4.9 для ПК, метод Foo() в Bar.cs . The first if-else block in the method shows that ...
|
{{source code ref|v=1.4.4.9|method=Bar.Foo / Lorem.Ipsum.Dolor / Bar.Bas|noref=y}} |
Інформація взята з вихідного коду гри, версії 1.4.4.9 для ПК, методи Foo() в Bar.cs , Dolor() в Lorem.Ipsum.cs , та Bas() в Bar.cs .
|
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.[1] |
References
- Сторінки з петлями шаблонів
- Локалізовані шаблони
- Сторінки з інформацією на основі застарілих версій вихідного коду Terraria
- Шаблони ярликів
- Reference tag templates