Difference between revisions of "Module:Lua banner"

32 bytes added ,  17:37, 26 June 2021
Add `wish` parameter
>Tacsipacsi
(use live config instead of sandbox one)
>ExE Boss
(Add `wish` parameter)
Line 31: Line 31:
function p._main(args, cfg)
function p._main(args, cfg)
local modules = mTableTools.compressSparseArray(args)
local modules = mTableTools.compressSparseArray(args)
local box = p.renderBox(modules, cfg)
local box = p.renderBox(modules, cfg, args)
local trackingCategories = p.renderTrackingCategories(args, modules, nil, cfg)
local trackingCategories = p.renderTrackingCategories(args, modules, nil, cfg)
return box .. trackingCategories
return box .. trackingCategories
end
end


function p.renderBox(modules, cfg)
function p.renderBox(modules, cfg, args)
local boxArgs = {}
local boxArgs = {}
if #modules < 1 then
if #modules < 1 then
cfg = cfg or getConfig()
cfg = cfg or getConfig()
if cfg['allow_wishes'] then
if cfg['allow_wishes'] or yesno(args.wish) then
boxArgs.text = format('wishtext')
boxArgs.text = format('wishtext')
else
else
Anonymous user