Module:Season

From Paw Borough Wiki
Revision as of 16:10, 29 September 2023 by Imiya (talk | contribs) (Created page with "local p = {} function p.getSeason(season) local switch = { ["Winter"] = "File:WinterIcon.png", -- ["Summer"] = "File:SummerIcon.png", -- ["Fall"] = "File:FallIcon.png", -- ["Autumn"] = "File:FallIcon.png", -- ["Spring"] = "File:SpringIcon.png", -- } end -- Main function that calls getTheme with a passed-in theme argument function p.main(frame) -- The theme parameter is fir...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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

local p = {}

function p.getSeason(season)
local switch = {
       ["Winter"]        = "[[File:WinterIcon.png]]",   -- 
       ["Summer"]           = "[[File:SummerIcon.png]]",   -- 
       ["Fall"] = "[[File:FallIcon.png]]",  -- 
       ["Autumn"]     = "[[File:FallIcon.png]]",  -- 
       ["Spring"]     = "[[File:SpringIcon.png]]", -- 
   }
end

-- Main function that calls getTheme with a passed-in theme argument
function p.main(frame)
    -- The theme parameter is first positional, or nil if unspecified.
    local season = frame:getParent().args[1]
    return p.getSeason(season)
end

return p