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
No edit summary
No edit summary
Line 1: Line 1:
local p = {}
local p = {}


local icons = {
local icon = '[[File:Fertilizer Bag Icon.png|45px]]'
    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)
function p.render(frame)
     local count = tonumber(frame.args[1]) or 0
 
    local window = tonumber(frame.args[1]) or 0
     local count = tonumber(frame.args[2]) or 0


     if count == 0 then
     if count == 0 then
         return ''
         return ''
     end
     end


     local icon = '[[File:Fertilizer bag icon.png|20px]]'
     local label = ''
    local out = ''
 
    if window == 0 then
        label = 'after planting'
    else
        label = 'after the ' .. window .. 'st bud burst'
        if window == 2 then label = 'after the 2nd bud burst' end
        if window == 3 then label = 'after the 3rd bud burst' end
        if window >= 4 then label = 'after the ' .. window .. 'th bud burst' end
    end


    local icons = ''
     for i=1,count do
     for i=1,count do
         out = out .. icon
         icons = icons .. icon
     end
     end


     return out
     return '<li>' .. icons .. ' Can be fertilized <b>' .. count .. '×</b> ' .. label .. '</li>'
end
end


return p
return p

Revision as of 20:20, 23 February 2026

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

local p = {}

local icon = '[[File:Fertilizer Bag Icon.png|45px]]'

function p.render(frame)

    local window = tonumber(frame.args[1]) or 0
    local count = tonumber(frame.args[2]) or 0

    if count == 0 then
        return ''
    end

    local label = ''

    if window == 0 then
        label = 'after planting'
    else
        label = 'after the ' .. window .. 'st bud burst'
        if window == 2 then label = 'after the 2nd bud burst' end
        if window == 3 then label = 'after the 3rd bud burst' end
        if window >= 4 then label = 'after the ' .. window .. 'th bud burst' end
    end

    local icons = ''
    for i=1,count do
        icons = icons .. icon
    end

    return '<li>' .. icons .. ' Can be fertilized <b>' .. count .. '×</b> ' .. label .. '</li>'
end

return p