2,869
edits
m (Added Expansion icons beside Fishing Areas) |
(Transform _getFarmingTable to use mw.html) |
||
Line 545: | Line 545: | ||
end | end | ||
local | local tbl = mw.html.create("table") | ||
:addClass("wikitable sortable stickyHeader") | |||
:tag('tr'):addClass("headerRow-0") | |||
:tag('td'):attr("colspan", 2):wikitext("Seeds") | |||
:tag('td'):wikitext(Icons.Icon({'Farming', type='skill', notext=true} .. " Level")) | |||
:tag('td'):wikitext('XP') | |||
:tag('td'):wikitext('Growth Time') | |||
:tag('td'):wikitext('Seed Value') | |||
:done() | |||
if category.id == 'melvorD:Allotment' then | if category.id == 'melvorD:Allotment' then | ||
tbl :tag('td'):attr("colspan", 2):wikitext("Crop") | |||
:tag('td'):wikitext('Crop Healing') | |||
:tag('td'):wikitext('Crop Value') | |||
elseif category.id == 'melvorD:Herb' then | elseif category.id == 'melvorD:Herb' then | ||
tbl :tag('td'):attr("colspan", 2):wikitext("Herb") | |||
:tag('td'):wikitext('Herb Value') | |||
elseif category.id == 'melvorD:Tree' then | elseif category.id == 'melvorD:Tree' then | ||
tbl :tag('td'):attr("colspan", 2):wikitext("Logs") | |||
:tag('td'):wikitext('Log Value') | |||
end | end | ||
tbl = tbl | |||
tbl:tag('td'):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 564: | Line 575: | ||
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 | ||
tbl :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 | ||
tbl :tag('td'):wikitext(Icons.Icon({'Hitpoints', type='skill', notext=true})) | |||
:wikitext(' ') | |||
:wikitext(((productItem.healsFor or 0) * 10)) | |||
end | end | ||
tbl = tbl | |||
tbl :tag('td'):attr('data-sort-value', productItem.sellsFor) | |||
:wikitext(Icons.GP(productItem.sellsFor)) | |||
:tag('td'):wikitext(ItemSourceTables._getItemSources(seedItem)) | |||
end | end | ||
end | end | ||
return tostring(tbl:done()) | |||
return | |||
end | end | ||
edits