Module:Abilities/card: Difference between revisionsGive feedback
Jump to navigation
Jump to search
Gammaton32 (talk | contribs) added melee scaling |
Gammaton32 (talk | contribs) add line break in generated upgrade descriptions |
||
| Line 369: | Line 369: | ||
function create_description(prop, frame) | function create_description(prop, frame) | ||
local description = '' | |||
local first = true -- Track if it's the first entry | |||
for k, v in pairs(prop) do | |||
if type(v) ~= 'table' then | |||
local formatted_value = utils.format_value_with_prepost(k, v, frame) | |||
local attr_name = lang.get_string(k..'_label') | |||
-- Add line break if this is not the first item | |||
if not first then | |||
description = description .. '<br>' | |||
end | |||
description = description .. string.format('%s %s', formatted_value, attr_name) | |||
first = false -- After first item | |||
end | |||
end | |||
return description | |||
end | end | ||