Difference between revisions of "Module:Drop"
Line 14: | Line 14: | ||
elseif args.Rarity == 'Uncommon' then | elseif args.Rarity == 'Uncommon' then | ||
rarity:attr('style', 'background-color: #FFED4C') | rarity:attr('style', 'background-color: #FFED4C') | ||
+ | elseif args.Rarity == 'Common' then | ||
+ | rarity:attr('style', 'background-color: #56E156') | ||
+ | elseif args.Rarity == 'Very rare' then | ||
+ | rarity:attr('style', 'background-color: #FF6262') | ||
end | end | ||
Revision as of 13:30, 17 November 2019
Documentation for this module may be created at Module:Drop/doc
local export = {} local item = require('Module:Item') function export.main(frame) local args = frame:getParent().args local row = mw.html.create('tr'):addClass('coa-drop-row') row:tag('td'):attr('style', 'text-align:left'):wikitext(item.inline(args.Name)) row:tag('td'):wikitext(args.Quantity) local rarity = row:tag('td'):wikitext(args.Rarity) if args.Rarity == 'Rare' then rarity:attr('style', 'background-color: #FF863C') elseif args.Rarity == 'Uncommon' then rarity:attr('style', 'background-color: #FFED4C') elseif args.Rarity == 'Common' then rarity:attr('style', 'background-color: #56E156') elseif args.Rarity == 'Very rare' then rarity:attr('style', 'background-color: #FF6262') end return tostring(row) end return export