Template:AdvancementIcon/doc: Difference between revisions

From Official Gamemode 4 Wiki
Jump to navigation Jump to search
(Added another example usage)
m (Forgot to move the name in docs)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
Using this template, you can create the advancements as seen within the game.   
Using this template, you can create the advancement icons as seen within the game.   


The images used are taken from <code><nowiki>{{</nowiki>[[Module:InvSprite|InvSprite]]<nowiki>}}</nowiki></code>.
The images used are taken from <code><nowiki>{{</nowiki>[[Module:InvSprite|InvSprite]]<nowiki>}}</nowiki></code>.


{{Advancement}}
{{AdvancementIcon}}


== Usage ==
== Usage ==
Line 22: Line 22:
! Parameters
! Parameters
|-
|-
| style = "text-align:center" | {{Advancement|Air|bg=plain|state=raw}}
| style = "text-align:center" | {{AdvancementIcon|Air|bg=plain|state=raw}}
| {{Code|plain<nowiki>|</nowiki>raw}}
| {{Code|plain<nowiki>|</nowiki>raw}}
|-
|-
| style = "text-align:center" | {{Advancement|Air|bg=oval|state=raw}}
| style = "text-align:center" | {{AdvancementIcon|Air|bg=oval|state=raw}}
| {{Code|oval<nowiki>|</nowiki>raw}}
| {{Code|oval<nowiki>|</nowiki>raw}}
|-
|-
| style = "text-align:center" | {{Advancement|Air|bg=fancy|state=raw}}
| style = "text-align:center" | {{AdvancementIcon|Air|bg=fancy|state=raw}}
| {{Code|fancy<nowiki>|</nowiki>raw}}
| {{Code|fancy<nowiki>|</nowiki>raw}}
|-
|-
| style = "text-align:center" | {{Advancement|Air|bg=plain|state=worn}}
| style = "text-align:center" | {{AdvancementIcon|Air|bg=plain|state=worn}}
| {{Code|plain<nowiki>|</nowiki>worn}}
| {{Code|plain<nowiki>|</nowiki>worn}}
|-
|-
| style = "text-align:center" | {{Advancement|Air|bg=oval|state=worn}}
| style = "text-align:center" | {{AdvancementIcon|Air|bg=oval|state=worn}}
| {{Code|oval<nowiki>|</nowiki>worn}}
| {{Code|oval<nowiki>|</nowiki>worn}}
|-
|-
| style = "text-align:center" | {{Advancement|Air|bg=fancy|state=worn}}
| style = "text-align:center" | {{AdvancementIcon|Air|bg=fancy|state=worn}}
| {{Code|fancy<nowiki>|</nowiki>worn}}
| {{Code|fancy<nowiki>|</nowiki>worn}}
|}
|}
Line 43: Line 43:
=== Link ===
=== Link ===


<span style = "color:red">NOTE: Link is not implemented, as <code><nowiki>{{</nowiki>Advancement<nowiki>}}</nowiki></code> currently uses <code><nowiki>{{</nowiki>Stack<nowiki>}}</nowiki></code> and not <code><nowiki>{{</nowiki>Inventory Icon<nowiki>}}</nowiki></code>.</span>
<span style = "color:red">NOTE: Link is not implemented, as <code><nowiki>{{</nowiki>AdvancementIcon<nowiki>}}</nowiki></code> currently uses <code><nowiki>{{</nowiki>Stack<nowiki>}}</nowiki></code> and not <code><nowiki>{{</nowiki>InventoryIcon<nowiki>}}</nowiki></code>.</span>


''Optional.''  An advancement icon can contain a link using {{Code|{{{link}}}}}.
''Optional.''  An advancement icon can contain a link using {{Code|{{{link}}}}}.


To link [[Boots of Ostara]], you would use <code><nowiki>{{</nowiki>Advancement|gm4:Boots of Ostara|link=Boots of Ostara<nowiki>}}</nowiki></code>.
To link [[Boots of Ostara]], you would use <code><nowiki>{{</nowiki>AdvancementIcon|gm4:Boots of Ostara|link=Boots of Ostara<nowiki>}}</nowiki></code>.


== Example Usage ==
== Example Usage ==


