Anonymous

Module:Skills/Summoning: Difference between revisions

From Melvor Idle
Apply CSS classes to prevent image columns from collapsing on devices with small widths
No edit summary
(Apply CSS classes to prevent image columns from collapsing on devices with small widths)
Line 23: Line 23:


local html = mw.html.create('table')
local html = mw.html.create('table')
:addClass('wikitable sortable stickyHeader')
:addClass('wikitable sortable stickyHeader col-1-img col-5-img')
html:tag('tr'):addClass('headerRow-0')
html:tag('tr'):addClass('headerRow-0')
Line 55: Line 55:
:css('text-align', 'center')
:css('text-align', 'center')
row:tag('td'):wikitext(Icons.getDLCColumnIcon(Fam.id))
row:tag('td'):wikitext(Icons.getDLCColumnIcon(Fam.id))
:css('text-align', 'center')
:attr('data-sort-value', Icons.getExpansionID(Fam.id))
:attr('data-sort-value', Icons.getExpansionID(Fam.id))


Line 81: Line 80:
local html = mw.html.create('table')
local html = mw.html.create('table')
:addClass('wikitable sortable stickyHeader')
:addClass('wikitable sortable stickyHeader col-1-img col-3-img')
local header = html:tag('tr'):addClass('headerRow-0')
local header = html:tag('tr'):addClass('headerRow-0')
Line 97: Line 96:
end
end
function getShardCosts(familiar)
local function getShardCosts(familiar)
local shardCosts = {}
local shardCosts = {}
for _, shard in ipairs(familiar.itemCosts) do
for _, shard in ipairs(familiar.itemCosts) do
local shopItem = Shop.getPurchaseByID(shard.id)
local shopItem = Shop.getPurchaseByID(shard.id)
for _, shardCost in ipairs(shopItem.cost.currencies) do
for _, shardCost in ipairs(shopItem.cost.currencies) do
if shardCosts[shardCost.currency] then
local addCost = shardCost.cost * shard.quantity
shardCosts[shardCost.currency] = shardCosts[shardCost.currency] + (shardCost.cost * shard.quantity)
if shardCosts[shardCost.currency] ~= nil then
shardCosts[shardCost.currency] = shardCosts[shardCost.currency] + addCost
else
else
shardCosts[shardCost.currency] = (shardCost.cost * shard.quantity)
shardCosts[shardCost.currency] = addCost
end
end
end
end
Line 112: Line 112:
end
end


function isCombatFamiliar(fam)
local function isCombatFamiliar(fam)
local item = Items.getItemByID(fam.productID)
local item = Items.getItemByID(fam.productID)
local maxHit = Items._getItemStat(item, 'summoningMaxhit')
local maxHit = Items._getItemStat(item, 'summoningMaxhit')
Line 141: Line 141:
row:tag('td'):wikitext('[[' .. item.name .. ']]')
row:tag('td'):wikitext('[[' .. item.name .. ']]')
row:tag('td'):wikitext(Icons.getDLCColumnIcon(Fam.id))
row:tag('td'):wikitext(Icons.getDLCColumnIcon(Fam.id))
:css('text-align', 'center')
:attr('data-sort-value', Icons.getExpansionID(Fam.id))
:attr('data-sort-value', Icons.getExpansionID(Fam.id))
row:tag('td'):wikitext(level)
row:tag('td'):wikitext(level)
Line 186: Line 185:
local skillID = 'Summoning'
local skillID = 'Summoning'
local result = ''
local result = ''
result = result..'{| class="wikitable sortable stickyHeader"'
result = result..'{| class="wikitable sortable stickyHeader col-1-img col-3-img"'
result = result..'\r\n|- class="headerRow-0"'
result = result..'\r\n|- class="headerRow-0"'
result = result..'\r\n!colspan="2"|Familiar 1!!colspan="2"|Familiar 2!!Effect!!Requirements'
result = result..'\r\n!colspan="2"|Familiar 1!!colspan="2"|Familiar 2!!Effect!!Requirements'
Line 338: Line 337:


local html = mw.html.create('table')
local html = mw.html.create('table')
:addClass('wikitable sortable stickyHeader')
:addClass('wikitable sortable stickyHeader col-1-img col-3-img')
html:tag('tr'):addClass('headerRow-0')
html:tag('tr'):addClass('headerRow-0')