Module:Utilities: Difference between revisionsGive feedback
m deep_copy > p.deep_copy |
m get_slot_color initial |
||
| Line 100: | Line 100: | ||
end | end | ||
return copy | return copy | ||
end | |||
local slot_category_to_color = { | |||
["Weapon"] = "c97a03", --orange | |||
["Armor"] = "659818", --green | |||
["Tech"] = "8b56b4" --purple/pink | |||
} | |||
function p.get_slot_color(slot) | |||
if type(slot) == 'table' and slot.args then | |||
frame = slot | |||
slot = frame.args[1] | |||
end | |||
if slot == nil then | |||
return "'slot' parameter must be provided" | |||
end | |||
local color = slot_category_to_color[slot] | |||
if color == nil then | |||
return "'slot' " .. slot .. " is not in slot_category_to_color map" | |||
end | |||
return color | |||
end | end | ||
return p | return p | ||