Anonymous

Module:Skills/Gathering: Difference between revisions

From Melvor Idle
no edit summary
No edit summary
No edit summary
Line 81: Line 81:
          :attr('data-sort-value', level)
          :attr('data-sort-value', level)
:tag('td'):wikitext(Icons.getDLCColumnIcon(tree.id))
:tag('td'):wikitext(Icons.getDLCColumnIcon(tree.id))
  :attr('data-sort-value', Icons.getDLCColumnIcon(tree.id))
  :attr('data-sort-value', Icons.getExpansionID(tree.id))
  :css('text-align', 'center')
  :css('text-align', 'center')
:tag('td'):wikitext(Shared.formatnum(baseXP))
:tag('td'):wikitext(Shared.formatnum(baseXP))
Line 176: Line 176:
end
end
local skillID = 'Mining'
local skillID = 'Mining'
 
local resultPart = {}
local html = mw.html.create('table')
table.insert(resultPart, '{|class="wikitable sortable stickyHeader"')
:addClass("wikitable sortable stickyHeader")
table.insert(resultPart, '\n|- class="headerRow-0"')
table.insert(resultPart, '\n!colspan="2"|Rock!!colspan=2|Ore!!Type!!Requirements')
html:tag('tr'):addClass("headerRow-0")
table.insert(resultPart, '!!XP!!Respawn Time!!Ore Value')
:tag('th'):wikitext('Rock')
  :attr('colspan', 2)
:tag('th'):wikitext('Ore')
  :attr('colspan', 2)
:tag('th'):wikitext('Type')
:tag('th'):wikitext('Requirements')
:tag('th'):wikitext('[[DLC]]')
:tag('th'):wikitext('XP')
:tag('th'):wikitext('Respawn<br>Time')
:tag('th'):wikitext('Ore Value')


local mineData = GameData.getEntities(SkillData.Mining.rockData,
local mineData = GameData.getEntities(SkillData.Mining.rockData,
Line 194: Line 203:
local reqText = Skills.getRecipeRequirementText(SkillData.Mining.name, oreData)
local reqText = Skills.getRecipeRequirementText(SkillData.Mining.name, oreData)
local ore = Items.getItemByID(oreData.productId)
local ore = Items.getItemByID(oreData.productId)
local respawnStyle, respawnSort, respawnText = 'class="table-na"', 0, 'N/A'
local respawnSort, respawnText = 0, 'N/A'
if oreData.hasPassiveRegen then
if oreData.hasPassiveRegen then
respawnStyle = 'style="text-align:right;'
respawnSort = oreData.baseRespawnInterval / 1000
respawnSort = oreData.baseRespawnInterval / 1000
respawnText = Shared.timeString(respawnSort, true)
respawnText = Shared.timeString(respawnSort, true)
Line 208: Line 216:
local qtyText = (oreData.baseQuantity > 1 and '<b>' .. oreData.baseQuantity .. 'x</b> ') or ''
local qtyText = (oreData.baseQuantity > 1 and '<b>' .. oreData.baseQuantity .. 'x</b> ') or ''
table.insert(resultPart, '\n|-\n|class="table-img" data-sort-value="' .. rockName .. '"| '..Icons.Icon({oreData.name, type='rock', notext=true, nolink=true}))
html:tag('tr')
table.insert(resultPart, '\n| data-sort-value="' ..rockName.. '"|'..Icons.getDLCColumnIcon(oreData.id) .. rockName)
:tag('td'):wikitext(Icons.Icon({oreData.name, type='rock', notext=true, nolink=true}))
table.insert(resultPart, '\n|class="table-img" data-sort-value="' .. ore.name .. '"| '..Icons.Icon({ore.name, type='item', notext=true}))
  :addClass('table-img')
table.insert(resultPart, '\n| ' .. qtyText .. Icons.Icon({ore.name, type='item', noicon=true}))
  :attr('data-sort-value', rockName)
table.insert(resultPart, '\n| ' .. categoryName)
:tag('td'):wikitext(rockName)
table.insert(resultPart, '\n|data-sort-value="' .. level ..'"| ' .. reqText)
:tag('td'):wikitext(Icons.Icon({ore.name, type='item', notext=true}))
table.insert(resultPart, '\n|style="text-align:right"| '..Shared.formatnum(baseXP))
  :addClass('table-img')
table.insert(resultPart, '\n|' .. respawnStyle .. ' data-sort-value="'..respawnSort..'"| ' .. respawnText)
  :attr('data-sort-value', ore.name)
table.insert(resultPart, '\n|data-sort-value="'..ore.sellsFor..'"| '..Items.getValueText(ore))
:tag('td'):wikitext(qtyText .. '[[' .. ore.name .. ']]')
:tag('td'):wikitext(categoryName)
:tag('td'):wikitext(reqText)
  :attr('data-sort-value', level)
:tag('td'):wikitext(Icons.getDLCColumnIcon(oreData.id))
  :attr('data-sort-value', Icons.getExpansionID(oreData.id))
:tag('td'):wikitext(Shared.formatnum(baseXP))
  :css('text-align', 'right')
local respawn =
html:tag('td'):wikitext(respawnText)
  :attr('data-sort-value', respawnSort)
html:tag('td'):wikitext(Items.getValueText(ore))
  :attr('data-sort-value', ore.sellsFor)
 
if respawnText == 'N/A' then
respawn:css('text-align', 'right')
else
respawn:addClass('table-na')
end
end
end


table.insert(resultPart, '\n|}')
return tostring(html)
return table.concat(resultPart)
end
end


Line 754: Line 779:
:tag('td'):wikitext(Icons.getDLCColumnIcon(seedItem.id))
:tag('td'):wikitext(Icons.getDLCColumnIcon(seedItem.id))
  :css('text-align', 'center')
  :css('text-align', 'center')
  :attr('data-sort-value', Icons.getDLCColumnIcon(seedItem.id))
  :attr('data-sort-value', Icons.getExpansionID(seedItem.id))
:tag('td'):wikitext(Shared.formatnum(baseXP))
:tag('td'):wikitext(Shared.formatnum(baseXP))
:tag('td'):attr('data-sort-value', (baseInt / 1000))
:tag('td'):attr('data-sort-value', (baseInt / 1000))
Line 818: Line 843:
:tag('td'):wikitext(Icons.getDLCColumnIcon(seedItem.id))
:tag('td'):wikitext(Icons.getDLCColumnIcon(seedItem.id))
  :css('text-align', 'center')
  :css('text-align', 'center')
  :attr('data-sort-value', Icons.getDLCColumnIcon(seedItem.id))
  :attr('data-sort-value', Icons.getExpansionID(seedItem.id))
:done()
:done()
end
end
2,875

edits