Module:SpriteFile
This module implements a replacement for {{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes | n | no | f | false | off | 0 | = | = | #default = yes
}}|}}{{{{#if: |subst: }}[[{{#if: {{#pos: sprite | : }} || Template: }}sprite|{{ #ifeq: | Template | Sprite | sprite }}]]{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}}}{{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes
| n | no | f | false | off | 0 | =
| =
| #default = yes
}}|
}}{{#if: {{#pos: sprite | File: }}{{#pos: sprite | Category: }} | }}. It should generally be invoked directly on template pages, rather than using the sprite template.
Parent arguments are automatically merged with directly passed arguments (the latter overwriting the former) and all arguments are normalized to trim whitespace and set empty arguments to nil
.
Dependencies
See also
- Minecraft
- {{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes | n | no | f | false | off | 0 | = | = | #default = yes
}}|}}{{{{#if: |subst: }}[[{{#if: {{#pos: BiomeSprite | : }} || Template: }}BiomeSprite|{{ #ifeq: | Template | BiomeSprite | BiomeSprite }}]]{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}}}{{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes
| n | no | f | false | off | 0 | =
| =
| #default = yes
}}|
}}{{#if: {{#pos: BiomeSprite | File: }}{{#pos: BiomeSprite | Category: }} | }}
- {{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes | n | no | f | false | off | 0 | = | = | #default = yes
}}|}}{{{{#if: |subst: }}[[{{#if: {{#pos: BlockSprite | : }} || Template: }}BlockSprite|{{ #ifeq: | Template | BlockSprite | BlockSprite }}]]{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}}}{{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes
| n | no | f | false | off | 0 | =
| =
| #default = yes
}}|
}}{{#if: {{#pos: BlockSprite | File: }}{{#pos: BlockSprite | Category: }} | }}
- {{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes | n | no | f | false | off | 0 | = | = | #default = yes
}}|}}{{{{#if: |subst: }}[[{{#if: {{#pos: EffectSprite | : }} || Template: }}EffectSprite|{{ #ifeq: | Template | EffectSprite | EffectSprite }}]]{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}}}{{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes
| n | no | f | false | off | 0 | =
| =
| #default = yes
}}|
}}{{#if: {{#pos: EffectSprite | File: }}{{#pos: EffectSprite | Category: }} | }}
- {{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes | n | no | f | false | off | 0 | = | = | #default = yes
}}|}}{{{{#if: |subst: }}[[{{#if: {{#pos: EntitySprite | : }} || Template: }}EntitySprite|{{ #ifeq: | Template | EntitySprite | EntitySprite }}]]{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}}}{{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes
| n | no | f | false | off | 0 | =
| =
| #default = yes
}}|
}}{{#if: {{#pos: EntitySprite | File: }}{{#pos: EntitySprite | Category: }} | }}
- {{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes | n | no | f | false | off | 0 | = | = | #default = yes
}}|}}{{{{#if: |subst: }}[[{{#if: {{#pos: EnvSprite | : }} || Template: }}EnvSprite|{{ #ifeq: | Template | EnvSprite | EnvSprite }}]]{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}}}{{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes
| n | no | f | false | off | 0 | =
| =
| #default = yes
}}|
}}{{#if: {{#pos: EnvSprite | File: }}{{#pos: EnvSprite | Category: }} | }}
- {{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes | n | no | f | false | off | 0 | = | = | #default = yes
}}|}}{{{{#if: |subst: }}[[{{#if: {{#pos: ItemSprite | : }} || Template: }}ItemSprite|{{ #ifeq: | Template | ItemSprite | ItemSprite }}]]{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}}}{{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes
| n | no | f | false | off | 0 | =
| =
| #default = yes
}}|
}}{{#if: {{#pos: ItemSprite | File: }}{{#pos: ItemSprite | Category: }} | }}
- {{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes | n | no | f | false | off | 0 | = | = | #default = yes
}}|}}{{{{#if: |subst: }}[[{{#if: {{#pos: InvSprite | : }} || Template: }}InvSprite|{{ #ifeq: | Template | InvSprite | InvSprite }}]]{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}}}{{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes
| n | no | f | false | off | 0 | =
| =
| #default = yes
}}|
}}{{#if: {{#pos: InvSprite | File: }}{{#pos: InvSprite | Category: }} | }}
- {{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes | n | no | f | false | off | 0 | = | = | #default = yes
}}|}}{{{{#if: |subst: }}[[{{#if: {{#pos: SchematicSprite | : }} || Template: }}SchematicSprite|{{ #ifeq: | Template | SchematicSprite | SchematicSprite }}]]{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}}}{{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes
| n | no | f | false | off | 0 | =
| =
| #default = yes
}}|
}}{{#if: {{#pos: SchematicSprite | File: }}{{#pos: SchematicSprite | Category: }} | }}
- {{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes | n | no | f | false | off | 0 | = | = | #default = yes
}}|}}{{{{#if: |subst: }}[[{{#if: {{#pos: SlotSprite | : }} || Template: }}SlotSprite|{{ #ifeq: | Template | SlotSprite | SlotSprite }}]]{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}}}{{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes
| n | no | f | false | off | 0 | =
| =
| #default = yes
}}|
}}{{#if: {{#pos: SlotSprite | File: }}{{#pos: SlotSprite | Category: }} | }}
- {{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes | n | no | f | false | off | 0 | = | = | #default = yes
}}|}}{{{{#if: |subst: }}[[{{#if: {{#pos: PersonaSprite | : }} || Template: }}PersonaSprite|{{ #ifeq: | Template | PersonaSprite | PersonaSprite }}]]{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}}}{{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes
| n | no | f | false | off | 0 | =
| =
| #default = yes
}}|
}}{{#if: {{#pos: PersonaSprite | File: }}{{#pos: PersonaSprite | Category: }} | }}
- {{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes | n | no | f | false | off | 0 | = | = | #default = yes
}}|}}{{{{#if: |subst: }}[[{{#if: {{#pos: AchievementSprite | : }} || Template: }}AchievementSprite|{{ #ifeq: | Template | AchievementSprite | AchievementSprite }}]]{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}}}{{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes
| n | no | f | false | off | 0 | =
| =
| #default = yes
}}|
}}{{#if: {{#pos: AchievementSprite | File: }}{{#pos: AchievementSprite | Category: }} | }}
- {{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes | n | no | f | false | off | 0 | = | = | #default = yes
}}|}}{{{{#if: |subst: }}[[{{#if: {{#pos: NewAchievementSprite | : }} || Template: }}NewAchievementSprite|{{ #ifeq: | Template | NewAchievementSprite | NewAchievementSprite }}]]{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}}}{{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes
| n | no | f | false | off | 0 | =
| =
| #default = yes
}}|
}}{{#if: {{#pos: NewAchievementSprite | File: }}{{#pos: NewAchievementSprite | Category: }} | }}
- Minecraft (legacy)
- {{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes | n | no | f | false | off | 0 | = | = | #default = yes
}}|}}{{{{#if: |subst: }}[[{{#if: {{#pos: LegacyBlockSprite | : }} || Template: }}LegacyBlockSprite|{{ #ifeq: | Template | LegacyBlockSprite | LegacyBlockSprite }}]]{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}}}{{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes
| n | no | f | false | off | 0 | =
| =
| #default = yes
}}|
}}{{#if: {{#pos: LegacyBlockSprite | File: }}{{#pos: LegacyBlockSprite | Category: }} | }}
- {{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes | n | no | f | false | off | 0 | = | = | #default = yes
}}|}}{{{{#if: |subst: }}[[{{#if: {{#pos: LegacyEntitySprite | : }} || Template: }}LegacyEntitySprite|{{ #ifeq: | Template | LegacyEntitySprite | LegacyEntitySprite }}]]{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}}}{{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes
| n | no | f | false | off | 0 | =
| =
| #default = yes
}}|
}}{{#if: {{#pos: LegacyEntitySprite | File: }}{{#pos: LegacyEntitySprite | Category: }} | }}
- Minecraft Dungeons
- {{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes | n | no | f | false | off | 0 | = | = | #default = yes
}}|}}{{{{#if: |subst: }}[[{{#if: {{#pos: DungeonsLevelSprite | : }} || Template: }}DungeonsLevelSprite|{{ #ifeq: | Template | DungeonsLevelSprite | DungeonsLevelSprite }}]]{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}}}{{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes
| n | no | f | false | off | 0 | =
| =
| #default = yes
}}|
}}{{#if: {{#pos: DungeonsLevelSprite | File: }}{{#pos: DungeonsLevelSprite | Category: }} | }}
- {{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes | n | no | f | false | off | 0 | = | = | #default = yes
}}|}}{{{{#if: |subst: }}[[{{#if: {{#pos: DungeonsEnchantmentSprite | : }} || Template: }}DungeonsEnchantmentSprite|{{ #ifeq: | Template | DungeonsEnchantmentSprite | DungeonsEnchantmentSprite }}]]{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}}}{{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes
| n | no | f | false | off | 0 | =
| =
| #default = yes
}}|
}}{{#if: {{#pos: DungeonsEnchantmentSprite | File: }}{{#pos: DungeonsEnchantmentSprite | Category: }} | }}
- {{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes | n | no | f | false | off | 0 | = | = | #default = yes
}}|}}{{{{#if: |subst: }}[[{{#if: {{#pos: DungeonsEffectSprite | : }} || Template: }}DungeonsEffectSprite|{{ #ifeq: | Template | DungeonsEffectSprite | DungeonsEffectSprite }}]]{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}}}{{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes
| n | no | f | false | off | 0 | =
| =
| #default = yes
}}|
}}{{#if: {{#pos: DungeonsEffectSprite | File: }}{{#pos: DungeonsEffectSprite | Category: }} | }}
- {{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes | n | no | f | false | off | 0 | = | = | #default = yes
}}|}}{{{{#if: |subst: }}[[{{#if: {{#pos: DungeonsEntitySprite | : }} || Template: }}DungeonsEntitySprite|{{ #ifeq: | Template | DungeonsEntitySprite | DungeonsEntitySprite }}]]{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}}}{{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes
| n | no | f | false | off | 0 | =
| =
| #default = yes
}}|
}}{{#if: {{#pos: DungeonsEntitySprite | File: }}{{#pos: DungeonsEntitySprite | Category: }} | }}
- {{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes | n | no | f | false | off | 0 | = | = | #default = yes
}}|}}{{{{#if: |subst: }}[[{{#if: {{#pos: DungeonsItemSprite | : }} || Template: }}DungeonsItemSprite|{{ #ifeq: | Template | DungeonsItemSprite | DungeonsItemSprite }}]]{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}}}{{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes
| n | no | f | false | off | 0 | =
| =
| #default = yes
}}|
}}{{#if: {{#pos: DungeonsItemSprite | File: }}{{#pos: DungeonsItemSprite | Category: }} | }}
- {{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes | n | no | f | false | off | 0 | = | = | #default = yes
}}|}}{{{{#if: |subst: }}[[{{#if: {{#pos: DungeonsAchievementSprite | : }} || Template: }}DungeonsAchievementSprite|{{ #ifeq: | Template | DungeonsAchievementSprite | DungeonsAchievementSprite }}]]{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}}}{{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes
| n | no | f | false | off | 0 | =
| =
| #default = yes
}}|
}}{{#if: {{#pos: DungeonsAchievementSprite | File: }}{{#pos: DungeonsAchievementSprite | Category: }} | }}
- {{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes | n | no | f | false | off | 0 | = | = | #default = yes
}}|}}{{{{#if: |subst: }}[[{{#if: {{#pos: DungeonsMiscellaneousSprite | : }} || Template: }}DungeonsMiscellaneousSprite|{{ #ifeq: | Template | DungeonsMiscellaneousSprite | DungeonsMiscellaneousSprite }}]]{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}}}{{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes
| n | no | f | false | off | 0 | =
| =
| #default = yes
}}|
}}{{#if: {{#pos: DungeonsMiscellaneousSprite | File: }}{{#pos: DungeonsMiscellaneousSprite | Category: }} | }}
- Minecraft Legends
- {{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes | n | no | f | false | off | 0 | = | = | #default = yes
}}|}}{{{{#if: |subst: }}[[{{#if: {{#pos: LegendsEntitySprite | : }} || Template: }}LegendsEntitySprite|{{ #ifeq: | Template | LegendsEntitySprite | LegendsEntitySprite }}]]{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}}}{{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes
| n | no | f | false | off | 0 | =
| =
| #default = yes
}}|
}}{{#if: {{#pos: LegendsEntitySprite | File: }}{{#pos: LegendsEntitySprite | Category: }} | }}
- {{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes | n | no | f | false | off | 0 | = | = | #default = yes
}}|}}{{{{#if: |subst: }}[[{{#if: {{#pos: LegendsStructureSprite | : }} || Template: }}LegendsStructureSprite|{{ #ifeq: | Template | LegendsStructureSprite | LegendsStructureSprite }}]]{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}}}{{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes
| n | no | f | false | off | 0 | =
| =
| #default = yes
}}|
}}{{#if: {{#pos: LegendsStructureSprite | File: }}{{#pos: LegendsStructureSprite | Category: }} | }}
- {{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes | n | no | f | false | off | 0 | = | = | #default = yes
}}|}}{{{{#if: |subst: }}[[{{#if: {{#pos: Template:LegendsAchievementSprite | : }} || Template: }}Template:LegendsAchievementSprite|{{ #ifeq: Template | Template | LegendsAchievementSprite | Template:LegendsAchievementSprite }}]]{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}}}{{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes
| n | no | f | false | off | 0 | =
| =
| #default = yes
}}|
}}{{#if: {{#pos: Template:LegendsAchievementSprite | File: }}{{#pos: Template:LegendsAchievementSprite | Category: }} | }}
- {{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes | n | no | f | false | off | 0 | = | = | #default = yes
}}|}}{{{{#if: |subst: }}[[{{#if: {{#pos: LegendsMiscellaneousSprite | : }} || Template: }}LegendsMiscellaneousSprite|{{ #ifeq: | Template | LegendsMiscellaneousSprite | LegendsMiscellaneousSprite }}]]{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}}}{{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes
| n | no | f | false | off | 0 | =
| =
| #default = yes
}}|
}}{{#if: {{#pos: LegendsMiscellaneousSprite | File: }}{{#pos: LegendsMiscellaneousSprite | Category: }} | }}
- Minecraft Story Mode
- {{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes | n | no | f | false | off | 0 | = | = | #default = yes
}}|}}{{{{#if: |subst: }}[[{{#if: {{#pos: StoryModeAreaSprite | : }} || Template: }}StoryModeAreaSprite|{{ #ifeq: | Template | StoryModeAreaSprite | StoryModeAreaSprite }}]]{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}}}{{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes
| n | no | f | false | off | 0 | =
| =
| #default = yes
}}|
}}{{#if: {{#pos: StoryModeAreaSprite | File: }}{{#pos: StoryModeAreaSprite | Category: }} | }}
- {{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes | n | no | f | false | off | 0 | = | = | #default = yes
}}|}}{{{{#if: |subst: }}[[{{#if: {{#pos: StoryModeEntitySprite | : }} || Template: }}StoryModeEntitySprite|{{ #ifeq: | Template | StoryModeEntitySprite | StoryModeEntitySprite }}]]{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}}}{{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes
| n | no | f | false | off | 0 | =
| =
| #default = yes
}}|
}}{{#if: {{#pos: StoryModeEntitySprite | File: }}{{#pos: StoryModeEntitySprite | Category: }} | }}
- {{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes | n | no | f | false | off | 0 | = | = | #default = yes
}}|}}{{{{#if: |subst: }}[[{{#if: {{#pos: StoryModeItemSprite | : }} || Template: }}StoryModeItemSprite|{{ #ifeq: | Template | StoryModeItemSprite | StoryModeItemSprite }}]]{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}}}{{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes
| n | no | f | false | off | 0 | =
| =
| #default = yes
}}|
}}{{#if: {{#pos: StoryModeItemSprite | File: }}{{#pos: StoryModeItemSprite | Category: }} | }}
- {{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes | n | no | f | false | off | 0 | = | = | #default = yes
}}|}}{{{{#if: |subst: }}[[{{#if: {{#pos: Template:StoryModeAchievementSprite | : }} || Template: }}Template:StoryModeAchievementSprite|{{ #ifeq: Template | Template | StoryModeAchievementSprite | Template:StoryModeAchievementSprite }}]]{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}}}{{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes
| n | no | f | false | off | 0 | =
| =
| #default = yes
}}|
}}{{#if: {{#pos: Template:StoryModeAchievementSprite | File: }}{{#pos: Template:StoryModeAchievementSprite | Category: }} | }}
- A Minecraft Movie
- {{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes | n | no | f | false | off | 0 | = | = | #default = yes
}}|}}{{{{#if: |subst: }}[[{{#if: {{#pos: MovieSprite | : }} || Template: }}MovieSprite|{{ #ifeq: | Template | MovieSprite | MovieSprite }}]]{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}}}{{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes
| n | no | f | false | off | 0 | =
| =
| #default = yes
}}|
}}{{#if: {{#pos: MovieSprite | File: }}{{#pos: MovieSprite | Category: }} | }}
- Other
- {{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes | n | no | f | false | off | 0 | = | = | #default = yes
}}|}}{{{{#if: |subst: }}[[{{#if: {{#pos: Sprite | : }} || Template: }}Sprite|{{ #ifeq: | Template | Sprite | Sprite }}]]{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}}}{{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes
| n | no | f | false | off | 0 | =
| =
| #default = yes
}}|
}}{{#if: {{#pos: Sprite | File: }}{{#pos: Sprite | Category: }} | }}
- {{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes | n | no | f | false | off | 0 | = | = | #default = yes
}}|}}{{{{#if: |subst: }}[[{{#if: {{#pos: Sprite grid | : }} || Template: }}Sprite grid|{{ #ifeq: | Template | Sprite grid | Sprite grid }}]]{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}}}{{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes
| n | no | f | false | off | 0 | =
| =
| #default = yes
}}|
}}{{#if: {{#pos: Sprite grid | File: }}{{#pos: Sprite grid | Category: }} | }}
- {{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes | n | no | f | false | off | 0 | = | = | #default = yes
}}|}}{{{{#if: |subst: }}[[{{#if: {{#pos: Layered blueprint | : }} || Template: }}Layered blueprint|{{ #ifeq: | Template | Layered blueprint | Layered blueprint }}]]{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}}}{{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes
| n | no | f | false | off | 0 | =
| =
| #default = yes
}}|
}}{{#if: {{#pos: Layered blueprint | File: }}{{#pos: Layered blueprint | Category: }} | }}
- {{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes | n | no | f | false | off | 0 | = | = | #default = yes
}}|}}{{{{#if: |subst: }}[[{{#if: {{#pos: Schematic | : }} || Template: }}Schematic|{{ #ifeq: | Template | Schematic | Schematic }}]]{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}}}{{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes
| n | no | f | false | off | 0 | =
| =
| #default = yes
}}|
}}{{#if: {{#pos: Schematic | File: }}{{#pos: Schematic | Category: }} | }}
- {{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes | n | no | f | false | off | 0 | = | = | #default = yes
}}|}}{{{{#if: |subst: }}[[{{#if: {{#pos: SchematicSprite | : }} || Template: }}SchematicSprite|{{ #ifeq: | Template | SchematicSprite | SchematicSprite }}]]{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}}}{{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes
| n | no | f | false | off | 0 | =
| =
| #default = yes
}}|
}}{{#if: {{#pos: SchematicSprite | File: }}{{#pos: SchematicSprite | Category: }} | }}
- {{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes | n | no | f | false | off | 0 | = | = | #default = yes
}}|}}{{{{#if: |subst: }}[[{{#if: {{#pos: CommentSprite | : }} || Template: }}CommentSprite|{{ #ifeq: | Template | CommentSprite | CommentSprite }}]]{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}}}{{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes
| n | no | f | false | off | 0 | =
| =
| #default = yes
}}|
}}{{#if: {{#pos: CommentSprite | File: }}{{#pos: CommentSprite | Category: }} | }}
- {{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes | n | no | f | false | off | 0 | = | = | #default = yes
}}|}}{{{{#if: |subst: }}[[{{#if: {{#pos: FrontPageSprite | : }} || Template: }}FrontPageSprite|{{ #ifeq: | Template | FrontPageSprite | FrontPageSprite }}]]{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}}}{{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes
| n | no | f | false | off | 0 | =
| =
| #default = yes
}}|
}}{{#if: {{#pos: FrontPageSprite | File: }}{{#pos: FrontPageSprite | Category: }} | }}
- {{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes | n | no | f | false | off | 0 | = | = | #default = yes
}}|}}{{{{#if: |subst: }}[[{{#if: {{#pos: ProgressSprite | : }} || Template: }}ProgressSprite|{{ #ifeq: | Template | ProgressSprite | ProgressSprite }}]]{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}}}{{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes
| n | no | f | false | off | 0 | =
| =
| #default = yes
}}|
}}{{#if: {{#pos: ProgressSprite | File: }}{{#pos: ProgressSprite | Category: }} | }}
- {{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes | n | no | f | false | off | 0 | = | = | #default = yes
}}|}}{{{{#if: |subst: }}[[{{#if: {{#pos: Tint | : }} || Template: }}Tint|{{ #ifeq: | Template | Tint | Tint }}]]{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}}}{{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes
| n | no | f | false | off | 0 | =
| =
| #default = yes
}}|
}}{{#if: {{#pos: Tint | File: }}{{#pos: Tint | Category: }} | }}
es:Módulo:SpriteFile fr:Module:SpriteFile it:Modulo:SpriteFile ja:モジュール:SpriteFile ko:모듈:SpriteFile lzh:模組:SpriteFile pt:Módulo:SpriteFile ru:Модуль:СпрайтФайл th:มอดูล:SpriteFile uk:Модуль:СпрайтФайл zh:Module:SpriteFile
local p = {}
function p.sprite( f )
local args = f
if f == mw.getCurrentFrame() then
args = require( 'Module:ProcessArgs' ).merge( true )
else
f = mw.getCurrentFrame()
end
-- Default settings
local default = {
scale = 1,
size = 16,
align = 'text-top'
}
local id = mw.text.trim( tostring( args[1] or '' ) )
if not args.keepcase then
id = mw.ustring.lower( id ):gsub( '[%s%+]', '-' )
end
local link = ( args.link or '' )
if mw.ustring.lower( link ) == 'none' then
link = ''
elseif link ~= '' then
local linkPrefix = ( not link:find( '//' ) and args.linkprefix ) or ''
link = linkPrefix .. link
end
local scale = args.scale or default.scale
local height = ( args.height or args.size or default.size ) * scale
local width = ( args.width or args.size or default.size ) * scale
local size = width .. 'x' .. height .. 'px'
local styles = {}
if height ~= default.size then
styles[#styles + 1] = 'height:' .. height .. 'px'
end
if width ~= default.size then
styles[#styles + 1] = 'width:' .. width .. 'px'
end
local name = args.name
if name == 'InvSprite' then
name = 'Invicon'
end
local file = name .. ' ' .. id .. '.png'
local altText = ''
if link == '' then
altText = file .. ': Sprite image for ' .. id .. ' in Minecraft'
end
if id == '' then
file = 'Grid Unknown.png'
altText = 'Unknown sprite image'
end
local sprite = mw.html.create( 'span' ):addClass( 'sprite-file' )
local img = '[[File:' .. file .. '|' .. size .. '|link=' .. link .. '|alt=' .. altText .. '|class=pixel-image|' .. ( args.title or '' ) .. ']]'
sprite:node( img )
local align = args.align or default.align
if align ~= default.align then
styles[#styles + 1] = '--vertical-align:' .. align
end
styles[#styles + 1] = args.css
sprite:cssText( table.concat( styles, ';' ) )
local root
local spriteText
if args.text then
if not args['wrap'] then
root = mw.html.create( 'span' ):addClass( 'nowrap' )
end
spriteText = mw.html.create( 'span' ):addClass( 'sprite-text' ):wikitext( args.text )
if args.title then
spriteText:attr( 'title', args.title )
end
if link ~= '' then
-- External link
if link:find( '//' ) then
spriteText = '[' .. link .. ' ' .. tostring( spriteText ) .. ']'
else
spriteText = '[[' .. link .. '|' .. tostring( spriteText ) .. ']]'
end
end
end
if not root then
root = mw.html.create( '' )
end
root:node( sprite )
if spriteText then
root:node( spriteText )
end
return tostring( root )
end
function p.link( f )
local args = f
if f == mw.getCurrentFrame() then
args = require( 'Module:ProcessArgs' ).merge( true )
end
local link = args[1]
if args[1] and not args.id then
link = args[1]:match( '^(.-)%+' ) or args[1]
end
local text
if not args.notext then
text = args.text or args[2] or link
end
args[1] = args.id or args[1]
args.link = args.link or link
args.text = text
return p.sprite( args )
end
return p