Module:Season: Difference between revisions

From Paw Borough Wiki
(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...")
 
No edit summary
 
Line 9: Line 9:
       ["Spring"]    = "[[File:SpringIcon.png]]", --  
       ["Spring"]    = "[[File:SpringIcon.png]]", --  
   }
   }
  return switch[season]
end
end



Latest revision as of 16:13, 29 September 2023

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]]", -- 
   }
   return switch[season]
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