Editing Module:UtilitiesGive feedback
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
| Latest revision | Your text | ||
| Line 111: | Line 111: | ||
local slot_colors = { | local slot_colors = { | ||
["Weapon"] = { | ["Weapon"] = { | ||
hex = " | hex = "c97a03", | ||
rgb = " | rgb = "201,122,3", | ||
hsl = " | hsl = "35,97%,40%", | ||
cmyk = "0%, | cmyk = "0%,39%,98%,21%" | ||
}, | }, | ||
["Armor"] = { | ["Armor"] = { | ||
hex = " | hex = "659818", | ||
rgb = " | rgb = "101,152,24", | ||
hsl = "82, | hsl = "82,73%,34%", | ||
cmyk = " | cmyk = "34%,0%,84%,40%" | ||
}, | }, | ||
["Tech"] = { | ["Tech"] = { | ||
hex = " | hex = "c288f0", -- purple | ||
rgb = " | rgb = "194,136,240", | ||
hsl = " | hsl = "276,79%,74%", | ||
cmyk = " | cmyk = "19%,43%,0%,6%" | ||
} | } | ||
| Line 237: | Line 237: | ||
-- Expands multiple of the same template in a single preprocess call | -- Expands multiple of the same template in a single preprocess call | ||
function p.expand_templates(frame, template_name, args_array) | |||
function p.expand_templates(frame, template_name, | |||
local strings = {} | local strings = {} | ||
for | for i, args in ipairs(args_array) do | ||
local parts = {"{{", template_name, "|"} | local parts = {"{{", template_name, "|"} | ||
for j, arg in ipairs(args) do | for j, arg in ipairs(args) do | ||
| Line 256: | Line 248: | ||
strings[i] = table.concat(parts) | strings[i] = table.concat(parts) | ||
end | end | ||
local expanded = | local expanded = frame:preprocess(table.concat(strings, "\x01")) | ||
return mw.text.split(expanded, "\x01") | |||
return | |||
end | end | ||
return p | return p | ||