Module:Souls: Difference between revisionsGive feedback
Jump to navigation
Jump to search
m Missing "/" |
m Call lang code once |
||
| Line 2: | Line 2: | ||
local Lang = require('Module:Lang') | local Lang = require('Module:Lang') | ||
local lang_code = Lang.get_lang_code() | |||
-- Formats souls amount with an icon and styling | -- Formats souls amount with an icon and styling | ||
| Line 12: | Line 13: | ||
local style = 'color:#98ffde; font-family:Retail Demo; text-wrap:nowrap; ' .. shadow | local style = 'color:#98ffde; font-family:Retail Demo; text-wrap:nowrap; ' .. shadow | ||
local link = 'Souls' | local link = 'Souls' | ||
if lang_code ~= 'en' then | if lang_code ~= 'en' then | ||
Revision as of 21:12, 23 April 2026
Documentation for this module may be created at Module:Souls/doc
local p = {}
local Lang = require('Module:Lang')
local lang_code = Lang.get_lang_code()
-- Formats souls amount with an icon and styling
function render(amount, args)
local args = args or {}
local size = args.size or '14px'
local shadow = (args.Shadow ~= '' and args.Shadow)
or 'text-shadow: 0px 0px 2px #2c312e, 1.3px 1.3px rgba(0, 0, 0, 0.2);'
local style = 'color:#98ffde; font-family:Retail Demo; text-wrap:nowrap; ' .. shadow
local link = 'Souls'
if lang_code ~= 'en' then
link = 'Souls/' .. lang_code
end
local file = '[[File:Souls iconColored.png|link=' .. link .. '|' .. size .. '|Souls]]'
local thin_space = amount and ' ' or ''
local bold = amount and '<b>' .. amount .. '</b>' or ''
return '<span style="' .. style .. '">' .. file .. thin_space .. bold .. '</span>'
end
-- Template entrypoint {{Souls|<amount>|size=|Shadow=}}
function p.render(frame)
local args = frame:getParent().args
local amount = args[1] or ""
return render(amount, args)
end
-- Module entrypoint
function p._render(amount, args)
return render(amount, args)
end
return p