Module:HeroData: Difference between revisions

Sur (talk | contribs)
m icon/grey called
Sur (talk | contribs)
m icon color dynamic to category
Line 138: Line 138:
-- 15px and link to stat name (page name might not match perfectly yet)
-- 15px and link to stat name (page name might not match perfectly yet)
image_file = util_module.get_image_file(image_file_name, 15, stat_name)
image_file = util_module.get_image_file(image_file_name, 15, stat_name)
icon_template_title = mw.title.new("Template:Icon/Grey")
-- Create the template'd icon
local icon_color
if (category == "Weapon") then
icon_color = "Brown"
elseif (category == "Vitality") then
icon_color = "Grey"
end
icon_template_title = mw.title.new("Template:Icon/" .. icon_color)
icon_template_args = {}
icon_template_args = {}
icon_template_args[1] = image_file
icon_template_args[1] = image_file
Line 145: Line 153:
-- First add localized stat name for left column
-- First add localized stat name for left column
stat_values[category] = stat_values[category] .. "," .. label
stat_values[category] = stat_values[category] .. ',<span style="color: #999999; background-color: #2F2F2F;">' .. label .. '</span>'
-- Then add icon and stat value for right column
-- Then add icon and stat value for right column
stat_values[category] = stat_values[category] .. "," .. icon_and_value_str
stat_values[category] = stat_values[category] .. ',' .. icon_and_value_str
end
end