2,875
edits
No edit summary |
No edit summary |
||
Line 343: | Line 343: | ||
local skillID = 'Fishing' | local skillID = 'Fishing' | ||
local recipeList = GameData.getEntities(SkillData.Fishing.fish, | local recipeList = GameData.getEntities(SkillData.Fishing.fish, function(obj) | ||
return Skills.getRecipeRealm(obj) == realm.id | |||
end) | |||
table.sort(recipeList, function(a, b) return Skills.standardRecipeSort(skillID, a, b) end) | table.sort(recipeList, function(a, b) return Skills.standardRecipeSort(skillID, a, b) end) | ||
Line 362: | Line 360: | ||
end | end | ||
local | local html = mw.html.create('table') | ||
html:addClass('wikitable sortable stickyHeader') | |||
-- Add header row | |||
local headerRow0 = html:tag('tr'):addClass('headerRow-0') | |||
headerRow0:tag('th'):attr('colspan', '2'):attr('rowspan', '2'):wikitext('Fish') | |||
headerRow0:tag('th'):attr('rowspan', '2'):wikitext('Requirements') | |||
headerRow0:tag('th'):attr('colspan', '3'):wikitext('Catch Time') | |||
headerRow0:tag('th'):attr('rowspan', '2'):wikitext('XP') | |||
headerRow0:tag('th'):attr('rowspan', '2'):wikitext('Value') | |||
headerRow0:tag('th'):attr('rowspan', '2'):wikitext('XP/s') | |||
headerRow0:tag('th'):attr('rowspan', '2'):wikitext('Price/s') | |||
headerRow0:tag('th'):attr('rowspan', '2'):wikitext(Icons.Icon({'Cooking', type='skill', notext=true}) .. ' Level') | |||
local headerRow1 = html:tag('tr'):addClass('headerRow-1') | |||
headerRow1:tag('th'):wikitext('Min') | |||
headerRow1:tag('th'):wikitext('Max') | |||
headerRow1:tag('th'):wikitext('Avg') | |||
-- Add fish rows | |||
for i, recipe in ipairs(recipeList) do | for i, recipe in ipairs(recipeList) do | ||
local fish = Items.getItemByID(recipe.productId) | local fish = Items.getItemByID(recipe.productId) | ||
Line 375: | Line 386: | ||
local timeAvg = (timeMin + timeMax) / 2 | local timeAvg = (timeMin + timeMax) / 2 | ||
local timeSortVal = (recipe.baseMinInterval + recipe.baseMaxInterval) / 2000 | local timeSortVal = (recipe.baseMinInterval + recipe.baseMaxInterval) / 2000 | ||
local level = Skills.getRecipeLevel(skillID, recipe) | local level = Skills.getRecipeLevel(skillID, recipe) | ||
local reqText = Skills.getRecipeRequirementText(skillID, recipe) | local reqText = Skills.getRecipeRequirementText(skillID, recipe) | ||
Line 389: | Line 399: | ||
cookStr = Skills.getRecipeRequirementText('Cooking', cookRecipe) | cookStr = Skills.getRecipeRequirementText('Cooking', cookRecipe) | ||
end | end | ||
local row = html:tag('tr') | |||
row:tag('td'):addClass('table-img'):wikitext(Icons.Icon({fish.name, type='item', notext=true})) | |||
row:tag('td') | |||
:attr('data-sort-value', fish.name) | |||
:wikitext(Icons.getDLCColumnIcon(fish.id) .. Icons.Icon({fish.name, type='item', noicon=true})) | |||
row:tag('td') | |||
:css('text-align', 'right') | |||
:attr('data-sort-value', level) | |||
:wikitext(reqText) | |||
row:tag('td') | |||
:css('text-align', 'right') | |||
:attr('data-sort-value', timeMin) | |||
:wikitext(string.format("%.1fs", timeMin)) | |||
row:tag('td') | |||
:css('text-align', 'right') | |||
:attr('data-sort-value', timeMax) | |||
:wikitext(string.format("%.1fs", timeMax)) | |||
row:tag('td') | |||
:css('text-align', 'right') | |||
:attr('data-sort-value', timeAvg) | |||
:wikitext(string.format("%.1fs", timeAvg)) | |||
row:tag('td') | |||
:css('text-align', 'right') | |||
:attr('data-sort-value', baseXP) | |||
:wikitext(Shared.formatnum(baseXP)) | |||
row:tag('td') | |||
:attr('data-sort-value', fish.sellsFor) | |||
:wikitext(Items.getValueText(fish)) | |||
row:tag('td') | |||
:css('text-align', 'right') | |||
:wikitext(Shared.round(XPSec, 2, 2)) | |||
row:tag('td') | |||
:attr('data-sort-value', currPerSec) | |||
:wikitext(Icons._Currency(sellCurrency, currPerSec)) | |||
row:tag('td') | |||
:attr(cookStyle) | |||
:attr('data-sort-value', cookLevel) | |||
:wikitext(cookStr) | |||
end | end | ||
end | end | ||
return | return tostring(html) | ||
end | end | ||
function p.getFishingAreasTable(frame) | function p.getFishingAreasTable(frame) |
edits