Module:LevelTables: Difference between revisions

m Use Icon module instead of template calls for hero icons
m Replaced soul template calls with direct lua module
Line 2: Line 2:


local Icon = require('Module:Icon')
local Icon = require('Module:Icon')
local Souls = require('Module:Souls')


-- Loads the necessary data from the wiki's JSON pages.
-- Loads the necessary data from the wiki's JSON pages.
Line 100: Line 101:
local required_souls = pi_souls_list[count]
local required_souls = pi_souls_list[count]
local souls_formatted = string.format("%.1fK", (required_souls + 400) / 1000)
local souls_formatted = string.format("%.1fK", (required_souls + 400) / 1000)
local soul_display = frame:expandTemplate{ title = "Souls", args = {souls_formatted} }
local soul_display = Souls._render(souls_formatted)
local full_header = header_text .. "<br /><small>(" .. soul_display .. ")</small>"
local full_header = header_text .. "<br /><small>(" .. soul_display .. ")</small>"
header_row:tag("th"):wikitext(full_header):done()
header_row:tag("th"):wikitext(full_header):done()
Line 178: Line 179:
local required_souls = pi_souls_list[i]
local required_souls = pi_souls_list[i]
local souls_formatted = string.format("%.1fK", (required_souls + 400) / 1000)
local souls_formatted = string.format("%.1fK", (required_souls + 400) / 1000)
local soul_display = frame:expandTemplate{ title = "Souls", args = {souls_formatted} }
local soul_display = Souls._render(souls_formatted)
local row_html = string.format("<tr><td>%s</td><td style='text-align:right;'>%.2f</td></tr>", soul_display, total)
local row_html = string.format("<tr><td>%s</td><td style='text-align:right;'>%.2f</td></tr>", soul_display, total)