Template:Item icon: Difference between revisions

From Project Gorgon
Jump to navigation Jump to search
Visha (talk | contribs)
m Seashell Boots
Visha (talk | contribs)
mNo edit summary
Line 416: Line 416:
| Astounding Throwing Knife = 5630
| Astounding Throwing Knife = 5630
| Atogi's Calling Card = 4005
| Atogi's Calling Card = 4005
| Auger Shell = 6306
| Augmented Bounceweed = 5548
| Augmented Bounceweed = 5548
| Augmented Mantis Claw = 5075
| Augmented Mantis Claw = 5075
Line 710: Line 711:
| Blowing Horn = 5296
| Blowing Horn = 5296
| Blue Dye = 6080
| Blue Dye = 6080
| Blue Sea Star = 6324
| Blue Spinel = 5214
| Blue Spinel = 5214
| Blue Violet Dye = 6092
| Blue Violet Dye = 6092
Line 1,728: Line 1,730:
| Faded Blue Book = 5519
| Faded Blue Book = 5519
| Fae Animal Nexus Key = 5349
| Fae Animal Nexus Key = 5349
| Fae Auger Shell = 6317
| Fae Bead Necklace = 5197
| Fae Bead Necklace = 5197
| Fae Bee Stinger = 6273
| Fae Bee Stinger = 6273
Line 3,890: Line 3,893:
| Sarina's Backpack = 5058
| Sarina's Backpack = 5058
| Sausage = 5122
| Sausage = 5122
| Scallop Shell = 6319
| Scamorza Cheese = 5333
| Scamorza Cheese = 5333
| Scintillating Orb = 5382
| Scintillating Orb = 5382
Line 4,052: Line 4,056:
| Silver Ore = 5588
| Silver Ore = 5588
| Silver Salad Fork = 5757
| Silver Salad Fork = 5757
| Silver Scallop = 6307
| Silver Spear Head = 5755
| Silver Spear Head = 5755
| Silver Spring = 5763
| Silver Spring = 5763
Line 4,880: Line 4,885:
| Vegetable Masterpiece = 5977
| Vegetable Masterpiece = 5977
| Vegetable Oil = 5777
| Vegetable Oil = 5777
| Vertan Emerald Star = 6323
| Veil of Twighlight Pain = 16105
| Veil of Twighlight Pain = 16105
| Velkort's Classy Gloves = 13107
| Velkort's Classy Gloves = 13107
Line 4,891: Line 4,897:
| Venom Piercers = 13102
| Venom Piercers = 13102
| Venomizer = 15209
| Venomizer = 15209
| Vertan Murex Shell = 6320
| Vervadium = 5219
| Vervadium = 5219
| Very Fast Mushroom Box = 5311
| Very Fast Mushroom Box = 5311

Revision as of 15:41, 4 January 2020

Description

This template accepts an item name as input and returns the in-game icon. This template is used by both Template:Item and Template:Loot. See the Examples section below.

Syntax

{{Item icon|<name>|<size selection>}}

Parameters

<name>
The name of the icon. It must match exactly what is displayed in-game (e.g. "Red Apple", not "Apple" or "red apple")
If omitted or empty, template returns a blank icon image.
If no match is found, template returns an error.
<size selection>
1 or 32 for 32x32.
2 or 64 for 64x64.
If omitted, empty, or anything else, image isn't resized.

Examples

Standard Use

{{Item icon|Glowy Yellow Crystal}}

{{Item icon|Ice Core}}

{{Item icon}}

{{Item icon|FakeItemReturnsError}}

{{ #replace: http://cdn.projectgorgon.com/v331/icons/icon_5702.png | http://cdn.projectgorgon.com/v328/icons/icon_Error: Item not found.png | Error: Item not found }}

{{ #replace: http://cdn.projectgorgon.com/v331/icons/icon_5295.png | http://cdn.projectgorgon.com/v328/icons/icon_Error: Item not found.png | Error: Item not found }}

{{ #replace: http://cdn.projectgorgon.com/v331/icons/icon_4003.png | http://cdn.projectgorgon.com/v328/icons/icon_Error: Item not found.png | Error: Item not found }}


Resizing

{{Item icon|Glowy Yellow Crystal}} <!-- default size is 64x64 -->

{{Item icon|Ice Core}} <!-- default size is 32x32 -->

{{Item icon|Glowy Yellow Crystal|32}}

{{Item icon|Ice Core|64}}

{{ #replace: http://cdn.projectgorgon.com/v331/icons/icon_5702.png | http://cdn.projectgorgon.com/v328/icons/icon_Error: Item not found.png | Error: Item not found }}

{{ #replace: http://cdn.projectgorgon.com/v331/icons/icon_5295.png | http://cdn.projectgorgon.com/v328/icons/icon_Error: Item not found.png | Error: Item not found }}

{{ #replace: http://cdn.projectgorgon.com/v331/icons/icon_5702.png | http://cdn.projectgorgon.com/v328/icons/icon_Error: Item not found.png | Error: Item not found }}

{{ #replace: http://cdn.projectgorgon.com/v331/icons/icon_5295.png | http://cdn.projectgorgon.com/v328/icons/icon_Error: Item not found.png | Error: Item not found }}


Alternative Resizing (old method)

You can also manually resize the images if you wish (using the template just wraps the image in this span automatically).

<span class="extimage32px">{{Item icon|Salt}}</span>

<span class="extimage64px">{{Item icon|Salt}}</span>

{{ #replace: http://cdn.projectgorgon.com/v331/icons/icon_5013.png | http://cdn.projectgorgon.com/v328/icons/icon_Error: Item not found.png | Error: Item not found }}

{{ #replace: http://cdn.projectgorgon.com/v331/icons/icon_5013.png | http://cdn.projectgorgon.com/v328/icons/icon_Error: Item not found.png | Error: Item not found }}

Notes

Sometimes items appear in-game that share the same displayed name but have different internal names. Often future patches rename one of them to prevent conflicts, but a few persist. This wiki resolves the issue by renaming the less-likely to be searched for item.

One example is

{{ #replace: http://cdn.projectgorgon.com/v331/icons/icon_5283.png |

http://cdn.projectgorgon.com/v328/icons/icon_Error: Item not found.png |

Error: Item not found }}
 
[[Expression error: Unrecognized punctuation character "{".]]

and

{{ #replace: http://cdn.projectgorgon.com/v331/icons/icon_4003.png |

http://cdn.projectgorgon.com/v328/icons/icon_Error: Item not found.png |

Error: Item not found }}
 
[[Expression error: Unrecognized punctuation character "{".]]

. Both are called just "Daisy" in-game, but the Lute has an InternalName (found in the items json) of "Daisy" and the flower has an InternalName of "Flower5".

Icon Codes for Items Sharing a Name

		| Daisy = 5283
		| Daisy (Lute) = 5380

Code Required for other templates

These two lines are required for Template:NPC training row, Template:NPC training unlock row, and Template:Recipe to work properly. They must also be placed alongside other "s" and "u" items.

		| scroll = 4003
		| Unlock = 109