918
edits
Falterfire (talk | contribs) (Added ID to astrology table) |
(Left align sources column) |
||
(6 intermediate revisions by 3 users not shown) | |||
Line 170: | Line 170: | ||
local resultPart = {} | local resultPart = {} | ||
table.insert(resultPart, '{|class="wikitable sortable | table.insert(resultPart, '{|class="wikitable sortable"') | ||
table.insert(resultPart, '\n|- class="headerRow-0"') | table.insert(resultPart, '\n|- class="headerRow-0"') | ||
table.insert(resultPart, '\n!colspan=2|Gem!!Gem Chance!!Gem Price') | table.insert(resultPart, '\n!colspan=2|Gem!!Gem Chance!!Gem Price') | ||
Line 254: | Line 254: | ||
for i, area in ipairs(SkillData.Fishing.areas) do | for i, area in ipairs(SkillData.Fishing.areas) do | ||
result = result..'\r\n|-' | result = result..'\r\n|-' | ||
result = result..'\r\n| style ="text-align: left;" |'..area.name | result = result..'\r\n| style ="text-align: left;" |'..Icons.getExpansionIcon(area.id)..area.name | ||
local fishArray = {} | local fishArray = {} | ||
Line 545: | Line 545: | ||
end | end | ||
local | local tbl = mw.html.create() | ||
local html = tbl:tag("table") | |||
:addClass("wikitable sortable stickyHeader") | |||
:tag('tr'):addClass("headerRow-0") | |||
:tag('th'):attr("colspan", 2):wikitext("Seeds") | |||
:tag('th'):wikitext(Icons.Icon({'Farming', type='skill', notext=true}) .. " Level") | |||
:tag('th'):wikitext('XP') | |||
:tag('th'):wikitext('Growth Time') | |||
: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('th'):wikitext('Crop Healing') | |||
: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('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('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 564: | 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(((productItem.healsFor or 0) * 10)) | |||
end | end | ||
html = | |||
html:tag('td'):attr('data-sort-value', productItem.sellsFor) | |||
:wikitext(Icons.GP(productItem.sellsFor)) | |||
:tag('td'):wikitext(ItemSourceTables._getItemSources(seedItem)) | |||
:css('text-align', 'left') | |||
:done() | |||
end | end | ||
end | end | ||
return tostring(tbl:done()) | |||
return | |||
end | end | ||
Line 665: | Line 685: | ||
table.insert(resultPart, string.rep('\n! ' .. Icons.Icon({'Mastery', notext=true}) .. 'Level\n! Modifiers', 2)) | table.insert(resultPart, string.rep('\n! ' .. Icons.Icon({'Mastery', notext=true}) .. 'Level\n! Modifiers', 2)) | ||
for i, cons in ipairs( | local recipes = Shared.shallowClone(SkillData.Astrology.recipes) | ||
table.sort(recipes, function(a, b) return a.level < b.level end) | |||
for i, cons in ipairs(recipes) do | |||
-- Generate the list of modifiers first for the purpose of determining the | -- Generate the list of modifiers first for the purpose of determining the | ||
-- the number of rows required to display all stars | -- the number of rows required to display all stars |
edits