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: Difference between revisions

From Piñata Journal
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..."
 
No edit summary
Line 18: Line 18:
     end
     end


     local icon = icons[fert] or ''
     local icon = '[[File:Fertilizer bag icon.png|20px]]'
     local out = ''
     local out = ''



Revision as of 20:08, 23 February 2026

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 = '[[File:Fertilizer bag icon.png|20px]]'
    local out = ''

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

    return out
end

return p