Advancements can be placed inline by placing two <code><nowiki>{{</nowiki>Advancement<nowiki>}}</nowiki></code>s next to one another, without spaces or newlines.
Advancement Icons can be placed inline by placing two <code><nowiki>{{</nowiki>AdvancementIcon<nowiki>}}</nowiki></code>s next to one another, without spaces or newlines.


New lines and spacing within <code><nowiki>{{</nowiki>Advancement<nowiki>}}</nowiki></code> is ignored, as long as the parameter is stated, e.g., <code>bg = plain</code>.
New lines and spacing within <code><nowiki>{{</nowiki>AdvancementIcon<nowiki>}}</nowiki></code> is ignored, as long as the parameter is stated, e.g., <code>bg = plain</code>.


The second and third parameters can be written inline, as shown in the last example, but unless the template is written without spaces, the output will fail.
The second and third parameters can be written inline, as shown in the last example, but unless the template is written without spaces, the output will fail.


<pre>
<pre>
{{Advancement
{{AdvancementIcon
  | Furnace
  | Furnace
  | bg = plain
  | bg = plain
  | state = raw}}{{Advancement|Furnace|bg = oval|state = worn}}
  | state = raw}}{{AdvancementIcon|Furnace|bg = oval|state = worn}}


{{Advancement
{{AdvancementIcon
  | gm4:SCUBA Helmet
  | gm4:SCUBA Helmet
  | bg = fancy
  | bg = fancy
  | state = worn
  | state = worn
  | link = SCUBA Gear
  | link = SCUBA Gear
}}{{Advancement|Diamond Hoe|fancy|raw}}
}}{{AdvancementIcon|Diamond Hoe|fancy|raw}}
</pre>
</pre>


{{Advancement
{{AdvancementIcon
  | Furnace
  | Furnace
  | bg = plain
  | bg = plain
  | state = raw
  | state = raw
}}{{Advancement|Furnace|bg = oval|state = worn}}
}}{{AdvancementIcon|Furnace|bg = oval|state = worn}}


{{Advancement
{{AdvancementIcon
  | gm4:SCUBA Helmet
  | gm4:SCUBA Helmet
  | bg = fancy
  | bg = fancy
  | state = worn
  | state = worn
  | link = SCUBA Gear
  | link = SCUBA Gear
}}{{Advancement|Diamond Hoe|fancy|raw}}
}}{{AdvancementIcon|Diamond Hoe|fancy|raw}}


== See Also ==
== See Also ==

Latest revision as of 23:13, 12 August 2020

Using this template, you can create the advancement icons as seen within the game.

The images used are taken from {{InvSprite}}.

Usage

Image

Using the first parameter, {{{1}}}, you can set the image to the specified block or item or a fallback image.

For Gamemode 4 specific items or blocks, gm4: must prefix the name, e.g., gm4:Boots of Ostara

Background

Optional. The second parameter, {{{bg}}}, is used to set the background.

Optional. The third parameter, {{{state}}}, is used to display advancement completion state.

Background Parameters
plain|raw
oval|raw
fancy|raw
plain|worn
oval|worn
fancy|worn

Link

NOTE: Link is not implemented, as {{AdvancementIcon}} currently uses {{Stack}} and not {{InventoryIcon}}.

Optional. An advancement icon can contain a link using {{{link}}}.

To link Boots of Ostara, you would use {{AdvancementIcon|gm4:Boots of Ostara|link=Boots of Ostara}}.

Example Usage

Advancement Icons can be placed inline by placing two {{AdvancementIcon}}s next to one another, without spaces or newlines.

New lines and spacing within {{AdvancementIcon}} is ignored, as long as the parameter is stated, e.g., bg = plain.

The second and third parameters can be written inline, as shown in the last example, but unless the template is written without spaces, the output will fail.

{{AdvancementIcon
 | Furnace
 | bg = plain
 | state = raw}}{{AdvancementIcon|Furnace|bg = oval|state = worn}}

{{AdvancementIcon
 | gm4:SCUBA Helmet
 | bg = fancy
 | state = worn
 | link = SCUBA Gear
}}{{AdvancementIcon|Diamond Hoe|fancy|raw}}

See Also