Module:FertilizerWindows: Difference between revisions
From Piñata Journal
More actions
Admin Jeremy (talk | contribs) No edit summary |
Admin Jeremy (talk | contribs) No edit summary |
||
| Line 1: | Line 1: | ||
local p = {} | local p = {} | ||
local icon = '[[File:Fertilizer | local icon = '[[File:Fertilizer Bag Icon.png|45px]]' | ||
function p.render(frame) | function p.render(frame) | ||
| Line 7: | Line 7: | ||
local window = tonumber(frame.args[1]) or 0 | local window = tonumber(frame.args[1]) or 0 | ||
local count = tonumber(frame.args[2]) or 0 | local count = tonumber(frame.args[2]) or 0 | ||
if count == 0 then return '' end | |||
if count == 0 then | |||
local label = '' | local label = '' | ||
if window == 0 then | if window == 0 then | ||
label = ' | label = 'After Planting' | ||
else | else | ||
label = ' | label = 'After ' .. window .. ' Bud Burst' | ||
end | end | ||
| Line 28: | Line 21: | ||
end | end | ||
return '< | return '<div class="vp-fert-window">' | ||
.. '<div class="vp-fert-label">' .. label .. '</div>' | |||
.. '<div class="vp-fert-icons">' .. icons .. '</div>' | |||
.. '</div>' | |||
end | end | ||
return p | return p | ||
Revision as of 09:42, 25 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 ' .. window .. ' Bud Burst'
end
local icons = ''
for i=1,count do
icons = icons .. icon
end
return '<div class="vp-fert-window">'
.. '<div class="vp-fert-label">' .. label .. '</div>'
.. '<div class="vp-fert-icons">' .. icons .. '</div>'
.. '</div>'
end
return p