Шаблон:Ct: различия между версиями

Материал из Dwarf Fortress Wiki
Перейти к навигацииПерейти к поиску
(Новая страница: «<!-- Special case if "NONE": Just display "none" without any formatting. Needed for stone templates, since NONE is found in raws. -->{{#ifeq:{{{1}}}|NONE|{{{2|н…»)
 
(Интервики, перевод, убрал пересчет в фаренгейты)
(не показана 1 промежуточная версия этого же участника)
Строка 1: Строка 1:
<!-- Special case if "NONE": Just display "none" without any formatting. Needed for stone templates, since NONE is found in raws. -->{{#ifeq:{{{1}}}|NONE|{{{2|нет}}}|{{
<!-- Special case if "NONE": Just display "none" without any formatting. Needed for stone templates, since NONE is found in raws. -->
#vardefine:temp|{{#rmatch:{{{1|0}}}|\d+(\.\d+)?|$0}}
{{#ifeq:{{uc:{{{1}}}}}|NONE|{{{2|нет}}}|{{#rmatch:{{{1|0}}}|\d+(\.\d+)?}}
}}<span style="border-bottom: 1px #0000CC dotted;cursor:help;" title="{{#expr:({{#var:temp}}-10000)*5/9 round 1}}&nbsp;°C">{{{1|0}}}{{#ifeq:{{#var:temp}}|{{{1}}}|&nbsp;°U}}</span><sup> {{
<span style="border-bottom: 1px #0000CC dotted;cursor:help;" title="{{#expr:({{#rmatch:{{{1|0}}}|\d+(\.\d+)?|$0}}-10000)*5/9 round 1}}&nbsp;°C">{{{1|0}}}{{#ifeq:{{#rmatch:{{{1|0}}}|\d+(\.\d+)?|$0}}|{{{1}}}|&nbsp;°U}}</span><sup> {{
#if:{{{1|}}}||{{ct/e|#c00|Температура не указана!}}}} {{
#if:{{{1|}}}||{{ct/e|#c00|No temperature specified!}}}} {{
#ifexpr:{{#var:temp|0}}-10000+32>-459.67||{{ct/e|#69f|Ниже абсолютного нуля}}}} {{
#ifexpr:{{#rmatch:{{{1|0}}}|\d+(\.\d+)?|$0}}-10000+32>-459.67||{{ct/e|#69f|Ниже абсолютного нуля}}}} {{
#ifexpr:{{#var:temp|0}}>60000|{{ct/e|#c60|Температура слишком высока!}}}} {{
#ifexpr:{{#rmatch:{{{1|0}}}|\d+(\.\d+)?|$0}}>60000|{{ct/e|#c60|Слишком высокая температура!}}}} {{
#ifexpr:{{#var:temp|0}}<0|{{ct/e|#00c|Температура слишком низкая!}}}}</sup>}}<noinclude>
#ifexpr:{{#rmatch:{{{1|0}}}|\d+(\.\d+)?|$0}}<0|{{ct/e|#00c|Слишком низкая температур!}}}}</sup>
}}<noinclude>
{{documentation}}
{{documentation}}
[[En:Template:Ct]]
</noinclude>
</noinclude>

Версия от 00:21, 21 июля 2018

0 ! !

[Перейти] [Изменить описание]Документация

This template assists in the display of temperatures, measured in degrees Urist, by adding a hovertext which displays the temperature in degrees Celsius, rounded to the nearest one decimal point. It is actually quite flexible, being capable of parsing the number it needs out of entire lines of text, but it is stylistically recommended you restrict the template to the temperature itself:

Code Product
[[Water]] freezes at {{ct|10000}}. Water freezes at

10000 °U .

{{ct|[[Water]] freezes at 10000 °U.}}

Water freezes at 10000 °U.

The temperature of [[magma]] is {{ct|12000}}. The temperature of magma is

12000 °U .

The template can parse both numbers and NONE, the two temperature-related values most commonly used in the raws. You can give it a second argument (which defaults to "none") for a fallback if and only if the value given is precisely NONE. This is helpful for templates that use data directly derived from parsing raw files.

Code Product
The ignition point of [[slate]]: {{ct|NONE}}. The ignition point of slate:

нет.

The ignition point of [[slate]] is {{ct|NONE|nonexistent; it never ignites}}. The ignition point of slate is

nonexistent; it never ignites.