Template:Item icon: Difference between revisions

From Project Gorgon
Jump to navigation Jump to search
Alleryn (talk | contribs)
mNo edit summary
Extractum11 (talk | contribs)
m Updating
Line 1: Line 1:
{{ #if: {{{1|}}} |  
{{ #if: {{{1|}}} |  
{{ #replace: http://cdn.projectgorgon.com/v340/icons/icon_{{ #switch: {{{1|None}}}
{{ #replace: http://cdn.projectgorgon.com/v341/icons/icon_{{ #switch: {{{1|None}}}
| "Always The Way" = 5110
| "Always The Way" = 5110
| "Battle of Fok" = 5793
| "Battle of Fok" = 5793
Line 66: Line 66:
| Adequate Staff = 18001
| Adequate Staff = 18001
| Admin Invisibility Potion = 5089
| Admin Invisibility Potion = 5089
| Admin Item Raffler = 5513
| Admin Ring of Non-Detection = 17002
| Admin Ring of Non-Detection = 17002
| Admin Shield = 14007
| Admin Shield = 14007
Line 226: Line 227:
| Amazing Ratkin Digestif = 6213
| Amazing Ratkin Digestif = 6213
| Amazing Reservoir Arrow = 6263
| Amazing Reservoir Arrow = 6263
| Amazing Ri-Shin Coat = 12008
| Amazing Ri-Shin Hat = 16110
| Amazing Ri-Shin Hat = 16110
| Amazing Ri-Shin Pants = 11008
| Amazing Ri-Shin Priest Hat = 16118
| Amazing Seafoam Candle = 6381
| Amazing Seafoam Candle = 6381
| Amazing Shocking Masquerade Mask = 16117
| Amazing Shocking Masquerade Mask = 16117
Line 415: Line 419:
| Astounding Evasion Leggings = 11018
| Astounding Evasion Leggings = 11018
| Astounding Evasion Shirt = 12018
| Astounding Evasion Shirt = 12018
| Astounding Familiar Controller = 16109
| Astounding Fiery Masquerade Mask = 16114
| Astounding Fiery Masquerade Mask = 16114
| Astounding First Aid Kit = 5060
| Astounding First Aid Kit = 5060
Line 438: Line 443:
| Astounding Phlogiston = 5506
| Astounding Phlogiston = 5506
| Astounding Priest Staff = 18020
| Astounding Priest Staff = 18020
| Astounding Ri-Shin Coat = 12008
| Astounding Ri-Shin Pants = 11008
| Astounding Ri-Shin Priest Hat = 16118
| Astounding Shocking Masquerade Mask = 16117
| Astounding Shocking Masquerade Mask = 16117
| Astounding Spring Fairy Leggings = 11011
| Astounding Spring Fairy Leggings = 11011
Line 1,791: Line 1,799:
| Eveline's Tailored Shirt = 12007
| Eveline's Tailored Shirt = 12007
| Event Loot Key (Universal) = 5349
| Event Loot Key (Universal) = 5349
| Event: Small Box of Space = 5792
| Event: Summon Death on a Leash = 5792
| Event: Vendor Fox in a Box = 5792
| Ever-Glaring Jack O' Lantern = 16107
| Ever-Glaring Jack O' Lantern = 16107
| Everpatching Shirt = 12104
| Everpatching Shirt = 12104
Line 1,832: Line 1,843:
| Extra-Fancy Shield of the Sea = 14008
| Extra-Fancy Shield of the Sea = 14008
| Extra-Fancy Staff of the Sea = 18007
| Extra-Fancy Staff of the Sea = 18007
| Extra-Gigantic Coin Sack = 5475
| Extra-Sturdy Shirt = 12002
| Extra-Sturdy Shirt = 12002
| Extreme Spider Silk = 5556
| Extreme Spider Silk = 5556
Line 2,072: Line 2,084:
| Fox Glyph = 17001
| Fox Glyph = 17001
| Fox Juice = 5087
| Fox Juice = 5087
| Foxtail Ring of Flow = 17002
| Foxtail Ring of Pouncing = 17002
| Frara's Calling Card = 4005
| Frara's Calling Card = 4005
| Fratag's Calling Card = 4005
| Fratag's Calling Card = 4005
Line 2,165: Line 2,179:
| Giant2BonesAppearance = 16001
| Giant2BonesAppearance = 16001
| GiantBonesAppearance = 16001
| GiantBonesAppearance = 16001
| Gigantic Coin Sack = 5475
| Gigantic Coin Sack = 5475
| Gigantic Coin Sack = 5475
| Gigantic Coin Sack = 5475
| Gigantic Coin Sack = 5475
| Gikgo's Calling Card = 4005
| Gikgo's Calling Card = 4005
Line 2,361: Line 2,378:
| Great Priest Staff = 18020
| Great Priest Staff = 18020
| Great Rabbit Meat = 5648
| Great Rabbit Meat = 5648
| Great Ri-Shin Coat = 12008
| Great Ri-Shin Hat = 16110
| Great Ri-Shin Hat = 16110
| Great Ri-Shin Pants = 11008
| Great Ri-Shin Priest Hat = 16118
| Great Shocking Masquerade Mask = 16117
| Great Shocking Masquerade Mask = 16117
| Great Snail Boots = 10009
| Great Snail Boots = 10009
Line 3,345: Line 3,365:
| Nightmarish Mushroom Turret = 5786
| Nightmarish Mushroom Turret = 5786
| Nightmarish Spore Bomb = 5686
| Nightmarish Spore Bomb = 5686
| Niphian Boots = 10109
| Nishika's Travel Snack = 5308
| Nishika's Travel Snack = 5308
| Northern Bounceweed = 5545
| Northern Bounceweed = 5545
Line 3,673: Line 3,694:
| Potion of Least Regeneration = 4002
| Potion of Least Regeneration = 4002
| Potion of Night Vision = 5440
| Potion of Night Vision = 5440
| Potion of Plantsight = 6238
| Potion of Random Resistance = 5155
| Potion of Random Resistance = 5155
| Potion of Rat Detection = 6238
| Potion of Rat Detection = 6238
Line 3,842: Line 3,864:
| Quality Pig Porkpie Hat = 16013
| Quality Pig Porkpie Hat = 16013
| Quality Priest Staff = 18020
| Quality Priest Staff = 18020
| Quality Ri-Shin Coat = 12008
| Quality Ri-Shin Pants = 11008
| Quality Ri-Shin Priest Hat = 16118
| Quality Shield = 14002
| Quality Shield = 14002
| Quality Shield = 14002
| Quality Shield = 14002
Line 4,019: Line 4,044:
| Rhino Necklace = 17001
| Rhino Necklace = 17001
| Rhodium = 5592
| Rhodium = 5592
| Ri-Shin Token = 6396
| Rib Bone = 5347
| Rib Bone = 5347
| Rice Wine = 5722
| Rice Wine = 5722
Line 4,434: Line 4,460:
| Small Animal Skull = 5774
| Small Animal Skull = 5774
| Small Blue Dragon Scale = 5420
| Small Blue Dragon Scale = 5420
| Small Box of Space = 6390
| Small Chest Bauble = 5812
| Small Chest Bauble = 5812
| Small Conch = 6318
| Small Conch = 6318
Line 4,945: Line 4,970:
| Title: 'Eggsellent Hunter' = 5851
| Title: 'Eggsellent Hunter' = 5851
| Title: 'Elemental Goddess' = 5851
| Title: 'Elemental Goddess' = 5851
| Title: 'Elf in Human form' = 5851
| Title: 'Elven Orgy Lube Dispenser' = 5851
| Title: 'Ember Mage' = 5851
| Title: 'Ember Mage' = 5851
| Title: 'Endlessly confused' = 5851
| Title: 'Endlessly confused' = 5851
Line 5,016: Line 5,043:
| Title: 'Needs More Pockets' = 5851
| Title: 'Needs More Pockets' = 5851
| Title: 'Oktariot' = 5851
| Title: 'Oktariot' = 5851
| Title: 'Old Timer' = 5851
| Title: 'One Rein To Rule Them' = 5851
| Title: 'One Rein To Rule Them' = 5851
| Title: 'Oracle Of Arisetsu' = 5851
| Title: 'Oracle Of Arisetsu' = 5851
Line 5,034: Line 5,062:
| Title: 'Renegade Angel' = 5851
| Title: 'Renegade Angel' = 5851
| Title: 'Resident of Animal Town' = 5851
| Title: 'Resident of Animal Town' = 5851
| Title: 'Rodwyne's Rangers' = 5851
| Title: 'Rouva' = 5851
| Title: 'Rouva' = 5851
| Title: 'Royal Companion' = 5851
| Title: 'Royal Companion' = 5851
Line 5,294: Line 5,323:
| Velkort's Hand-Me-Down = 18004
| Velkort's Hand-Me-Down = 18004
| Velmer's Key = 5349
| Velmer's Key = 5349
| Vendor Fox in a Box = 6340
| Venison = 6203
| Venison = 6203
| Venison Hash = 5031
| Venison Hash = 5031
Line 6,616: Line 6,644:
| #default = {{ #if: {{ #pos: {{{1|}}} | : }} |  4003 | <span style="color:red">Error: Item not found</span> }}
| #default = {{ #if: {{ #pos: {{{1|}}} | : }} |  4003 | <span style="color:red">Error: Item not found</span> }}
}}.png |  
}}.png |  
http://cdn.projectgorgon.com/v340/icons/icon_<span style="color:red">Error: Item not found</span>.png |  
http://cdn.projectgorgon.com/v341/icons/icon_<span style="color:red">Error: Item not found</span>.png |  
<span style="color:red">Error: Item not found</span> }} | [[File:Item-icon-none.png]] }}<noinclude>
<span style="color:red">Error: Item not found</span> }} | [[File:Item-icon-none.png]] }}<noinclude>
{{Item icon/Explanation}}
{{Item icon/Explanation}}
[[Category:Formatting templates|ItemT]]
[[Category:Formatting templates|ItemT]]
</noinclude>
</noinclude>

Revision as of 04:11, 15 January 2021

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/v341/icons/icon_5702.png | http://cdn.projectgorgon.com/v341/icons/icon_Error: Item not found.png | Error: Item not found }}

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

{{ #replace: http://cdn.projectgorgon.com/v341/icons/icon_4003.png | http://cdn.projectgorgon.com/v341/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/v341/icons/icon_5702.png | http://cdn.projectgorgon.com/v341/icons/icon_Error: Item not found.png | Error: Item not found }}

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

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

{{ #replace: http://cdn.projectgorgon.com/v341/icons/icon_5295.png | http://cdn.projectgorgon.com/v341/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/v341/icons/icon_5013.png | http://cdn.projectgorgon.com/v341/icons/icon_Error: Item not found.png | Error: Item not found }}

{{ #replace: http://cdn.projectgorgon.com/v341/icons/icon_5013.png | http://cdn.projectgorgon.com/v341/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/v341/icons/icon_5283.png |

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

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

and

{{ #replace: http://cdn.projectgorgon.com/v341/icons/icon_5380.png |

http://cdn.projectgorgon.com/v341/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