Module:Weather: Difference between revisions
From Paw Borough Wiki
(Created page with "local p = {} function p.getWeather(weather) local switch = { ["Sunny"] = "File:SunnyIcon.png", -- ["PartlyCloudy"] = "File:PartlyCloudyIcon.png", -- ["Snowy"] = "File:SnowyIcon.png", -- ["Cloudy"] = "File:CloudyIcon.png", -- ["Rainy"] = "File:RainyIcon.png", -- } return switch[weather] end -- Main function that calls getTheme with a passed-in theme argument function p.main(...") |
(No difference)
|
Latest revision as of 17:19, 29 September 2023
Documentation for this module may be created at Module:Weather/doc
local p = {} function p.getWeather(weather) local switch = { ["Sunny"] = "[[File:SunnyIcon.png]]", -- ["PartlyCloudy"] = "[[File:PartlyCloudyIcon.png]]", -- ["Snowy"] = "[[File:SnowyIcon.png]]", -- ["Cloudy"] = "[[File:CloudyIcon.png]]", -- ["Rainy"] = "[[File:RainyIcon.png]]", -- } return switch[weather] 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 weather = frame:getParent().args[1] return p.getWeather(weather) end return p