Module:ItemTables: Difference between revisionsGive feedback
Jump to navigation
Jump to search
add alphabetical sort |
add commas |
||
| Line 3: | Line 3: | ||
local get_cost = require("Module:ItemData")._get_cost | local get_cost = require("Module:ItemData")._get_cost | ||
local get_type = require("Module:ItemData")._get_type | local get_type = require("Module:ItemData")._get_type | ||
local commas = require("Module:Addcommas") | |||
--[===[ | --[===[ | ||
| Line 119: | Line 120: | ||
sortByWeapon["Tech"] = 100000000 | sortByWeapon["Tech"] = 100000000 | ||
-- Sort the order of items in a preset as it appears when no filtered ordering is applied. Ordered first by slot and cost increasing, then alphabetical within same slot and cost. | -- Sort the order of items in a preset as it appears when no filtered ordering is applied. | ||
-- Ordered first by slot and cost increasing, then alphabetical within same slot and cost. | |||
function defaultSort() | function defaultSort() | ||
return function(a, b) | return function(a, b) | ||
| Line 175: | Line 177: | ||
tableData | tableData | ||
:tag('td'):wikitext(display):done() | :tag('td'):wikitext(display):done() | ||
:tag('td'):wikitext(get_cost(itemName["Name"])):done() | :tag('td'):wikitext(commas._add(get_cost(itemName["Name"]))):done() | ||
:tag('td'):wikitext(get_type(itemName["Name"])):done() | :tag('td'):wikitext(get_type(itemName["Name"])):done() | ||
:tag('td'):wikitext("+<b>" .. itemName[t].. "</b>" .. appendSuffix(t) .. " " .. copyVar):done() | :tag('td'):wikitext("+<b>" .. itemName[t].. "</b>" .. appendSuffix(t) .. " " .. copyVar):done() | ||