打开/关闭菜单
331
1.7K
131
11.8K
星露谷物语扩展百科
打开/关闭外观设置菜单
打开/关闭个人菜单
未登录
未登录用户的IP地址会在进行任意编辑后公开展示。

模板:Season:修订间差异

来自星露谷物语扩展百科
Horizon98留言 | 贡献
m 添加所有季节的可选参数(同步于英文)
Sizau留言 | 贡献
无编辑摘要
 
(未显示2个用户的11个中间版本)
第1行: 第1行:
<includeonly><!--
<includeonly><span style="display:inline; margin-right:0;">{{#switch: {{lc:{{{1}}}}}
 
|1|01|spring|[[spring]]|春季|[[春季]] = [[File:Spring.png|{{{width|24px}}}|link=]]&nbsp;[[s:春季|春季]]{{#if:{{{2|}}}|&thinsp;{{{2|}}}}}
// Define the allowed values, with handling for various quirks/oddities.
|2|02|summer|[[summer]]|夏季|[[夏季]] = [[File:Summer.png|{{{width|24px}}}|link=]]&nbsp;[[s:夏季|夏季]]{{#if:{{{2|}}}|&thinsp;{{{2|}}}}}
//  First column=icon name -> same in all languages
|3|03|fall|autumn|[[fall]]|[[autumn]]|秋季|[[秋季]] = [[File:Fall.png|{{{width|24px}}}|link=]]&nbsp;[[s:秋季|秋季]]{{#if:{{{2|}}}|&thinsp;{{{2|}}}日}}
//  Second column=link (wiki page) name, generally same as displayed text -> needs translation
|4|04|winter|[[winter]]|冬季|[[冬季]] = [[File:Winter.png|{{{width|24px}}}|link=]]&nbsp;[[s:冬季|冬季]]{{#if:{{{2|}}}|&thinsp;{{{2|}}}}}
//  All other values are synonyms
|marriage|[[marriage]]|婚姻|[[婚姻]]|婚后|[[婚后]] = [[File:Mermaid's Pendant.png|{{{width|24px}}}|link=]]&nbsp;[[s:婚姻|婚后]]
// Marriage, Deviations are for sake of NPC schedule sections (and translations)
|deviations|例外 = 例外
// For 'All Seasons' case, display text doesn't match icon or wiki-link, so
|5|05|all|any|季节|一年四季|所有季节|任意季节 = [[File:All Seasons Icon.png|{{{width|24px}}}|link=]]&nbsp;[[s:季节|任意季节]]
// define default display text in $lang_allseasons, with parameter allowing any other preferred value
|#default = {{ucfirst:{{{1|}}} }} }}</span></includeonly><noinclude>{{Documentation}}</noinclude>
-->{{ParseInputValues|code=season||
,All Seasons Icon,  季节,一年四季,All Seasons,All,Seasons,所有季节, Any, Always, Any Season,
,Spring,            春季,
,Summer,            夏季,
,Fall,              秋季, Autumn, 
,Winter,            冬季,
,Mermaid's Pendant, 婚后, Marriage,婚姻, 
,Deviations,        例外
}}{{#arraydefine:$lang_allseasons | 一年四季 }}<!--
 
// END OF translated text
 
// Check whether there's already a file link in {{{1}}}... implying this is probably a recursive call.  Return immediately
-->{{#if:{{#pos:{{{1|}}}|{{Bracket|2}}File}}|{{{1}}}|<!--
// Parse input data, then loop over all extracted entries
-->{{#arraydefine:$sseason|{{ParseInputValues|{{{1|}}}|code=season|default=true}}}}<!--
-->{{#arrayprint:$sseason||@season@|<!--
 
// Convert @season@ (icon name) into translated page name
-->{{#arraydefine:$slink_text|{{ParseInputValues|code=season|@season@|translate=true}}}}<!--
 
// Wrap a sort-key span around all items if requested. On other entries, add {{{space}}} or bullet.
-->{{#ifexpr:{{#arraysearch:$sseason|@season@}}>0
    |{{{space|&#32;•&#32;}}}
    |{{#ifexpr:{{#if:{{{sortkey|}}}|1|0}} or {{#ifeq:{{{sortkey}}}||1|0}}
        |<span data-sort-value="{{#ifeq:{{{sortkey}}}|||{{#ifeq:{{{sortkey|true}}}|true
          |{{#expr:{{#if:{{#arrayprint:$slink_text}}
            |({{ParseInputValues|code=season|@season@|translate=index}}+1)*100
    |0}}{{#iferror:{{#expr:{{{2|0}}}>0}}|| + {{{2|0}}}}}}}
          |{{{sortkey|}}}}}}}">
  }}}}<span style="display:inline; margin-right:0; white-space: nowrap"><!--
 
// Display the non-icon, non-linkable cases: Deviations, and unmatched text (detected by empty link_text)
// This is also where text_only option is handled
-->{{#ifeq:{{#arrayprint:$slink_text}}|
    | {{ucfirst:@season@}}
    | {{#ifexpr: {{#ifeq:@season@|Deviations|1|0}} or {{#if:{{{text_only|}}}|1|0}}
        | {{#if:{{{no_translate|}}}
    |{{#ifeq:@season@|All Seasons Icon|All|@season@}}
    |{{#ifeq:@season@|All Seasons Icon|{{#arrayprint:$lang_allseasons}}|{{#arrayprint:$slink_text}}}}}}
|<!--
 
// Display the normal cases: first display icon
-->[[File:@season@.png|
    {{#if:{{{size|}}}|{{{size}}}px|{{{width|24px}}}}} | link={{#arrayprint:$slink_text}} | alt=]]&nbsp;<!--
// Add day if provided
-->{{#if:{{{2|}}}|{{{2}}}&nbsp;}}<!--
 
// Add link, with special treatment for text of All Seasons
-->[[{{#arrayprint:$slink_text}}|<!--
-->{{#ifeq:@season@|All Seasons Icon
      |{{#if:{{{all|}}}|{{{all|}}}|{{#arrayprint:$lang_allseasons}}}}
      |{{#arrayprint:$slink_text}}}}]]<!--
-->}}}}</span>}}<!--
-->{{#ifexpr:{{#if:{{{sortkey|}}}|1|0}} or {{#ifeq:{{{sortkey}}}||1|0}}|</span>}}
}}</includeonly><noinclude>{{Englishdoc}}
{{{{FULLPAGENAME}}/doc}}</noinclude>

2026年1月13日 (二) 21:17的最新版本

[ 查看 | 编辑 | 历史 | 刷新 ]文档页面

描述

本模板用于显示季节信息,包括季节图标和对应的中文名称。该模板支持多种输入格式(数字、英文、中文等),并可选择性地显示具体日期。

参数

1(必需)
季节标识符,支持以下格式:
  • 数字:1(春季)、2(夏季)、3(秋季)、4(冬季)、5(任意季节)
  • 英文:spring、summer、fall/autumn、winter、all/any
  • 中文:春季、夏季、秋季、冬季、季节/一年四季/所有季节/任意季节
  • 特殊:marriage/婚姻/婚后、deviations/例外
2(可选)
具体日期数字,当提供时会在季节名称后显示“X 日”
width(可选)
图标宽度,默认为 24px

用例

基本显示

{{Season|spring}}
{{Season|1}}
{{Season|春季}}

 春季

 春季

 春季

带日期的显示

{{Season|春季|15}}
{{Season|summer|28}}
{{Season|2|7}}

 春季 15日

 夏季 28日

 夏季 7日

自定义图标大小

{{Season|winter|width=32px}}
{{Season|秋季|10|width=16px}}

 冬季

 秋季 10日

特殊季节类型

{{Season|任意季节}}
{{Season|all}}
{{Season|5}}

 任意季节

 任意季节

 任意季节

婚姻状态显示

{{Season|marriage}}
{{Season|婚后}}

 婚后

 婚后

例外情况

{{Season|deviations}}
{{Season|例外}}

例外

例外

无效输入处理

{{Season|invalid}}
{{Season|}}

Invalid

其他说明

  • 大小写不敏感(通过 lc 函数)
  • 默认图标尺寸为 24px
  • 输入无效时,返回首字母大写的原始输入
[ 查看 | 编辑 | 历史 | 刷新 ]上述文档的内容来自模板:Season/doc