Template talk:Rare

From Terraria Wiki
Jump to navigation Jump to search

sort parameter

The parameter is not working as expected: Using it puts the rarity levels 10 and 11 directly after 1, before 2. The following could fix that:

// prepending a 0 in front of the number; converting rainbow/q to 12/13, respectively
-->{{#if:{{{sort|}}}|data-sort-value={{#switch:{{#var:_rarity}}<!-- 
	-->|-1 = -01<!--
	-->|0|1|2|3|4|5|6|7|8|9 = 0{{#var:_rarity}}<!-- 
	-->|10|11 = {{#var:_rarity}}<!--
	-->|rainbow = 12<!--
	-->|q|quest = 13<!--
	-->|#default = {{#var:_rarity}}<!-- 
-->}}<!-- end of switch
-->{{!}}<!--
-->}}<!-- end of if

This would have to be placed after the definition of the two variables. The current second line would have to be deleted then, of course.--Rye greenwood (talk) 15:08, 7 October 2018 (UTC)

I can't reproduce that, it works as expected for me:
Color Tier
Rarity level: -1 -1
Rarity level: 0 0
Rarity level: 1 1
Rarity level: 2 2
Rarity level: 3 3
Rarity level: 4 4
Rarity level: 5 5
Rarity level: 6 6
Rarity level: 7 7
Rarity level: 8 8
Rarity level: 9 9
Rarity level: 10 10
Rarity level: 11 11
Rarity level: Quest Amber(-11)
Rarity level: Rainbow rainbow(-12)
Westgrass (talk) 14:20, 10 October 2018 (UTC)
You're right, I must have messed something up. Sorry! --Rye greenwood (talk) 14:50, 10 October 2018 (UTC)