Anonymous

Module:Skills/Artisan: Difference between revisions

From Melvor Idle
_getRecipeTable: Amend styles of ingredients column
(_getRecipeTable: Use mw.html & style amends)
(_getRecipeTable: Amend styles of ingredients column)
Line 242: Line 242:
table.sort(potions, function(a, b) return Skills.standardRecipeSort(skillID, a, b) end)
table.sort(potions, function(a, b) return Skills.standardRecipeSort(skillID, a, b) end)
function getIngredients(potion)
local function getIngredients(potion)
     local herbs = {}
     local herbs = {}
     local secondaries = {}
     local secondaries = {}
Line 616: Line 616:
:attr('data-sort-value', tostring(val * qty))
:attr('data-sort-value', tostring(val * qty))
elseif colID == 'Ingredients' then
elseif colID == 'Ingredients' then
local matArray = {}
local currCost = { ["items"] = {}, ["currencies"] = recipe.currencyCosts }
local currCost = { ["items"] = {}, ["currencies"] = recipe.currencyCosts }
local currText = Common.getCostString(currCost, nil, nil, ' ')
local currText = Common.getCostString(currCost, nil, nil, ' ')
if currText ~= nil then
if currText ~= nil then
table.insert(matArray, currText)
cell:wikitext(currText)
end
end


Line 626: Line 625:
local matItem = Items.getItemByID(mat.id)
local matItem = Items.getItemByID(mat.id)
if matItem ~= nil then
if matItem ~= nil then
table.insert(matArray, Icons.Icon({matItem.name, type='item', notext=true, qty=mat.quantity}))
local sub = mw.html.create('sub')
:wikitext(Num.formatnum(mat.quantity))
:addClass('item-qty')
:done()
cell:node(sub)
cell:wikitext(Icons.Icon({matItem.name, type='item', notext=true}))
end
end
end
end
cell:wikitext(table.concat(matArray, ' '))
elseif colID == 'SkillXPSec' then
elseif colID == 'SkillXPSec' then
cell:wikitext(string.format('%.2f', recipe.baseExperience / actionInterval))
cell:wikitext(string.format('%.2f', recipe.baseExperience / actionInterval))