Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Module:FertilizerWindows

From Piñata Journal
Revision as of 20:07, 23 February 2026 by Admin Jeremy (talk | contribs) (Created page with "local p = {} local icons = { Red = '20px', Brown = '20px', Blue = '20px', Green = '20px', Yellow = '20px', Orange = '20px' } function p.render(frame) local fert = frame.args[1] local count = tonumber(frame.ar...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Documentation for this module may be created at Module:FertilizerWindows/doc

local p = {}

local icons = {
    Red = '[[File:Red fertilizer bag icon.png|20px]]',
    Brown = '[[File:Brown fertilizer bag icon.png|20px]]',
    Blue = '[[File:Blue fertilizer bag icon.png|20px]]',
    Green = '[[File:Green fertilizer bag icon.png|20px]]',
    Yellow = '[[File:Yellow fertilizer bag icon.png|20px]]',
    Orange = '[[File:Orange fertilizer bag icon.png|20px]]'
}

function p.render(frame)
    local fert = frame.args[1]
    local count = tonumber(frame.args[2]) or 0

    if count == 0 then
        return '—'
    end

    local icon = icons[fert] or ''
    local out = ''

    for i=1,count do
        out = out .. icon
    end

    return out
end

return p