Template:Img item/icon: Difference between revisions

From PZwiki
m (lighter)
(added weapon attachments)
Line 45: Line 45:
| AssaultRifle|M16 Assault Rifle = AssaultRifle
| AssaultRifle|M16 Assault Rifle = AssaultRifle
| AssaultRifle2|M14 Single Shot Assault Rifle = AssaultRifle2<!--
| AssaultRifle2|M14 Single Shot Assault Rifle = AssaultRifle2<!--
##  WEAPON ATTACHMENTS  ##
-->
| IronSight|Iron Sight = ScopeIronSight
| x2Scope|x2 Scope = Scope2x
| x4Scope|x4 Scope = Scope4x
| x8Scope|x8 Scope = Scope8x
| AmmoStraps|Ammo Straps = AmmoStrap
| Sling|Sling = GunSling
| FiberglassStock|Fiberglass Stock = RifleFibreglassStock
| Laser|Laser = RifleRecoilPad
| x2Scope|x2 Scope = HandgunLaser
| RedDot|Red Dot = RedDot
| GunLight|Gun Light = RedDot
| Bayonnet|Bayonnet = HuntingKnife
| ChokeTubeFull|Choke Tube Full = ShotgunChoke
| ChokeTubeImproved|Choke Tube Improved = ShotgunChoke<!--


##  TRAPS  ##
##  TRAPS  ##

Revision as of 13:19, 16 April 2022

[view] [edit] [history] [purge] Template documentation
{{Img item/icon}} is a subtemplate of {{Img item}}. This functions as an icon index for all items.

This template uses a switch, searching for a matching input string, returning an output string.

Usage

Although a subtemplate, this can function as a standalone template to lookup an icon for an item.

The input string should be the item's item ID (excluding the module) or the display name.

{{Img item/icon|item=Item ID <!-- or DisplayName -->}}

Adding to index

The index can be added to by:

  1. Click "Edit" (top-right)
  2. Copy the following snippet and paste in a new line, after the switch (top) and before the default (bottom): | ID| DisplayName = Output
  3. Replace: ID with the Item's ID (excluding the module), DisplayName with the Item's display name (as it appears in-game), and Output with the file you want to display (without the file extension e.g. PNG).
    1. Additional input strings can be added by placing a pipe | followed by the string after the last input string, but before the equals symbol =
      • Example: | LemonGrass| Lemongrass| Lemon Grass = Lemongrass
    2. Any additional input strings should be:
      • Previous item names, e.g. Whiskey Bottle or Bourbon
      • Alternate item names, i.e. name in script file may be different to in-game item name (this is contained in ItemName_EN.txt), e.g. Lemon Grass or Lemongrass
      • UK vs US spelling, e.g. Tire or Tyre
  4. Also add to {{Img item/name}} and {{Img_item/link}}

Example

Type Produces Explanation
{{Img item/icon|item=ShotgunShellsBox}}
ShotgunAmmoBox Using the item ID
{{Img item/icon|item=Box of Shotgun Shells}}
ShotgunAmmoBox Using the display name
Documentation transcluded from Template:Img item/icon/doc.
Editors can experiment in this template's sandbox (create)