模板:Inventory slot/doc:修订间差异

来自The Land of StarLight
Disy留言 | 贡献
清空全部内容
标签清空 已被回退
无编辑摘要
标签手工回退
 
(未显示同一用户的1个中间版本)
第1行: 第1行:
{{documentation header}}
{{shortcut|Slot|Grid}}
{{lua|data=Inventory slot/Aliases}}
Inventory slot模板用于创建模仿游戏内物品栏的图形界面元素。图像主要取自{{tl|InvSprite}},若指定项目未被找到,模板会回落至独立图像,名称格式为<code>Grid ''<物品名>''.png</code>。


== 用法 ==
所有的输入都是可选的:<br>
<pre>{{Slot
|[Title]Mod:Name,Amount[Description]; [Title2]Mod2:Name2,Amount2[Description2]; ...
|mod=Default mod (useful for animations and layout templates)
|default=Image always shown under the main image
|align=Vertical Alignment
|link=Link override
|title=Text show on mouseover
|class=Adds additional classes to the .invslot class
|style=Adds styling to the .invslot
|imgclass=Adds additional classes to the .invslot-item
|numstyle=Adds styling to the stack number
}}</pre>
=== 部分 ===
The first parameter is a special parameter consisting of various "parts" grouped together in frames (delimited by <code>;</code>) which will be display one after another if JavaScript is enabled. Every part is optional, but without "name", won't do anything.
==== 示例 ====
To display an inventory item of "Raw Porkchop" with an stack size of 20 you would put: {{t|Slot|Raw Porkchop,20}}
;显示
{{Slot|Raw Porkchop,20}}
An amount of 2–999 is supported, anything else will not be displayed.
=== 别称 ===
{{#invoke: Inventory slot/Aliases/Table | table }}
注:旗帜变种因过多图标而不被包含在内。
The above aliases can be used to shorten common items, such as all wood blocks or adding parts to certain names by default.
{{t|Slot|Any Log;Golden Apple}}
; 显示
{{Slot|Any Log;Golden Apple}}
When using the alias, parts can be added which will override any parts in the alias.
{{t|Slot|Any Log,4;[&oShiny Apple]Enchanted Golden Apple}}
; 显示
{{Slot|Any Log,4;[&oShiny Apple]Enchanted Golden Apple}}
Mods can specify an additional aliases table using the modaliases parameter.
=== 标题和描述 ===
The title parameter can be used to set a title for all frames.
{{t|Slot|Raw Porkchop; Cooked Porkchop|title{{=}}Smelly Porkchop}}
;显示
{{Slot|Raw Porkchop; Cooked Porkchop|title=Smelly Porkchop}}
To remove the title, set it to "none": {{t|Slot|Raw Porkchop; Cooked Porkchop|title{{=}}none}}
;显示
{{Slot|Raw Porkchop; Cooked Porkchop|title=none}}
However, the first bracketed text can be used to specify a title for each frame individually, and also supports standard formatting codes using <code>&</code> instead of <code>§</code>. If the title only contains formatting codes and no actual text, the formatting will be added to the normal title.
{{t|Slot|[&b]Diamond Sword}}
;显示
{{Slot|[&b]Diamond Sword}}
The last bracketed text can be used to specify a description, this also supports standard formatting codes, and can also have multiple lines by using forward slashes (/).
{{t|Slot|[&b&oExcalibur]Iron Sword[&7Smite V/Fire Aspect I//&9+6 Attack Damage]}}
;显示
{{Slot|[&b&oExcalibur]Iron Sword[&7Smite V/Fire Aspect I//&9+6 Attack Damage]}}
=== 子框架 ===
Subframes are shown as a single frame, but the frames within it are advanced every time the subframe is displayed. A set of frames can be put in a subframe by wrapping it in braces.
Here, an alias (which resolves to multiple frames) is wrapped in a subframe, and a different wood plank variant is shown each animation cycle:
{{t|Slot|{Any Planks};Iron Ingot}}
;显示
{{Slot|{Any Planks};Iron Ingot}}
=== 对齐 ===
Align uses the [http://www.w3.org/wiki/CSS/Properties/vertical-align vertical-align] CSS property. For example to align to the middle:
<code><nowiki>Smells like{{Slot|Raw Porkchop|align=middle}}in here!</nowiki></code>
;显示
Smells like{{Slot|Raw Porkchop|align=middle}}in here!
=== 默认 ===
Default is always shown and is placed under the image. {{t|Slot|default{{=}}Grid layout Brewing Empty}}{{t|Slot|Splash Mundane Potion|default{{=}}Grid layout Brewing Empty}}
;显示
{{Slot|default=Grid layout Brewing Empty}}{{Slot|Splash Mundane Potion|default=Grid layout Brewing Empty}}
=== 链接 ===
To change the link for all frames from the image name put: {{t|Slot|Charcoal|link{{=}}煤炭#木炭}}
;显示
{{Slot|Charcoal|link=煤炭#木炭}}
To remove the link, set link to none: {{t|Slot|Charcoal|link{{=}}none}}
;显示
{{Slot|Charcoal|link=none}}
Note that this retains the title.
== 可用图像 ==
In general, an item can be referred to by its tooltip name.
For dyes, dyed items and wood, there are two shortcuts to refer to all colors or tree species. Use e.g. "Any Wood Planks" if the item appears in more than one input slot and doesn't have to be the same color in all slots. Different copies of the same "Any [item]" will switch randomly and separately among the variants. Otherwise, use "Matching [item]"; all slots containing a "Matching" item will cycle through the species or dye colors in unison, even if they're not the same item.
<pre>
{{Slot|Any Planks}}{{Slot|Any wood Slab}}{{Slot|Any wood Stairs}}
{{Slot|Matching Wood Planks}}{{Slot|Matching Wood Slab}}{{Slot|Matching wood Stairs}}
</pre>
'''shows'''
{{Slot|Any Planks}}{{Slot|Any wood Slab}}{{Slot|Any wood Stairs}}
{{Slot|Matching Planks}}{{Slot|Matching wood Slab}}{{Slot|Matching wood Stairs}}
Most items with a durability bar exist as "Damaged [item]".
See [[Template:InvSprite]] for the full list of items.
== 其他模板 ==
These templates implement this template into a GUI screen which mimics how it would look in Minecraft. Thus, they have mostly the same features as this template.
{{UI see also}}
<includeonly>
<!-- 模板分类/跨语言链接 -->
[[Category:图片模板]]
[[Category:物品栏模板]]
[[en:Template:Inventory slot]]
[[es:Plantilla:Inventory slot]]
[[fr:Modèle:Case inventaire]]
[[pt:Predefinição:Compartimento de inventário]]
[[ru:Шаблон:Инвентарный слот]]
</includeonly>
<noinclude>
<!-- 文档分类/跨语言链接 -->
[[en:Template:Inventory slot/doc]]
[[es:Plantilla:Inventory slot/doc]]
[[fr:Modèle:Case inventaire/doc]]
[[pt:Predefinição:Compartimento de inventário/doc]]
[[ru:Шаблон:Инвентарный слот/док]]
</noinclude>

2022年10月3日 (一) 12:59的最新版本

这是文档页面,它应该被放置到模板:Inventory slot,查看Template:Documentation以获取更多信息。
快捷方式
{{ #vardefine: $fullurl-url | {{fullurl: {{#replace:模板:Slot| |_}} | {{#replace:redirect=no| |_}} }}

}}[{{ #var: $fullurl-url }} Slot]

{{ #vardefine: $fullurl-url | {{fullurl: {{#replace:模板:Grid| |_}} | {{#replace:redirect=no| |_}} }}

}}[{{ #var: $fullurl-url }} Grid]

此模板使用了模块:Inventory slot,以及数据模块模块:Inventory slot/Aliases
这些脚本均使用Lua编写。更多详情,请参阅维基百科:LuaMediaWiki:扩展:Scribunto

Inventory slot模板用于创建模仿游戏内物品栏的图形界面元素。图像主要取自{{InvSprite}},若指定项目未被找到,模板会回落至独立图像,名称格式为Grid <物品名>.png

用法

所有的输入都是可选的:

{{Slot
|[Title]Mod:Name,Amount[Description]; [Title2]Mod2:Name2,Amount2[Description2]; ...
|mod=Default mod (useful for animations and layout templates)
|default=Image always shown under the main image
|align=Vertical Alignment
|link=Link override
|title=Text show on mouseover
|class=Adds additional classes to the .invslot class
|style=Adds styling to the .invslot
|imgclass=Adds additional classes to the .invslot-item
|numstyle=Adds styling to the stack number
}}

部分

The first parameter is a special parameter consisting of various "parts" grouped together in frames (delimited by ;) which will be display one after another if JavaScript is enabled. Every part is optional, but without "name", won't do anything.

示例

To display an inventory item of "Raw Porkchop" with an stack size of 20 you would put: {{Slot|Raw Porkchop,20}}

显示

20

An amount of 2–999 is supported, anything else will not be displayed.

别称

注:旗帜变种因过多图标而不被包含在内。

The above aliases can be used to shorten common items, such as all wood blocks or adding parts to certain names by default.

{{Slot|Any Log;Golden Apple}}

显示


When using the alias, parts can be added which will override any parts in the alias.

{{Slot|Any Log,4;[&oShiny Apple]Enchanted Golden Apple}}

显示

4444444Shiny Apple


Mods can specify an additional aliases table using the modaliases parameter.

标题和描述

The title parameter can be used to set a title for all frames.

{{Slot|Raw Porkchop; Cooked Porkchop|title=Smelly Porkchop}}

显示


To remove the title, set it to "none": {{Slot|Raw Porkchop; Cooked Porkchop|title=none}}

显示


However, the first bracketed text can be used to specify a title for each frame individually, and also supports standard formatting codes using & instead of §. If the title only contains formatting codes and no actual text, the formatting will be added to the normal title.

{{Slot|[&b]Diamond Sword}}

显示


The last bracketed text can be used to specify a description, this also supports standard formatting codes, and can also have multiple lines by using forward slashes (/).

{{Slot|[&b&oExcalibur]Iron Sword[&7Smite V/Fire Aspect I//&9+6 Attack Damage]}}

显示

子框架

Subframes are shown as a single frame, but the frames within it are advanced every time the subframe is displayed. A set of frames can be put in a subframe by wrapping it in braces.

Here, an alias (which resolves to multiple frames) is wrapped in a subframe, and a different wood plank variant is shown each animation cycle:

{{Slot|{Any Planks};Iron Ingot}}

显示

对齐

Align uses the vertical-align CSS property. For example to align to the middle: Smells like{{Slot|Raw Porkchop|align=middle}}in here!

显示

Smells likein here!

默认

Default is always shown and is placed under the image. {{Slot|default=Grid layout Brewing Empty}}{{Slot|Splash Mundane Potion|default=Grid layout Brewing Empty}}

显示

链接

To change the link for all frames from the image name put: {{Slot|Charcoal|link=煤炭#木炭}}

显示


To remove the link, set link to none: {{Slot|Charcoal|link=none}}

显示

Note that this retains the title.

可用图像

In general, an item can be referred to by its tooltip name.

For dyes, dyed items and wood, there are two shortcuts to refer to all colors or tree species. Use e.g. "Any Wood Planks" if the item appears in more than one input slot and doesn't have to be the same color in all slots. Different copies of the same "Any [item]" will switch randomly and separately among the variants. Otherwise, use "Matching [item]"; all slots containing a "Matching" item will cycle through the species or dye colors in unison, even if they're not the same item.

{{Slot|Any Planks}}{{Slot|Any wood Slab}}{{Slot|Any wood Stairs}}

{{Slot|Matching Wood Planks}}{{Slot|Matching Wood Slab}}{{Slot|Matching wood Stairs}}

shows

Most items with a durability bar exist as "Damaged [item]".

See Template:InvSprite for the full list of items.

其他模板

These templates implement this template into a GUI screen which mimics how it would look in Minecraft. Thus, they have mostly the same features as this template.


en:Template:Inventory slot/doc es:Plantilla:Inventory slot/doc fr:Modèle:Case inventaire/doc pt:Predefinição:Compartimento de inventário/doc ru:Шаблон:Инвентарный слот/док