2,875
edits
m (Fix syntax) |
(Fix incorrect opening/closing of html tags) |
||
Line 545: | Line 545: | ||
end | end | ||
local tbl = mw.html.create("table") | local tbl = mw.html.create() | ||
local html = tbl:tag("table") | |||
:addClass("wikitable sortable stickyHeader") | :addClass("wikitable sortable stickyHeader") | ||
:tag('tr'):addClass("headerRow-0") | |||
:tag(' | :tag('th'):attr("colspan", 2):wikitext("Seeds") | ||
:tag(' | :tag('th'):wikitext(Icons.Icon({'Farming', type='skill', notext=true}) .. " Level") | ||
:tag(' | :tag('th'):wikitext('XP') | ||
:tag(' | :tag('th'):wikitext('Growth Time') | ||
:tag(' | :tag('th'):wikitext('Seed Value') | ||
if category.id == 'melvorD:Allotment' then | if category.id == 'melvorD:Allotment' then | ||
html:tag('th'):attr("colspan", 2):wikitext("Crop") | |||
:tag(' | :tag('th'):wikitext('Crop Healing') | ||
:tag(' | :tag('th'):wikitext('Crop Value') | ||
elseif category.id == 'melvorD:Herb' then | elseif category.id == 'melvorD:Herb' then | ||
html:tag('th'):attr("colspan", 2):wikitext("Herb") | |||
:tag(' | :tag('th'):wikitext('Herb Value') | ||
elseif category.id == 'melvorD:Tree' then | elseif category.id == 'melvorD:Tree' then | ||
html:tag('th'):attr("colspan", 2):wikitext("Logs") | |||
:tag(' | :tag('th'):wikitext('Log Value') | ||
end | end | ||
html = html:tag('th'):wikitext('Seed Sources') | |||
table.sort(seedList, function(a, b) return a.level < b.level end) | table.sort(seedList, function(a, b) return a.level < b.level end) | ||
Line 575: | Line 574: | ||
local productItem = Items.getItemByID(seed.productId) | local productItem = Items.getItemByID(seed.productId) | ||
if seedItem ~= nil and productItem ~= nil then | if seedItem ~= nil and productItem ~= nil then | ||
html = | |||
html:tag('tr') | |||
:tag('td'):wikitext(Icons.Icon({seedItem.name, type='item', size='50', notext=true})) | |||
:tag('td'):wikitext(Icons.getExpansionIcon(seedItem.id) .. Icons.Icon({seedItem.name, type='item', noicon=true})) | |||
:tag('td'):wikitext(seed.level) | |||
:tag('td'):wikitext(Shared.formatnum(seed.baseExperience)) | |||
:tag('td'):attr('data-sort-value', (seed.baseInterval / 1000)) | |||
:wikitext(Shared.timeString(seed.baseInterval / 1000, true)) | |||
:tag('td'):attr('data-sort-value', seedItem.sellsFor) | |||
:wikitext(Icons.GP(seedItem.sellsFor)) | |||
:tag('td'):wikitext(Icons.Icon({productItem.name, type='item', size='50', notext=true})) | |||
:tag('td'):wikitext(Icons.getExpansionIcon(productItem.id) .. Icons.Icon({productItem.name, type='item', noicon=true})) | |||
if category.id == 'melvorD:Allotment' then | if category.id == 'melvorD:Allotment' then | ||
html:tag('td'):wikitext(Icons.Icon({'Hitpoints', type='skill', notext=true})) | |||
:wikitext(' ') | :wikitext(' ') | ||
:wikitext(((productItem.healsFor or 0) * 10)) | :wikitext(((productItem.healsFor or 0) * 10)) | ||
end | end | ||
html = | |||
html:tag('td'):attr('data-sort-value', productItem.sellsFor) | |||
:wikitext(Icons.GP(productItem.sellsFor)) | :wikitext(Icons.GP(productItem.sellsFor)) | ||
:tag('td'):wikitext(ItemSourceTables._getItemSources(seedItem)) | :tag('td'):wikitext(ItemSourceTables._getItemSources(seedItem)) | ||
:done() | |||
end | end | ||
end | end |
edits