Wyświetla wiersze dla tabeli na Tryb Podróży/Lista badań. Funkcja do wywołania to
, możliwymi argumentami są dolny i górny limit identyfikatora elementu (domyślnie odpowiednio 1 i 5124). Na przykład go
{{#invoke:ResearchAmountList|go|100|200}}
wydrukuje 100 wierszy dla wszystkich elementów, których identyfikator zawiera się między 100 a 200.
Dane pochodzą z {{getItemInfo}}.
------- l10n info --------------
local l10n_info = {
['en'] = {
['deprecated'] = 'Deprecated',
},
['fr'] = {
['deprecated'] = 'Obsolète',
}
}
------- The following is not related to l10n. --------------
local iteminfo = require('Module:Iteminfo')
local unused = require('Module:Iteminfo/idSets').getIdSet('Unused')
local currentFrame
local lang -- cache current lang.
local l10n_table
local l10n = function(key)
return l10n_table[key] or l10n_info['en'][key]
end
local output = ''
return {
go = function(frame)
currentFrame = frame
lang = frame.args['lang'] or 'en'
l10n_table = l10n_info[lang]
local na = currentFrame:expandTemplate{ title = 'na', args = {} }
local count = iteminfo.getItemStat(0, 'count')
local first = tonumber(currentFrame.args['1']) or 1
local last = tonumber(currentFrame.args['2']) or count
for itemid = first, last do
if first > 0 and last <= count then
local itemname, research
if unused[itemid] then
itemname = ('<td class="note-text" style="font-style:italic;">%s</td>'):format(l10n('deprecated'))
else
itemname = ('<td>[[%s]]</td>'):format(currentFrame:expandTemplate{ title = 'itemNameFromId', args = { itemid } })
research = iteminfo.getItemStat(itemid, 'sacrifices')
end
local sortbottom = ''
if not research or research <= 0 then
research = na
sortbottom = 'class=sortbottom'
end
output = output .. ('<tr %s><td>%s</td>%s<td>%s</td>'):format(sortbottom, itemid, itemname, research)
end
end
return output
end,
}