Difference between revisions of "Template:ItemRarity"

From Project: Gorgon Wiki
Jump to: navigation, search
(Undo revision 99512 by Alleryn (talk) Refactoring change to Template:ItemColor)
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly><span style="{{ItemColor|{{{1|}}}}}"><b>[[Items#Item_Tiers|{{#switch: {{{1|}}}
+
<includeonly>[[Items#Item_Tiers|<span style="{{ItemColor|{{{1|}}}|{{{2}}}}}"><b>{{#switch: {{{1|}}}
 
  | Legendary | legendary
 
  | Legendary | legendary
 
  | Yellow | yellow
 
  | Yellow | yellow
Line 6: Line 6:
 
  | Epic | epic
 
  | Epic | epic
 
  | P | p
 
  | P | p
  | purple
+
  | Purple | purple
 
  | 4 = Epic
 
  | 4 = Epic
 
  | Exceptional | exceptional
 
  | Exceptional | exceptional
Line 20: Line 20:
 
  | U | u
 
  | U | u
 
  | 1 = Uncommon
 
  | 1 = Uncommon
  | #default = Common
+
| Common | common 
}}]]</b></span></includeonly><noinclude>{{documentation}}</noinclude>
+
| White | white
 +
| C | c
 +
| 0 = Common
 +
  | #default = Unknown Rarity (first template parameter)
 +
}}</b></span>]]</includeonly><noinclude>{{documentation}}</noinclude>

Latest revision as of 18:36, 25 October 2021

Template documentation (for the above template, sometimes hidden or invisible) [view] [edit] [history] [refresh]


Description

Outputs a link, formatted into the color of the given rarity, to the page section that describes the rarity tiers of items (Items#Item Tiers).

Syntax

  • Single parameter for use on standard "parchment color" background:
    {{ItemRarity|rarity}}
  • Two parameters for use in wikitables, ITEM infoboxes, or other light/dark backgrounds:
    {{ItemRarity|rarity|backgroundShade}}

Parameters

  • First parameter (required): The rarity you wish to express. This can be any of:
    • The full word description of the rarity: Uncommon, Rare, Exceptional, Epic, Legendary (capitalized or not)
    • The number of mods on an item of that rarity: 1, 2, 3, 4, 5
    • A one letter abbreviation for that rarity: u, r, x, p, l (capitalized or not)
    • Any other values default to "Common" in the color white.
  • Second parameter (optional): Used to select a palette with better contrast against the background color. Possible parameters "Light" (or "L") or "Dark" (or "D"), captialized or not. Leave this parameter out for a palette designed for the default "parchment color" wiki background.

Examples

Example 1: Directly on the page

Example Code 1

{{ItemRarity|Legendary}}

Example Output 1

Legendary

Example 2: Wikitable

Example Code 2

{| class="wikitable"
!Header
|-
| {{ItemRarity|2|Light}}
|}

Example Output 2

Header
Rare

Example 3: Dark background

Example Code 3

<span style="background-color:#000000>{{ItemRarity|x}}</span>

Example Output 3

Exceptional
The above text is transcluded from Template:ItemRarity/doc; you can change it or view its history.
If you're done making changes, please refresh the text.
Please add categories and interwikis to Template:ItemRarity/doc. (View all subpages of this page.)